Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Superclass
Message
 
À
22/05/1997 18:56:35
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
Divers
Thread ID:
00033281
Message ID:
00033458
Vues:
38
> > >Can I have a class that can modify a textbox class and a spinner class > >at the same time ? > >I want to use a new property or the same method in both classes. > > > >For example: > > > >I want the lostfocus event execute the same thing for both classes, > without > >using an external function, and I want to declare a new property that can > >be used in both too. > > You can't do exactly what you want because you can't change FoxPro's class > hierarchy (BTW, there's no such thing :))). > > But you can define a Behavior class. This Behavior must have all common > methods. Your classes will have a property that will keep a reference to a > Behavior object. All methods for this classes will just call the the > corresponding methods of Behavior object. > Vlad, I like the idea of a behaviour class, but why not give each base class a behaviour class (or is this what you suggest?), to be instantiated with addobject. This is the way one works around the lack of 'multiple inheritance' (Doug is that not what you were looking for?). This way all the base classes can share methods _and_ properties ... or am I missing something? > Disadvantage: You can not do the same thing for properties since there is > no possibility to call (automatically) a method everytime a property is > used (like you can do in Visual C++). And this is a VERY BIG lack of VFP. > I must be missing something ... :) Marc

If things have the tendency to go your way, do not worry. It won't last. Jules Renard.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform