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:
Button class:
Checkbox class:
Choice class:
Combobox class:
Hollywood class:
HLine class:
HSpace class:
HTMLview class:
Image class:
Label class:
Listview class:
Pageview class:
Popcolor class:
Popfile class:
Popfont class:
Poppath class:
Progressbar class:
Radio class:
Rectangle class:
Scrollbar class:
Scrollcanvas class:
Scrollgroup class:
Slider class:
Text class:
Texteditor class:
Textentry class:
Textview class:
Treeview class:
VLine class:
VSpace class:
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.