Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mirroring and alltrim()

Status
Not open for further replies.

ju30ly30

Programmer
Jul 19, 2007
2
CA
Hello all,

In my application I need to incorporate mirroring to each object within a form so that it will display properly for an Arabic GUI.
For grid objects I need to add alltrim() to controlsource where the field Type() is character. What do I need to add to the grid code to get the alltrim() working?

** My grid code
IF ATC("Page",This.Parent.BaseClass) = 0 && IF Parent is not a page object.
This.Left = This.Parent.Width - (This.Left + This.Width)
ELSE && Else Parent is a page object.
This.Left = This.Parent.Parent.PageWidth - (This.Left + This.Width)
ENDIF

*-- Adjust the inside controls (To Mirror Properties.) .....
*-- Assign the RightToLeft and Alignment properties.
LOCAL oColumn as Column, oControl

*-- Loop Grid columns.
FOR EACH oColumn IN This.Columns
oColumn.Alignment = 1 && 1-Right for Arabic language,

*-- Loop Column controls.
FOR EACH oControl IN oColumn.Controls
IF PEMSTATUS(oControl,"Alignment",5)
oControl.Alignment = 1 &&Right for Arabic language,
ENDIF

IF PEMSTATUS(oControl,"RightToLeft",5)
oControl.RightToLeft = .T.
ENDIF

ENDFOR
ENDFOR


thanks for your help.
 
Code:
FOR EACH oColumn IN This.Columns
  oColumn.Alignment = 1 &&  1-Right for Arabic language, 
  if not empty(oColumn.ControlSource) and ;
  type(oColumn.ControlSource) = 'C' && notice, we don't use "" in type to get controlsource evaluated
     oColumn.ControlSource = 'alltrim( ' + oColumn.ControlSource + ')'
   endif

Not tested.

 
Thank you! I tried the code and it works perfect.
 
If the app runs on an middle eastern windows version, the RightToLeft property should take care of your problem.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top