Layout rules

Lycia imposes some restrictions on the size and alignment of form properties.

These rules are very simple but you must follow them to be sure that your form will look exactly as you want to.

If any element (root container, container, or widget) has horizontal/vertical alignment other than STRETCH, its size must be defined by a) its size properties or b) the size of its descendents.

This means that if you have any form element with the horizontal/vertical alignment other than STRETCH, you must either explicitly set its size or explicitly set the size of at least one its descendent.

If you use a StackPanel, then all its descendents must have explicit width or height - depending on the stack direction (height for vertical, and width for horizontal).

There are also some exceptions which must be followed as strictly as the rules themselves:

  1. Root containers with horizontal/vertical alignments set to STRETCH ignore any size properties when opened in the full-screen mode.

  2. A root container with horizontal/vertical alignments set to STRETCH must have some size specified when opened in a bordered window. If no size is set, this root container will get the default size of 600x400 px.

  3. Root containers ignore the preferredSize of its child elements if the horizontal/vertical alignment of this child element is set to STRETCH.
  4. Forms which have a CoordPanel as a root container never stretch.

The example program shows what happens if you follow/ignore these rules and their exceptions.

 

 

Contact Us

Privacy Policy

Copyright © 2024 Querix, (UK) Ltd.