Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Access Method
Message
De
19/12/2019 11:03:16
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
19/12/2019 10:30:00
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
Divers
Thread ID:
01672305
Message ID:
01672326
Vues:
58
>>>>My application has a global object (oApp). I want to add a property to this global object, oApp.text_forecolor and set the value of this property (at the top of the application). E.g.
>>>>
>>>>oApp.text_forecolor = "230,23,44"
>>>>
>>>>
>>>>Then every text box of the application, when being instantiated, will set the forecolor to this value. Example:
>>>>
>>>>*-- Some textbox
>>>>INIT Method
>>>>this.forecolor = oApp.text_forecolor
>>>>
>>>>
>>>>Would it make more sense (for the speed) to use the Access method instead of the INIT method to set the textbox ForeColor?
>>>>
>>>>Thank you.
>>>
>>>I don't think there will be any noticeable speed difference. But you don't really need to set this value programmatically at all. Instead you create a forecolor_access method:
>>>
>>>*Textbox.forecolor_access
>>>return  oApp.text_forecolor
>>>
>>>If your application has a subclassed textbox class (and it really should), you only need to do this in this subclass.
>>
>>Thank you very much. I will try the approach you suggest.
>
>I just checked, and it looks like you can NOT use the backcolor_access approach I suggested. Clearly the controls themselves use the "real values. So go for the init version you mentioned.

I thought this shouldn't work, but then I'm a bit out of the loop and didn't have a ready example to try it on, so I waited to see :). I think the access methods work on programmatic access to a property, ie. when it's used in an expression, not when runtime uses a property to render a graphic element (unless it's one of dynamic* properties in a column, which are eval()ed and thus are treated as expressions).

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform