3.9 Sizeability

One of RapaGUI's premium features is its capability to automatically recalculate the complete GUI layout when resizing the window that contains the widgets. This, however, is only possible if all groups in a window can be resized, otherwise the window's size will stay fixed and won't be resizable. In order to create windows that are freely resizable, you need to know which widgets are resizable and which are not. Consider the following GUI definition:

 
<window>
   <vgroup>
      <button id="btn">Hello World!</button>
   </vgroup>
</window>

This window will only be horizontally resizable because button widgets are only horizontally resizable by default. They aren't vertically sizable by default because buttons which change their vertical size look pretty ugly. Normally, a button's height is fixed to the standard button height as defined by the theme currently active on the operating system.

If you want this window to be resizable, you have several options: A widely used option is to insert empty space using objects of Rectangle class. These are resizable in all directions. Thus, if you insert a <rectangle> object, your window will suddenly become resizable in all directions:

 
<window>
   <vgroup>
      <button id="btn">Hello World!</button>
      <rectangle/>
   </vgroup>
</window>

Alternatively, you could also insert a different widget which is vertically resizeable, for example a listview. Or you could even make the button vertically resizable by setting the Area.FixHeight attribute to False:

 
<window>
   <vgroup>
      <button id="btn" fixheight="false">Hello World!</button>
   </vgroup>
</window>

But this doesn't look so pretty because now the user could end up with a button that is a few hundred pixels in height. That's why the <rectangle> approach is the one most oftenly used to insert padding space for non-resizable objects.

In order to use <rectangle> objects as padding space in the right positions, you need to know which widgets are resizeable by default and which are not. Therefore, here is an overview of the sizeability of the individual widgets supported by RapaGUI:

Busybar class:
Horizontally resizable.

Button class:
Horizontally resizable.

Checkbox class:
Not resizable.

Choice class:
Horizontally resizable.

Combobox class:
Horizontally resizable.

Hollywood class:
Not resizable.

HLine class:
Horizontally resizable.

HSpace class:
Vertically resizable.

HTMLview class:
Resizable in all directions.

Image class:
Not resizable.

Label class:
Not resizable.

Listview class:
Resizable in all directions.

Pageview class:
Resizable in all directions.

Popcolor class:
Horizontally resizable.

Popfile class:
Horizontally resizable.

Popfont class:
Horizontally resizable.

Poppath class:
Horizontally resizable.

Progressbar class:
Horizontally resizable for horizontal progress bars. Vertically resizable for vertical progress bars.

Radio class:
Not resizable.

Rectangle class:
Resizable in all directions.

Scrollbar class:
Horizontally resizable for horizontal scrollbars. Vertically resizable for vertical scrollbars.

Scrollcanvas class:
Resizable in all directions.

Scrollgroup class:
Resizable in all directions.

Slider class:
Horizontally resizable for horizontal sliders. Vertically resizable for vertical sliders.

Text class:
Horizontally resizable.

Texteditor class:
Resizable in all directions.

Textentry class:
Horizontally resizable.

Textview class:
Resizable in all directions.

Treeview class:
Resizable in all directions.

VLine class:
Vertically resizable.

VSpace class:
Horizontally resizable.

Of course, you can change these defaults by setting the Area.FixWidth and Area.FixHeight attributes accordingly to enable or disable certain sizeability settings, but this is often not recommended because it will look pretty ugly if for example a textentry widget is suddenly vertically resizable. This would unnecessarily confuse the user because he might end up with a textentry widget which is 300 pixels in height but only allows to enter one line of text. Thus, the best idea is to respect the OS defaults for the standard widgets.

Of course, there are also widgets where it's completely acceptable to override the defaults from above. For example, widgets deriving from Hollywood class are non-resizable by default but of course you are encouraged to use Area.FixWidth and Area.FixHeight to adjust the widget's sizeability to your personal needs.


Show TOC