Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
WizStyle
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
Divers
Thread ID:
00132678
Message ID:
00132724
Vues:
18
>>Can anyone suggest how to subclass Wizstyle and modify it to allow carring forward info from previous record in a form when useing the txtbtns.vcx part of Wizstyle?
>>I have tried numerous things, but nothing work correctly, even Set Carry On ( of course, I may not be adding it in the right area).
>>
>>TIA,
>>Dan
>Dan,
>Many ways there could be. I don't play with wizards so internal code might not be applicable to all of the ways :
>1)You could directly modify the cmdAdd.click code
scatter memvar memo
>dodefault()
>gather memvar memo
2)You could subclass wizstyle.vcx txtbtns class or have a copy of it to modify :
>* Subclass
>CREATE CLASS mytxtbtns OF myClassLib AS txtbtns FROM (home()+"wizards\wizstyle.vcx")
>* Copy
>ADD CLASS txtbtns OF (home()+"wizards\wizstyle.vcx") to myClassLib
>
>In both cases if myClassLib.VCX doesn't exist it's created. In first you'll have a subclass named myTxtBtns and in second it would be a copy (code could be seen and edited) named txtbtns. Choose either way (second might be easier to handle and if you fully make it the way you like totally replace the original with yours) then modify the class code using dodefault() if subclassed and needed (and you could also subclass your new class for picbtns to have icon buttons).
>Now after modifying the class, form(s) also should know which class to use. Doing it in designer needs the old to be removed and new to be added, but in fact we only want to change its class name and class library (designer can't do that). Say your form is named mybillingform.scx. In command window (Form designer not open or "mybillingform.scx" is not the one in designer) :
* if create class is used
>use mybillingform.scx
>replace class with "myTxtBtns", ;
>    classloc with sys(5)+curdir()+"myClassLib" ;
>    for class = "txtbtns"
> use
>* if add class is used
>use mybillingform.scx
>replace classloc with sys(5)+curdir()+"myClassLib" ;
>    for class = "txtbtns"
> use
3)"Set carry" migth be easiest if wizstyle.txtbtns class doesn't do something internally. Set carry is scoped to current data session. So you should have it in your form ie: dataenvironment.beforeopentables, form.load.
>Cetin

I wouldn't subclass anything in WIZSTYLE. I would copy any of its classes I wanted to use to my own class library, rename the class in the command window, and then start modifying. WIZSTYLE makes a questionable set of base classes, and you might not want to be tied to them. They are not designed to be modified or used anywhere but the form wizard. If you want to modify those base classes, you can do that, but you might prefer that the new versions have their own names.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform