Dialog Unit and Dialog Size Handling

When you use a dialog box, however, you do not need to take care of this difference. Dialog templates use dialog units. The dialog unit is expressed in terms of the default standard character size. [A horizontal dialog unit is 0.25 of the standard character size. A vertical dialog unit is 0.125 of the standard size. ] Therefore you do not need to reformat a dialog box when displaying it on DBCS PM. Dialog boxes will be automatically sized. However, as we already discussed in System Default Font, the size of the biggest dialog box must not bigger than the size of the screen, or the end user will have a window operation problem. Suppose the width of your dialog box is 350 dialog units, it fits for VGA on SBCS PM but is too wide for VGA and DA/2 on DBCS PM.

Another consideration is that an English phrases are usually shorter than equivalent phrases in other languages; therefore, additional space is required for translation. See Section MRI Expansion of National Language Information and Design Guide: Volume 1 (SE09-8001).

The dialog unit provides device-independence of relations between the sizes of dialog elements (windows, controls and system font). However, the proportion of the dialog unit to the screen in pel is not device-independent. The following shows how to calculate the size of a dialog unit by the screen resolution of the display device and the system default font: (please also refer the Display devices' screen size in pel and in dialog unit)

  screen size in pel          dialog unit in pel
                   |          |
                   V          V
                  ----   ------------
       - Width  :  640 / ( 6 * 0.25 ) = 426.6666...
       - Height :  480 / (16 * 0.125) = 240

   (Case of VGA on SBCS PM)


       - Width  :  640 / ( 8 * 0.25 ) = 320
       - Height :  480 / (18 * 0.125) = 213

   (Case of VGA on DBCS PM version 2.x)


       - Width  : 1040 / (12 * 0.25 ) = 346.6666...
       - Height :  768 / (24 * 0.125) = 256

   (Case of DA/2 on DBCS PM version 1.x)


[Back: Font Size Handling]
[Next: Loading Fonts]