Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Access Method
Message
 
 
À
21/12/2019 10:57:57
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
Divers
Thread ID:
01672305
Message ID:
01672387
Vues:
46
>>My textbox base class (in my application) has a property .BACK_COLOR_FOCUS (current has a value hard-coded). This property would have to be set to the value oApp.BACK_COLOR_FOCUS (Access method of the oApp class). But I cannot set it in the visual class. In a PRG class that would work.
>
>Here, this works (all in command window; curform.prg is on the path):
>
create class testThomas as textbox of libs\ctls
>ox=curform()
>ox.AddProperty("backcolor_x","=goapp.bkcolor")   && next I saved the class and closed class editor
>goapp=createobject("empty")
>addproperty(goapp, "bkcolor", 32)
>_screen.NewObject("oxx", "testthomas", "libs\ctls.vcx")
>?_screen.oxx.backcolor_x
>Here's curform.prg, which you can actually do in command window line by line:
>
ASELOBJ(aa,1)
>RETURN aa[1]
>It doesn't really matter that there's a goapp.bkcolor_access method or not - I suggested having that method just for debugging, to see how many times it fires. The .bkcolor property (and other of your color properties) may as well be set in goApp.ReadConfig() method, or even hardcoded.

Sorry for getting back to the technical discussion. My code now, with the change of the Function to Procedure works; but only in a PRG created Textbox class. Here is what I do:
1. In the visual class TextBox (e.g. MyTextbox inherited from the VFP base textbox), I add a property .back_color_focus
2. In this visual class I set the value of this property, .back_color_focus, to oApp.back_color_focus
3. At run-time, when the base textbox class is instantiated, the Access method of the oApp (method oApp.back_color_focus_access) never fires. Therefore the value of the textbox property .back_color_focus remains empty.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform