Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Verify each object contained in form even with class obj
Message
From
13/12/2006 14:47:16
 
 
To
13/12/2006 14:12:59
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01177307
Message ID:
01177352
Views:
17
>I need to change in runtime some of the captions of labels and/or commandbutton, due to certain preferences of users. It's near to change the caption when switching between languajes.

It's much easier to do the opposite, namely set the caption to an expression. Personally I use an object , oCaptions, to store all the captions.
One example:
oCaption.cmdExit='Exit'
cmdExit.caption=oCaption.cmdExit
To change the caption, I change oCaption.cmdExit, and the caption is changed.

To populate the object, I use a table with two fields, Name and Caption. The following lines creates and initializes the object.
If Vartype(oCaption)#'O'
  Public oCaption
  oCaption=CreateObject('parameterX')
EndIf 

Use CapList
Scan
  oCaption.AddVar(trim(name),trim(caption))
Endscan 
*****
define class ParameterX as custom
  function This_Access(tcMember)
    if type('This.' + tcMember) = 'U'
      This.AddProperty(tcMember)
    endif
    return This
  EndFunc
  function AddVar(tcMember,tcData)
      AddProperty(this,tcMember,tcData)
    return This
  endfunc
EndDefine
Previous
Reply
Map
View

Click here to load this message in the networking platform