Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is there any way around this issue?
Message
From
28/05/2003 22:08:37
 
 
To
28/05/2003 19:16:29
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00793727
Message ID:
00793777
Views:
52
>I'm just trying to find a way to keep everything encapsulated in one location. The >form really has nothing to do with what I need to have happen when I click the >button. I would like to keep all the code inside the button, but I don't like >creating a class for a single use. I'm hoping someone has found a different >solution.

>In theory, I would like to keep it possible (even though I would never do it) to >copy the button into the clipboard and paste it into another form. Just the way I >prefer to program

The desire to add properties and methods to the VFP base classes is a good reason not to use them directly, but instead create a complete set of subclasses that give you the complete functionality of the base classes. These are generally thought of as "abstract" classes and are not meant to be instantiated into objects. A second set of identical "concrete" classes is derived from this abstract set and can be used just like the VFP base classes. This second set can also be subclassed as needed to meet specific needs for extended functionality, like the button method you would like to implement.

I know this is pretty far afield from your original question (and only a gloss of the subject), but you cannot create the button method without subclassing. Markus Egger's book "Advanced Object-Oriented Development with VFP 6" is an excellent discussion of the subject.

John
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform