The Root Object is the SHELL. Its main task is to redirect all system events received from the TopLevel Window Manager block (keyboard and mouse input, window move, resize and expose), to its descendent Objects.
Root Manager Main terminal Composite terminal
SHELL is the only Object having no parent; it has only one direct child which is a FORM Object (created automatically by the SHELL).
The FORM belongs to the Manager Object category and it's the only one, except for the SHELL, that may contain other Objects as children (eventually other FORMs). It plays a fundamental role in the library architecture taking care of children resizing and positioning. In addition it despatches to the appropriate child any event, not processed by itself, received from its parent.
Besides the simple FORM Object are the 'Paged', the 'Clipped', the 'Scrolled', the 'Table' and the 'Tabbed' FORMs.
The first one lets you create several children series and manage then one by one.
The second one makes the visible Object area a portion of a larger virtual area. By using the MFormSetClip[XY]() function calls, the application can change the starting offset of the visible area.
The Scrolled FORM is a Clipped FORM with a vertical and an horizontal SCROLLBAR Objects that permit the user to easily change the visible portion of the FORM content.
The Table FORM has the capability to arrange its children in a matrix layout. You have to specify the number of desired columns at creation time; the Object will arrange children objects while you add, wrapping to a new row when the previously created child was located in last column.
The Tabbed FORM is a variant of the Paged FORM which allows page selection via Tab buttons located on the top.
Main terminal Objects are all the remaining not composite Objects. LABEL, EDIT, PBUTTON (push button), TBUTTON (toggle button), RBUTTON (radio button), MENU, DRAWAREA, SCROLLBAR and STATUSBAR belong to this category.
Composite terminal Objects are composed by a Main terminal which needs
the contribution of some Manager and some other Main terminal Object to
This category includes the OptionEdit (a combobox), SpinEdit and all LIST varieties.
The Scrolled FORM is actually a Compound Manager because it's composed by a simple FORM containg a Clipped FORM and two SCROLLBARs.
Except for the SHELL, all Object creation functions require the 'parent' Object identifier as the first argument. It must be a FORM or a SHELL Object type (the SHELL actually redirects the creation to its FORM child).
After creation, Objects have generally a gray background and a black text color (even if not used). Since release 3.0 LABEL, TBUTTON and RBUTTON are actually transparent so they appear with same background set in their parent Object. These colors can be changed at any time via the MObjectSetColor(), MObjectSetBackgroundRGB() and MObjectSetForegroundRGB() function calls.
Objects have a default shadow that can be modified after creation via the MObjectSetShadow() function call. Allowed shadow types are those identified by the macros: WS_SHADOW_IN, WS_SHADOW_OUT, WS_ETCHED_IN and WS_ETCHED_OUT. When changing a shadow you should not contort it, for example making a LABEL look like a PBUTTON.
Additional colors allocation (and free) are made by the Object itself to generate the 3-D look, both on creation and when the application assignes new colors to it.
Although Object font (when required) is specified in the creation function call, it's possible to change it later, by using MObjectSetFont().
The typical MGUI application flow is summarized in the following: