Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Copy properties/methods from one class to another?
Message
 
À
17/05/1997 08:41:14
Jon Ziegler
Mannesmann Dematic Corp.
Solon, Ohio, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00032522
Message ID:
00032677
Vues:
45
>>>>>>Is it possible to copy or move a method or property from one class to another? I know it's possible to move classes from one .VCX to another, but what about the individual methods and properties within a class?
>>>>>
>>If the object/class is going to be alot like the first two ideas come to mind. Is it enough like the first to really call for anyother instance-would addition underlying classes do the job better and keep the functionality compact. If you need to replicate the methods/properties try the following
>>
>>In the project window with the class tab active pick/drag and drop the "from" class into another class lib. A copy will be made. In the copy to class lib right click on the copied class and rename it to the new class name. pick/drag and drop the renamed class back to the intended class library and delete the renamed copied one. Open the class and use the class menu edit/remove function to drop the properties and methods you do not want/add your new ones etc. It is good practice to clean up/pack this modified vcx to get the deleted rows for the delete properties/methods out of their for real.
>>Hope This Helps
>>Gary
>
>Actually, my original intentions, which I should have made a little bit clearer, was to physically move properties/methods because I had put them in the wrong classes in the hierarchies which I created. From hearing some of the suggestions, I think I have an idea how I might do this: the SYS(1270) function gives an object reference to anything that the mouse is over - even in design mode. I'm going to create two macros: (F11) o1 = SYS(1270) and (F12) o2 = SYS(1270) and try to use something like o1.ReadMethod() = o2.WriteMethod() after moving the mouse cursor to the two appropriate objects and create the two different object references using the macros. I'll try this and see what I can come up with.

if that's all you want to do, add the classlib that has the classes and the classlib that should have them to a project. then drag and drop the classes to move from one classlib to the other.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform