Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Two problems when dealing with container based classes
Message
From
18/12/2002 11:05:58
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Two problems when dealing with container based classes
Miscellaneous
Thread ID:
00734115
Message ID:
00734115
Views:
51
There's two main problems that have continually frustrated me when working with container based classes. I finally decided to post them and see if I'm missing some obvious solution. This is with VFP 7.

I have three class libraries: idgBase, idgCmplx, idgBiz. These are the basic libraries for all clients. For each client, I subclass all three. The problem is that the controls in idgCmplx are mostly container based controls with other controls inside. The inside controls are from idgBase. When I make client subclasses, I'd like the inside controls to be based on the subclassed controls. I'm not sure that makes sense, so I'll give an example.

Let's say I have a class idgX in idgCmplx that is a container with a textbox and a command button in it. The container, textbox, and command button are all from idgBase. I have a client ABC. So I make abcBase, abcCmplx, and abcBiz. I now have a class abcX in library abcCmplx, but inside there are a textbox and button that are still from idgBase. So if I make changes to the abcTextbox, it has no effect on the textbox in abcX.

Is there a way I can tell VFP that I want any contained controls to come from a differnet library when I subclass it? If not, how do people deal with this? I can't imagine I'm the only one to have this problem.

The second problem I have is dealing with control sources. Again, using my example of a class with a textbox and a command button, I want the textbox to be linked to the data, but at design time, I don't want to set the controlsource of the textbox. I try to set everything at the container level and not mess with the internals. But containers don't have controlsources. I've found ways to deal with this like making a pseudo controlsource and passing it to the textbox on init, but this all seems so kludgy. Is there a better way?

Thanks,

Michelle
Next
Reply
Map
View

Click here to load this message in the networking platform