Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sub-classing an SCX form...
Message
De
05/09/2002 13:22:03
 
 
À
05/09/2002 02:22:06
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00696958
Message ID:
00697169
Vues:
19
>>Due to my lazyness I am asking this question. Is it possible for the parent class of an SCX form to be another SCX form? My thought would be no but this is VFP after all!
>
>No, only a VCX based parent class form. You can take an exisitng SCX form and do a SaveAsClass (from the File menu) and then subclass that VCX based form class in an SCX form. SCXs are considered more like form instances rather than form classes.

Yea... but here is why I asked, perhaps somone has an idea...

In our 2.6 ap we allow users to modify screens. The way this happens is that they open the screen, SAVE AS to a different name, and then edit a database that tells our system what SPR to run. Of course, if we change a screen, they have to use cut-n-paste to 'inheriet' our changes.

So, how to do the same thing in VFP taking advantage of subclassing. The main problem being, that a FORM CLASS has to be added to SET CLASSLIB where an SCX doesn't and can be run with DO FORM. So, my idea was if they could subclass the SCX form, then if we modify the form, they get the changes.

So, here is what I am thinking now, perhaps someone has a better idea.

Plan One
Let the user subclass the form and edit the subclass. Then, I can just do an ADIR of a specific directory and SET CLASSLIB ADDI to all of the VCX's. OR, I guess I could store the classname and classlib in our factory table and then use NewObject() to run it.

Plan Two
Using the .Net codebehind idea, create the FROM class, with all of the code and controls on it, and then create a SCX FORM from that. Keep all the FORMs external so the user can just edit the SCX. This seems like the best idea.

Plan Three
Modify the code that launches the form to look for FORMNAME.SCX on the disk, if it exists run it, if it doesn't exist then createobj the class FORMNAME.

**********
Thoughts? Another question was, in order for the user to edit the SCX, they need access to the class it is based on and all the control classes. Is it possible to provide these in an APP so the user will not have access to the source code? It's not a big deal, but if possible we would like to protect some of the source. If the class was in an app and they used SUPER CLASS would they get the parent code?

Thanks,
BOb
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform