Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sub-classing an SCX form...
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00696958
Message ID:
00698174
Vues:
18
Nick,

Thanks for the unselfish unveiling of some of your tiny little secrets. :)
I have no need for it right now, but I'll archive this mail (although the UT itself is probably a far better archiver).

Peter

>>>Not exactly subclassing :), but you can easily convert VCX to SCX or vice versa by opening it as DBF and changing the value of UNIQUEID field in the first record from Screen to Class (or back).
>>
>>Nick , I've tried your interesting idea, but it doesn't work. A VCX is a class LIBRARY, whereas a form class is something IN a class library. Did I miss something?
>>
>
>Sure I forgot something :) and didn't tell the tiny little secrets. :)
>
>Since SCX and VCX have the same structure, the deal is in the values of some fields/records and the existence of certain records.
>
>Last time I did it was for VFP5 form class, converting it to the form.
>In VFP 5 it is enough to change "Class" to "Screen" in UNIQUEID field in the first record and rename files (or COPY TO) SCX/SCT. Then you can open it as a form. Note, that it does not have "Dataenvironment" record but it seems not confusing VFP 5 Form Designer. You can just open Dataenvironment and add the necessary cursors and appropriate records will be added to the form's SCX.
>
>To "convert" SCX to VCX you may copy/save your form with .VCX extension, then open that VCX file EXCLUSIVE and change "Screen" to "Class" in the UNIQUEID field in the first record AND type "Class" (without quotes) in RESERVED1 field in the "form" record. Then you delete the "dataenvironment" and "cursor" records and PACK the VCX file. However I don't see much use in such SCX->VCX operations since you can just use Save As Class.
>
>But the conversion VCX->SCX might be useful.
>I just retested with VFP 6 and found that VFP 6 Form Designer is not happy for the SCX not having Dataenvironment record. It brings up the Converter dialog and fails in conversion. So, you can just SCATTER MEMVAR MEMO the Dataenvironment record from any SCX then INSERT BLANK BEFORE the "form" record and GATHER MEMVAR MEMO. You should also remove "Class" word from RESERVED1 field in "form" record.
>
>In all case you need to make sure that "form" record RESERVED2 field still keeps the correct number of controls on the form (form with no controls has 1 in it), as sometimes it disappears during the manipulations.
>
>VCX->SCX "conversion" should be performed on VCX wich contains only the form class, to avoid extra work.
Groet,
Peter de Valença

Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform