Progress
Translation Manager
Guide


Explicitly Sizing and Positioning Widgets

If developers use explicit sizing and positioning when they define widgets, the application is easier to translate and the interface layout does not vary from one translation to another. Relative layouts, while easier for a developer to code from the Procedure Editor, have more problems compared to layouts made with the AppBuilder, which uses absolute sizes and coordinates.

The following code in tmproc1.p shows an example of code created in the Procedure Editor:

tmproc1.p
DEFINE VARIABLE a AS LOGICAL VIEW-AS TOGGLE-BOX 
    LABEL "Replace if E&xists".
DEFINE VARIABLE b AS LOGICAL VIEW-AS TOGGLE-BOX 
    LABEL "Check Syntax Now".

DEFINE FRAME myframe
  "Options" VIEW-AS TEXT AT ROW 1 COL 1 SKIP
  a SPACE(2)
  b
  WITH 1 DOWN. 

This code example has the following translation problems:

To design for translatability, use the following code instead of the code in tmproc1.p:

tmproc2.p
DEFINE VARIABLE a AS LOGICAL VIEW-AS TOGGLE-BOX 
    LABEL "Replace if E&xists" SIZE 30 BY 1.
DEFINE VARIABLE b AS LOGICAL VIEW-AS TOGGLE-BOX 
    LABEL "Check Syntax Now" SIZE 30 BY 1.

DEFINE VARIABLE b AS LOGICAL VIEW-AS TOGGLE-BOX 
    LABEL "Replace if E&xists":L25.

DEFINE FRAME myframe
  "Options" VIEW-AS TEXT SIZE 8 BY .85 AT ROW 1 Col 1
  a AT ROW 2 COL 1
  b AT ROW 3 COL 1
  WITH 1 DOWN SIZE 40 BY 10. 

NOTE: Even when you use explicit sizing and positioning of widgets, you can still encounter text-expansion problems unless you also create margin space around widgets to accommodate expanded text phrases.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095