Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
General framework and application framework
Message
De
30/09/1998 17:47:21
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00142159
Message ID:
00142592
Vues:
23
Evan, theproblem I think you are trying to solve arises because VFP (thankfully) doesn't support multiple inheritance. If I understand you correctly, what you want is a way to have classes in different branches inherit certain properties and behaviors from a common source.
This problem can be handled with a behavior class.

Say you have a base form class. Subclassed from this is a base modal, and a base regular form class. Then, each of these is subclassed once for every application. You do this so you can change modal form behavior in one application only, and not have it affect other apps. The problem is, what if you want to change behavior of all forms in one app? You can't do this with one step, because you have to modify both the modal and the regular form class. But you can if you utilize a behavior class. Create a custom class called FormBehavior. Give it a method called SetFormProps. This class will be subclassed once for each app also. Then, when you subclass your form classes for each app, you place an app specific behavior object in each form class, and put in form.init:
THIS.FormBehavior1.SetFormProps(THIS)

Now you have a common place to set properties for every form in your app.
FormBehavior.SetFormProps could contain code like this:
LPARA oTarget
oTarget.backcolor = 0
oTarget.AutoCenter = .T.

You can also implement common method by placing a call to a custom method in this object from the form method in the class definition.
Form.Refresh:
THIS.FormBehavior.Formrefresh()

HTH
Erik Moore
Clientelligence
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform