Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Verify each object contained in form even with class obj
Message
De
13/12/2006 14:47:16
 
 
À
13/12/2006 14:12:59
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
01177307
Message ID:
01177352
Vues:
18
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform