nGuiFormLayout Class Reference
[Graphical User Interface]
#include <nguiformlayout.h>
Inheritance diagram for nGuiFormLayout:

Detailed Description
Lays out size and position of child widgets based on own position.This works similar to a MEL formLayout.
Relations between child widgets and the form layout are defined by connecting their edges either to the form, to other widgets, or to a (relative) position:
- Attach To Form: Attaches the edge of a child widget to an edge of the form
- Attach To Widget: Attaches the edge of a child widget to the closest edge of another child widget.
- Attach To Position: Attaches the edge of a child widget to a relative position, expressed in percent of the form layout's size.
(C) 2004 RadonLabs GmbH
Definition at line 31 of file nguiformlayout.h.
Public Types | |
| enum | Edge { InvalidEdge, Top, Bottom, Left, Right, HCenter, VCenter } |
| edge types More... | |
Public Member Functions | |
| nGuiFormLayout () | |
| constructor | |
| virtual | ~nGuiFormLayout () |
| destructor | |
| void | ClearAttachRules () |
| clear attachment rules | |
| int | AttachForm (nGuiWidget *widget, Edge where, float offset) |
| add an "Attach To Form" layout rule | |
| int | AttachWidget (nGuiWidget *widget, Edge where, nGuiWidget *other, float offset) |
| add an "Attach To Widget" layout rule | |
| int | AttachPos (nGuiWidget *widget, Edge where, float pos) |
| add an "Attach To Position" layout rule | |
| virtual void | OnRectChange (const rectangle &newRect) |
| called when widget position or size changes | |
Static Public Member Functions | |
| static Edge | StringToEdge (const char *str) |
| convert string enum to Edge | |
Protected Types | |
| enum | AttachType { Form, Widget, Pos } |
| attachment types More... | |
Protected Member Functions | |
| void | UpdateLayout (const rectangle &newRect) |
| update the layout of child widgets | |
| void | FixMinMaxSize (nGuiWidget *widget, Edge anchor, rectangle &rect) |
| fix rectangle size based on widget's min/max size | |
Protected Attributes | |
| nArray< Rule > | attachRules |
Classes | |
| struct | Rule |
| holds an attachment rule More... | |
Member Enumeration Documentation
|
|
edge types
Definition at line 35 of file nguiformlayout.h. |
|
|
attachment types
Definition at line 70 of file nguiformlayout.h. |
Constructor & Destructor Documentation
|
|
constructor
Definition at line 12 of file nguiformlayout_main.cc. |
|
|
destructor
Definition at line 21 of file nguiformlayout_main.cc. |
Member Function Documentation
|
|
clear attachment rules
Definition at line 95 of file nguiformlayout.h. |
|
||||||||||||||||
|
add an "Attach To Form" layout rule
Definition at line 30 of file nguiformlayout_main.cc. |
|
||||||||||||||||||||
|
add an "Attach To Widget" layout rule
Definition at line 48 of file nguiformlayout_main.cc. |
|
||||||||||||||||
|
add an "Attach To Position" layout rule
Definition at line 66 of file nguiformlayout_main.cc. |
|
|
called when widget position or size changes Called when the size of the widget changes. Will re-apply the layout rules on its children widgets. Reimplemented from nGuiWidget. Reimplemented in nGuiSlider2, and nGuiTextView. Definition at line 363 of file nguiformlayout_main.cc. |
|
|
convert string enum to Edge
Definition at line 105 of file nguiformlayout.h. |
|
|
update the layout of child widgets Update the layout of child widgets. Will be called from and OnRectChange(). Definition at line 195 of file nguiformlayout_main.cc. |
|
||||||||||||||||
|
fix rectangle size based on widget's min/max size Fix the rectangle inplace so that it honors the widget's minimum and maximum size. Definition at line 86 of file nguiformlayout_main.cc. |
Member Data Documentation
|
|
Definition at line 87 of file nguiformlayout.h. |
The documentation for this class was generated from the following files: