General information
Category:
Forms & Form designer
Frank,
It's not too difficult to write a resize object. In all my interface baseclasses, I've created a property which is an object reference to my resize object. When the form inits, I NEWOBJ the autoresize object. It determines it's relative size and position in it's container, and adjusts the calling object accordingly. I also created resize methods in all my interface baseclasses, which call the resize method of this object.
There are now 2 important tricks:
1) You have to adjust all your base container classes to go through the control object array and call all the resize methods of each object.
2) YOu have to create a custom event which releases the reference to the resize object (otherwise you get that nasty dangling reference problem when your containers are destroyed). Kevin McNeish wrote a great article about custom events in the Jan. 2000 FoxPro Advisor. It's pretty basic stuff.
It took about a day for me to write this resize object, and now I never have to think about it. It's very cool, actually. Everything I place on a form automatically resizes, and I don't have to do a thing. You can even tweak the resize object to re-adjust font sizes etc. depending on how much the objects resize. Very powerful. The resize code in all my non-baseclasses is empty, yet everything automatically resizes! It's great.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only