Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Class Method Visibility
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00554548
Message ID:
00554603
Vues:
8
>>I'm a bit confused - can somebody please shed some light.
>>
>>I have created a class that has various methods ie FillList
>>Now if this is set as public then all is fine. If however I change this to Protected or Hidden then an object on a form created from this class no longer works.
>>
>>The only call to FillList is within the original Class definition.
>>
>>So what exactly is the point of Protected and Hidden?
>
>Protected properties, events and methods (PEMs) can only be accessed by the object itself. Outside objects can not access them. This is useful if you have an internal process that must take place in a certain order. You expose the Parent method so objects can execute it. It then makes the internal calls so the process runs smoothly.
>
>Hidden PEMs extend this non-accessibility to subclasses of the object. Only the original class itself can access hidden PEMs. Subclasses can not. This is useful when distributing classes and you don't want the public interface "gummed up" with useless PEMs or you don't want the code changed. For example, if you subclass the Custom object to make a business object class, you may not want to see methods like CloneObject or SaveAsClass in the property sheet. You can hide these and the property sheet will only show those methods that the developer can access and change.
>
>HTH.

Larry,

That all makes sence in the reading and I thought that that was what I was doing but....

Basically I have a class with a FillList Method. Now an object within this control class calls the FillList method when clicked on.

When I use this class in my form if FillList is Protected or Hidden then when you press the button an error occurs.

How else do I make up composite controls with Hidden methods?
Caroline
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform