IMS2
Pre-Alpha
An Orbiter add-on to allow on-runtime construction of spacecraft from predefined modules
|
Abstract class providing functionality to create and manage GUI elements. More...
Public Member Functions | |
void | RegisterGuiElement (GUI_BaseElement *_element, int _parentId) |
Registers a GUI element that has not been created by this GUIentity. More... | |
int | GetDynamicUID () |
virtual GUI_BaseElement * | GetElementById (int _id) |
GUI_Page * | CreatePage (RECT _rect, int parent, int _id=-1, GUI_STYLE styleId=STYLE_DEFAULT, bool drawbackground=false) |
Creates a new GUI_Page element. More... | |
GUI_Label * | CreateLabel (string text, RECT _rect, int parent, int _id=-1, GUI_STYLE styleId=STYLE_HEADING) |
Creates a new GUI_Label element. More... | |
GUI_LabelValuePair * | CreateLabelValuePair (string label, string value, RECT _rect, int parent, int id=-1, GUI_STYLE styleId=STYLE_HEADING, GUI_FONT valueFontId=GUI_NO_FONT) |
Creates a new GUI_LabelValuePair. More... | |
GUI_ListBox * | CreateListBox (RECT _rect, int parent, int _id=-1, GUI_STYLE styleId=STYLE_LISTBOX, GUI_STYLE scrollbar_styleId=STYLE_LISTBOX, bool _multiselect=false, bool _noSelect=false) |
Creates a new GUI_ListBox. More... | |
GUI_StaticButton * | CreateStaticButton (RECT _rect, int srcX, int srcY, SURFHANDLE _src, int parent, int _id=-1) |
Creates a new GUI_StaticButton. More... | |
GUI_DynamicButton * | CreateDynamicButton (string text, RECT _rect, int parent, int _id=-1, GUI_STYLE styleId=STYLE_BUTTON) |
Creates a new GUI_DynamicButton. More... | |
GUI_CheckBox * | CreateCheckBox (string text, RECT _rect, int parent, int _id=-1, GUI_STYLE styleId=STYLE_CHECKBOX) |
Creates a new GUI_CheckBox. More... | |
GUI_RadioButton * | CreateRadioButton (string text, RECT _rect, int parent, int _id=-1, GUI_STYLE styleId=STYLE_CHECKBOX) |
Creates a new GUI_RadioButton. More... | |
GUI_StatusBar * | CreateStatusBar (RECT _rect, int parent, int _id=-1, GUI_STYLE styleid=STYLE_STATUSBAR) |
void | SetStyleSet (string _styleset) |
Sets the styleset this GUIentity uses. More... | |
GUI_ElementStyle * | GetStyle (GUI_STYLE _styleId=STYLE_DEFAULT) |
GUI_font * | GetFont (GUI_FONT _fontid) |
virtual bool | Update ()=0 |
checks if any children had an update NOT triggered by user input. More... | |
Protected Member Functions | |
virtual bool | AddChildToParent (GUI_BaseElement *child, int parentId)=0 |
Adds a GUI_ElementBase to a parent. More... | |
Protected Attributes | |
map< int, GUI_BaseElement * > | elements |
a searchtree containing all GUI_Elements of this entity | |
UINT | newuid = GUI_UID_DOMAIN |
Variable used to pass out dynamic UIDs for GUI elements. | |
FontsAndStyles * | fontsandstyles |
Pointer to the global FontsAndStyles instance. | |
string | styleset = "default" |
Identifier of the defualt styleset of this entity. | |
Abstract class providing functionality to create and manage GUI elements.
The GUIentity stores GUIelements in a tree that describes a menu structure. It is capable of handling several such trees, so it needn't be restricted to one root. It has random access to all of its decendants and is a single point of entry to create new GUI elements and directly insert them into the proper tree using the uid of a parent. If elements are created dynamically (i.e. without a set uid), the GUIentity will automatically assign them one. UIDs of elements are LOCAL to the GUIentity managing them. Different GUIentities can have elements of the same UID, provided every UID only appears once in every GUIentity.
|
protectedpure virtual |
Adds a GUI_ElementBase to a parent.
Exact behavior depends on implementation.
child | The element to be added to the parent |
parentId | The locally unique identifier of the parent. |
Implemented in GUImanager, and GUIplugin.
GUI_CheckBox * GUIentity::CreateCheckBox | ( | string | text, |
RECT | _rect, | ||
int | parent, | ||
int | _id = -1 , |
||
GUI_STYLE | styleId = STYLE_CHECKBOX |
||
) |
Creates a new GUI_CheckBox.
text | The text to be displayed next to the checkbox |
_rect | The drawing rectangle the box (and its text) occupies in its parent (i.e. relative to the top-left of the parent) |
parent | The locally unique identifier of the parent this element should becoe a child of. |
_id | A locally unique identifier for this element. Pass -1 (default) to let the GUIentity assign an id itself |
styleId | The identifier of the Style this element should be drawn in |
GUI_DynamicButton * GUIentity::CreateDynamicButton | ( | string | text, |
RECT | _rect, | ||
int | parent, | ||
int | _id = -1 , |
||
GUI_STYLE | styleId = STYLE_BUTTON |
||
) |
Creates a new GUI_DynamicButton.
text | The text that should be displayed on the button |
_rect | the drawing rectangle the page occupies in its parent (i.e. relative to the top-left of the parent) |
parent | The locally unique identifier of the parent this element should becoe a child of. |
_id | A locally unique identifier for this element. Pass -1 (default) to let the GUIentity assign an id itself |
styleId | The identifier of the Style this element should be drawn in |
GUI_Label * GUIentity::CreateLabel | ( | string | text, |
RECT | _rect, | ||
int | parent, | ||
int | _id = -1 , |
||
GUI_STYLE | styleId = STYLE_HEADING |
||
) |
Creates a new GUI_Label element.
text | The text being displayed on the label |
_rect | The drawing rectangle the page occupies in its parent (i.e. relative to the top-left of the parent) |
parent | The locally unique identifier of the parent this element should becoe a child of. |
_id | A locally unique identifier for this element. Pass -1 (default) to let the GUIentity assign an id itself |
styleId | The identifier of the Style this element should be drawn in |
GUI_LabelValuePair * GUIentity::CreateLabelValuePair | ( | string | label, |
string | value, | ||
RECT | _rect, | ||
int | parent, | ||
int | id = -1 , |
||
GUI_STYLE | styleId = STYLE_HEADING , |
||
GUI_FONT | valueFontId = GUI_NO_FONT |
||
) |
Creates a new GUI_LabelValuePair.
label | The text being displayed on the label |
value | The text being displayed as value |
_rect | The drawing rectangle the element occupies in its parent (i.e. relative to the top-left of the parent) |
parent | The locally unique identifier of the parent this element should become a child of. |
id | A locally unique identifier for this element. Pass -1 (default) to let the GUIentity assign an id itself |
styleId | The identifier of the Style this element should be drawn in |
valueFontId | Lets you choose an alternate font to render the value in |
GUI_ListBox * GUIentity::CreateListBox | ( | RECT | _rect, |
int | parent, | ||
int | _id = -1 , |
||
GUI_STYLE | styleId = STYLE_LISTBOX , |
||
GUI_STYLE | scrollbar_styleId = STYLE_LISTBOX , |
||
bool | _multiselect = false , |
||
bool | _noSelect = false |
||
) |
Creates a new GUI_ListBox.
_rect | The drawing rectangle the page occupies in its parent (i.e. relative to the top-left of the parent) |
parent | The locally unique identifier of the parent this element should becoe a child of. |
_id | A locally unique identifier for this element. Pass -1 (default) to let the GUIentity assign an id itself |
styleId | The identifier of the Style this element should be drawn in |
scrollbar_styleId | The style the scrollbar should be drawn in |
_multiselect | Pass true if the listbox should handle multi-select |
_noSelect | Pass true if the listbox is just intended to list things, without the capability to actually select anything |
GUI_Page * GUIentity::CreatePage | ( | RECT | _rect, |
int | parent, | ||
int | _id = -1 , |
||
GUI_STYLE | styleId = STYLE_DEFAULT , |
||
bool | drawbackground = false |
||
) |
Creates a new GUI_Page element.
_rect | The drawing rectangle the page occupies in its parent (i.e. relative to the top-left of the parent) |
parent | The locally unique identifier of the parent this element should become a child of. |
_id | A locally unique identifier for this element. Pass -1 (default) to let the GUIentity assign an id itself |
styleId | The identifier of the Style this element should be drawn in |
drawbackground | If true, the page will draw a background in the passed style. |
GUI_RadioButton * GUIentity::CreateRadioButton | ( | string | text, |
RECT | _rect, | ||
int | parent, | ||
int | _id = -1 , |
||
GUI_STYLE | styleId = STYLE_CHECKBOX |
||
) |
Creates a new GUI_RadioButton.
text | The text to be displayed next to the button |
_rect | The drawing rectangle the button (and its text) occupies in its parent (i.e. relative to the top-left of the parent) |
parent | The locally unique identifier of the parent this element should become a child of. |
_id | A locally unique identifier for this element. Pass -1 (default) to let the GUIentity assign an id itself |
styleId | The identifier of the Style this element should be drawn in |
GUI_StaticButton * GUIentity::CreateStaticButton | ( | RECT | _rect, |
int | srcX, | ||
int | srcY, | ||
SURFHANDLE | _src, | ||
int | parent, | ||
int | _id = -1 |
||
) |
Creates a new GUI_StaticButton.
_rect | The drawing rectangle the page occupies in its parent (i.e. relative to the top-left of the parent) |
srcX | The coordinate of the lefthand edge on the texture the element takes its image from |
srcY | The coordinate of the top edge on the texture the element takes its image from |
_src | Handle to the texture surface the element takes its image from |
parent | The locally unique identifier of the parent this element should becoe a child of. |
_id | A locally unique identifier for this element. Pass -1 (default) to let the GUIentity assign an id itself |
int GUIentity::GetDynamicUID | ( | ) |
|
virtual |
Reimplemented in GUImanager.
GUI_ElementStyle * GUIentity::GetStyle | ( | GUI_STYLE | _styleId = STYLE_DEFAULT | ) |
void GUIentity::RegisterGuiElement | ( | GUI_BaseElement * | _element, |
int | _parentId | ||
) |
Registers a GUI element that has not been created by this GUIentity.
This is commonly used by specific submenu classes or other non-standard GUI elements for which the GUIentity doesn't have a factory.
_element | A pointer to the element to be registered |
_parentId | The UID of the parent the registered element should become a child of |
void GUIentity::SetStyleSet | ( | string | _styleset | ) |
|
pure virtual |
checks if any children had an update NOT triggered by user input.
redraws the panel area if one did. should be called every frame. Exact behavior depends on Implementation
Implemented in GUIplugin, and GUImanager.