Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Create VCX class from PRG?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00114121
Message ID:
00114176
Vues:
17
>Is there any way to create a VCX based class that is a sub-class of a PRG based class?



I can Use the .vcx directly to change some properties of a certain object.

Suppose there is 10 objects in Form.
when Designing the Form, I use Right-Mouse and capture the Ordered Seq. Number
of the object that I want to edit!
e.g. Object txtOrderDate is 7.
In case I have decide a new txtbox class(e.g. txtDate) to input the Date, But I don't want to edit too much things, including fonts, color, Form Order Seq, Size.....

Then, I close the VCX and Save it. So, the Form object will be put at last few records of VCX( Vcx, and all saved file except prg are normal VFP dbf file!!)

Then, I do manually following steps:

Use MyVcx.vcx
Go Bottom && because the last save will put at bottom.
* Suppose you put more forms in same VCX, it will more fast to find it!
Browse && You will see last record is the form name!!
* In most cases, if NO time-stamp, the row will be the Form OBject/ Top level defined Object.
* Then, I find the correct object will nearest bottom record or
* counting the Order Seq. Number if many! ^_~
Double-Click Objname and find correct object!
When found, close memo and Double-Click Classloc and Class memo So, I change to my defined Classloc to txtLibrary.vcx and also Class is txtDate!
Use in MyVcx.vcx to close vcx file!

So, when edit the form in form designer again, the object has used my defined txtDate but most other feature including procedure, size, ... are remain!
Thus, after I compare the total time to change the form object will different class, this is quite fast!! ^_~



In MY view, since changing Class of object is simple but need take care if:
You want to change a Combox to textbox...
some properties is not exist!! e.g. controlsource...
you need to take more care if change into totally different type of object!



Back to your question, I suggest you to copy the vcx, vct into dbf and cdx name
and tract it as a normal table to do...
after successful test, then overwrite the original one!! ^_~
but if you want to make a NEW vcx with all coding control....
you need pay much time to study the vcx structure well!!

If so, a prg to change a prg programmer-defined form into a well done VCX file
is very worth!! I totally agree with you if you have time to do so!!
Even I have a wish list that furture VFP can convert prg form object into VCX!!

Actually, I also have a wish list that:
User can easily custom the Class field on form designer!
So, user can change it will similar self-defined SAME Baseclass class without
doing the serious job that I mention above !!

I think what you want should put in wish list other than try urself!
But... try if have time! ~_^
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform