Form Size and Position

The initial size and position of a form are set in the Uniface IDE using the Height, Width, Top and Left properties in the Properties Inspector of the component. Form height and width are made visible at design time using a blue dashed bottom and right border on the Form canvas, if both Height, Width have a value > 0.

The value of these properties is specified in terms of number of characters, and the character size is determined by the canvas font (Font 0) which is set in the usys.ini file. Therefore, changing the canvas font can affect the appearance of the form.

The Height and Width properties affect the component canvas, but the runtime form may differ because it is affected by the following factors, in order of priority:

  1. The value of the Dimension property when dynamically set in ProcScript using $windowproperties.
  2. The value of the Dimension property supplied as a parameter to the newinstance command.
  3. The value of Cell Height window property as set declaratively.
  4. The value of the CellHeight window property as set in the initialization file.
  5. The size needed to show all entities and fields drawn on the component.
  6. The size of the application window. When required, Uniface resizes the form. If the form is bigger than the application window, it is truncated and scroll bars appear on the form.

Note:

  • When using the Dimension property, values must be expressed as the number of pixels, not the number of characters.
  • The Height and Width properties do not take into account the size of panel and/or menus, whereas $windowproperties does.
  • To have Windows handle positioning, set both Top and Left to 0 for all forms. When multiple forms are displayed, Windows stacks them in an offset cascade, with each form displayed one position below and to the right of the previous form. If there are too many open forms, the stack continues to the bottom of the application window and begins again at top left position.

Related Topics