Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Two problems when dealing with container based classes
Message
From
19/12/2002 11:15:51
 
 
To
19/12/2002 10:23:06
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00734115
Message ID:
00734514
Views:
16
The only other solution I can think of (besides hacking the VCX as Paul suggested) is to instantiate the controls at runtime. That means you don't get a visual design surface because you have to set the Top, Left, Height, and Width properties of the controls manually as you add them. I suppose you could create a tool that take a class you designed visually and writes records to a table from all the controls in it, then have another class (the "real" one that gets instantiated) spin through that table, creating objects of the proper class and setting the properties as per the info in the table.

Hmm... Hacking the VCX sounds easier. :)

I have never run into this problem personally because I don't have a VCX of client-specific base controls (I can't think of anything about a textbox that would be client-specific, for example).

Maybe it's overkill. I don't know. I've only dealt with one client since seting this up. I was just thinking it would be nice to have them seperated by client in case I run into one that, say, doesn't like the font in the textbox.

This may also be resolved using the technique outlined above. Alternatively, you could have an array or collection at the container level that defines the control sources for the various controls. In the Refresh of each control (you can't do it in Init since that method fires for a control before the container), if ControlSource is empty, ask the container to return the control source for this control. The container would look in the array or collection and return the appropriate value.

That's an interesting idea...

Thanks,

Michelle
Previous
Reply
Map
View

Click here to load this message in the networking platform