Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Setting User Defined Backstyle of a label
Message
 
 
À
23/11/2019 19:55:59
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01672005
Message ID:
01672023
Vues:
46
I think Dragan answered better than I ever could (after 20 years of VFP development, I am still a newbie).
But, while I was reading his and your messages, I decided on - maybe - the "boiling frog" approach. I could set the value to 0 without giving a customer ways to override it. Then, start updating customers, one at a time. Maybe they won't even notice the change and all the talk about having a user-defined setting is moot point.
Or, I could leave it the way it works now. I am going to think about it.

>As vfp is basically prototypal, calling a function in the base class to set the property should only run once.
>Next classes of that base class just copy properties from first one and run defined methods.
>But you have put that code/call either in property window if vcx based or in the "declaration area" just after "define class" in prg based class - NOT in .init() or any other function of base class. Check by adding a log entry or wait window...
>
>regards
>thomas
>
>>Hi,
>>
>>I want to default all label controls of the application to use the property .backstyle = 0 (as suggested by Dragan). This will be my preference for the application. All base controls of the application reside in a library dl_base.vcx.
>>Which makes it fairly straight forward to change the property for all label controls (by changing the property of the label control in the dl_base.vcx).
>>
>>But in case a customer wants to see the grey background - currently visible - I need to all them to override the default setting. One way is to have a code in the Init method of the base label. I have set of global settings in the app_settings.xml for various reasons. Adding an element "set_backstyle_1" in the app_settings.xml would be the way to do it. But my concern is that all customers will pay the price of slow loading of the label controls, since on every label the INIT method would check this setting. That is, no matter the method, the INIT code would have to check for something, in order to either override the value .backstyle to 1 or leave it alone.
>>
>>Is there a better approach you can suggest that would not require a code in the INIT method for every load of the label?
>>
>>TIA
"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
Répondre
Fil
Voir

Click here to load this message in the networking platform