arsa
2.7
|
Base class of all GUI elements. More...
#include <IGUIElement.h>
Public Member Functions | |
IGUIElement (EGUI_ELEMENT_TYPE type, IGUIEnvironment *environment, IGUIElement *parent, s32 id, const core::rect< s32 > &rectangle) | |
Constructor. More... | |
virtual | ~IGUIElement () |
Destructor. More... | |
IGUIElement * | getParent () const |
Returns parent of this element. More... | |
core::rect< s32 > | getRelativePosition () const |
Returns the relative rectangle of this element. More... | |
void | setRelativePosition (const core::rect< s32 > &r) |
Sets the relative rectangle of this element. More... | |
void | setRelativePosition (const core::position2di &position) |
Sets the relative rectangle of this element, maintaining its current width and height. More... | |
void | setRelativePositionProportional (const core::rect< f32 > &r) |
Sets the relative rectangle of this element as a proportion of its parent's area. More... | |
core::rect< s32 > | getAbsolutePosition () const |
Gets the absolute rectangle of this element. More... | |
core::rect< s32 > | getAbsoluteClippingRect () const |
Returns the visible area of the element. More... | |
void | setNotClipped (bool noClip) |
Sets whether the element will ignore its parent's clipping rectangle. More... | |
bool | isNotClipped () const |
Gets whether the element will ignore its parent's clipping rectangle. More... | |
void | setMaxSize (core::dimension2du size) |
Sets the maximum size allowed for this element. More... | |
void | setMinSize (core::dimension2du size) |
Sets the minimum size allowed for this element. More... | |
void | setAlignment (EGUI_ALIGNMENT left, EGUI_ALIGNMENT right, EGUI_ALIGNMENT top, EGUI_ALIGNMENT bottom) |
The alignment defines how the borders of this element will be positioned when the parent element is resized. More... | |
virtual void | updateAbsolutePosition () |
Updates the absolute position. More... | |
virtual IGUIElement * | getElementFromPoint (const core::position2d< s32 > &point) |
Returns the topmost GUI element at the specific position. More... | |
virtual bool | isPointInside (const core::position2d< s32 > &point) const |
Returns true if a point is within this element. More... | |
virtual void | addChild (IGUIElement *child) |
Adds a GUI element as new child of this element. More... | |
virtual void | removeChild (IGUIElement *child) |
Removes a child. More... | |
virtual void | remove () |
Removes this element from its parent. More... | |
virtual void | draw () |
Draws the element and its children. More... | |
virtual void | OnPostRender (u32 timeMs) |
animate the element and its children. More... | |
virtual void | move (core::position2d< s32 > absoluteMovement) |
Moves this element. More... | |
virtual bool | isVisible () const |
Returns true if element is visible. More... | |
virtual bool | isTrulyVisible () const |
Check whether the element is truly visible, taking into accounts its parents' visibility. More... | |
virtual void | setVisible (bool visible) |
Sets the visible state of this element. More... | |
virtual bool | isSubElement () const |
Returns true if this element was created as part of its parent control. More... | |
virtual void | setSubElement (bool subElement) |
Sets whether this control was created as part of its parent. More... | |
void | setTabStop (bool enable) |
If set to true, the focus will visit this element when using the tab key to cycle through elements. More... | |
bool | isTabStop () const |
Returns true if this element can be focused by navigating with the tab key. More... | |
void | setTabOrder (s32 index) |
Sets the priority of focus when using the tab key to navigate between a group of elements. More... | |
s32 | getTabOrder () const |
Returns the number in the tab order sequence. More... | |
void | setTabGroup (bool isGroup) |
Sets whether this element is a container for a group of elements which can be navigated using the tab key. More... | |
bool | isTabGroup () const |
Returns true if this element is a tab group. More... | |
IGUIElement * | getTabGroup () |
Returns the container element which holds all elements in this element's tab group. More... | |
virtual bool | isEnabled () const |
Returns true if element is enabled. More... | |
virtual void | setEnabled (bool enabled) |
Sets the enabled state of this element. More... | |
virtual void | setText (const wchar_t *text) |
Sets the new caption of this element. More... | |
virtual const wchar_t * | getText () const |
Returns caption of this element. More... | |
virtual void | setToolTipText (const wchar_t *text) |
Sets the new caption of this element. More... | |
virtual const core::stringw & | getToolTipText () const |
Returns caption of this element. More... | |
virtual s32 | getID () const |
Returns id. Can be used to identify the element. More... | |
virtual void | setID (s32 id) |
Sets the id of this element. More... | |
virtual bool | OnEvent (const SEvent &event) _IRR_OVERRIDE_ |
Called if an event happened. More... | |
virtual bool | bringToFront (IGUIElement *element) |
Brings a child to front. More... | |
virtual bool | sendToBack (IGUIElement *child) |
Moves a child to the back, so it's siblings are drawn on top of it. More... | |
virtual const core::list< IGUIElement * > & | getChildren () const |
Returns list with children of this element. More... | |
virtual IGUIElement * | getElementFromId (s32 id, bool searchchildren=false) const |
Finds the first element with the given id. More... | |
bool | isMyChild (IGUIElement *child) const |
bool | getNextElement (s32 startOrder, bool reverse, bool group, IGUIElement *&first, IGUIElement *&closest, bool includeInvisible=false, bool includeDisabled=false) const |
searches elements to find the closest next element to tab to More... | |
EGUI_ELEMENT_TYPE | getType () const |
Returns the type of the gui element. More... | |
virtual bool | hasType (EGUI_ELEMENT_TYPE type) const |
Returns true if the gui element supports the given type. More... | |
virtual const c8 * | getTypeName () const |
Returns the type name of the gui element. More... | |
virtual const c8 * | getName () const |
Returns the name of the element. More... | |
virtual void | setName (const c8 *name) |
Sets the name of the element. More... | |
virtual void | setName (const core::stringc &name) |
Sets the name of the element. More... | |
virtual void | serializeAttributes (io::IAttributes *out, io::SAttributeReadWriteOptions *options=0) const _IRR_OVERRIDE_ |
Writes attributes of the scene node. More... | |
virtual void | deserializeAttributes (io::IAttributes *in, io::SAttributeReadWriteOptions *options=0) _IRR_OVERRIDE_ |
Reads attributes of the scene node. More... | |
Public Member Functions inherited from irr::IReferenceCounted | |
IReferenceCounted () | |
Constructor. More... | |
virtual | ~IReferenceCounted () |
Destructor. More... | |
void | grab () const |
Grabs the object. Increments the reference counter by one. More... | |
bool | drop () const |
Drops the object. Decrements the reference counter by one. More... | |
s32 | getReferenceCount () const |
Get the reference count. More... | |
const c8 * | getDebugName () const |
Returns the debug name of the object. More... | |
Public Member Functions inherited from irr::IEventReceiver | |
virtual | ~IEventReceiver () |
Destructor. More... | |
Protected Member Functions | |
void | addChildToEnd (IGUIElement *child) |
void | recalculateAbsolutePosition (bool recursive) |
Protected Member Functions inherited from irr::IReferenceCounted | |
void | setDebugName (const c8 *newName) |
Sets the debug name of the object. More... | |
Protected Attributes | |
core::list< IGUIElement * > | Children |
List of all children of this element. More... | |
IGUIElement * | Parent |
Pointer to the parent. More... | |
core::rect< s32 > | RelativeRect |
relative rect of element More... | |
core::rect< s32 > | AbsoluteRect |
absolute rect of element More... | |
core::rect< s32 > | AbsoluteClippingRect |
absolute clipping rect of element More... | |
core::rect< s32 > | DesiredRect |
core::rect< s32 > | LastParentRect |
for calculating the difference when resizing parent More... | |
core::rect< f32 > | ScaleRect |
relative scale of the element inside its parent More... | |
core::dimension2du | MaxSize |
maximum and minimum size of the element More... | |
core::dimension2du | MinSize |
bool | IsVisible |
is visible? More... | |
bool | IsEnabled |
is enabled? More... | |
bool | IsSubElement |
is a part of a larger whole and should not be serialized? More... | |
bool | NoClip |
does this element ignore its parent's clipping rectangle? More... | |
core::stringw | Text |
caption More... | |
core::stringw | ToolTipText |
tooltip More... | |
core::stringc | Name |
users can set this for identifying the element by string More... | |
s32 | ID |
users can set this for identifying the element by integer More... | |
bool | IsTabStop |
tab stop like in windows More... | |
s32 | TabOrder |
tab order More... | |
bool | IsTabGroup |
tab groups are containers like windows, use ctrl+tab to navigate More... | |
EGUI_ALIGNMENT | AlignLeft |
tells the element how to act when its parent is resized More... | |
EGUI_ALIGNMENT | AlignRight |
EGUI_ALIGNMENT | AlignTop |
EGUI_ALIGNMENT | AlignBottom |
IGUIEnvironment * | Environment |
GUI Environment. More... | |
EGUI_ELEMENT_TYPE | Type |
type of element More... | |
Base class of all GUI elements.
Definition at line 23 of file IGUIElement.h.
|
inline |
Constructor.
Definition at line 28 of file IGUIElement.h.
|
inlinevirtual |
Destructor.
Definition at line 51 of file IGUIElement.h.
|
inlinevirtual |
Adds a GUI element as new child of this element.
Definition at line 276 of file IGUIElement.h.
|
inlineprotected |
Definition at line 827 of file IGUIElement.h.
|
inlinevirtual |
Brings a child to front.
Definition at line 535 of file IGUIElement.h.
|
inlinevirtual |
Reads attributes of the scene node.
Implement this to set the attributes of your scene node for scripting languages, editors, debuggers or xml deserialization purposes.
Reimplemented from irr::io::IAttributeExchangingObject.
Definition at line 797 of file IGUIElement.h.
|
inlinevirtual |
Draws the element and its children.
Definition at line 309 of file IGUIElement.h.
|
inline |
Returns the visible area of the element.
Definition at line 143 of file IGUIElement.h.
|
inline |
Gets the absolute rectangle of this element.
Definition at line 136 of file IGUIElement.h.
|
inlinevirtual |
Returns list with children of this element.
Definition at line 573 of file IGUIElement.h.
|
inlinevirtual |
Finds the first element with the given id.
id | Id to search for. |
searchchildren | Set this to true, if also children of this element may contain the element with the searched id and they should be searched too. |
Definition at line 586 of file IGUIElement.h.
|
inlinevirtual |
Returns the topmost GUI element at the specific position.
This will check this GUI element and all of its descendants, so it may return this GUI element. To check all GUI elements, call this function on device->getGUIEnvironment()->getRootGUIElement(). Note that the root element is the size of the screen, so doing so (with an on-screen point) will always return the root element if no other element is above it at that point.
point | The point at which to find a GUI element. |
Definition at line 239 of file IGUIElement.h.
|
inlinevirtual |
Returns id. Can be used to identify the element.
Definition at line 513 of file IGUIElement.h.
Returns the name of the element.
Definition at line 747 of file IGUIElement.h.
|
inline |
searches elements to find the closest next element to tab to
startOrder | The TabOrder of the current element, -1 if none |
reverse | true if searching for a lower number |
group | true if searching for a higher one |
first | element with the highest/lowest known tab order depending on search direction |
closest | the closest match, depending on tab order and direction |
includeInvisible | includes invisible elements in the search (default=false) |
includeDisabled | includes disabled elements in the search (default=false) |
Definition at line 634 of file IGUIElement.h.
|
inline |
Returns parent of this element.
Definition at line 64 of file IGUIElement.h.
|
inline |
Returns the relative rectangle of this element.
Definition at line 70 of file IGUIElement.h.
|
inline |
Returns the container element which holds all elements in this element's tab group.
Definition at line 452 of file IGUIElement.h.
|
inline |
|
inlinevirtual |
|
inlinevirtual |
|
inline |
Returns the type of the gui element.
This is needed for the .NET wrapper but will be used later for serializing and deserializing. If you wrote your own GUIElements, you need to set the type for your element as first parameter in the constructor of IGUIElement. For own (=unknown) elements, simply use EGUIET_ELEMENT as type
Definition at line 717 of file IGUIElement.h.
Returns the type name of the gui element.
This is needed serializing elements. For serializing your own elements, override this function and return your own type name which is created by your IGUIElementFactory
Definition at line 740 of file IGUIElement.h.
|
inlinevirtual |
Returns true if the gui element supports the given type.
This is mostly used to check if you can cast a gui element to the class that goes with the type. Most gui elements will only support their own type, but if you derive your own classes from interfaces you can overload this function and add a check for the type of the base-class additionally. This allows for checks comparable to the dynamic_cast of c++ with enabled rtti. Note that you can't do that by calling BaseClass::hasType(type), but you have to do an explicit comparison check, because otherwise the base class usually just checks for the member variable Type which contains the type of your derived class.
Definition at line 731 of file IGUIElement.h.
|
inlinevirtual |
Returns true if element is enabled.
Currently elements do not care about parent-states. So if you want to affect children you have to enable/disable them all. The only exception to this are sub-elements which also check their parent.
Definition at line 468 of file IGUIElement.h.
|
inline |
returns true if the given element is a child of this one.
child | The child element to check |
Definition at line 609 of file IGUIElement.h.
|
inline |
Gets whether the element will ignore its parent's clipping rectangle.
Definition at line 160 of file IGUIElement.h.
|
inlinevirtual |
Returns true if a point is within this element.
Elements with a shape other than a rectangle should override this method
Definition at line 269 of file IGUIElement.h.
|
inlinevirtual |
Returns true if this element was created as part of its parent control.
Definition at line 367 of file IGUIElement.h.
|
inline |
Returns true if this element is a tab group.
Definition at line 445 of file IGUIElement.h.
|
inline |
Returns true if this element can be focused by navigating with the tab key.
Definition at line 392 of file IGUIElement.h.
|
inlinevirtual |
Check whether the element is truly visible, taking into accounts its parents' visibility.
Definition at line 348 of file IGUIElement.h.
|
inlinevirtual |
|
inlinevirtual |
Moves this element.
Definition at line 333 of file IGUIElement.h.
Called if an event happened.
Implements irr::IEventReceiver.
Definition at line 527 of file IGUIElement.h.
animate the element and its children.
Definition at line 321 of file IGUIElement.h.
|
inlineprotected |
Definition at line 840 of file IGUIElement.h.
|
inlinevirtual |
Removes this element from its parent.
Definition at line 301 of file IGUIElement.h.
|
inlinevirtual |
Removes a child.
Definition at line 286 of file IGUIElement.h.
|
inlinevirtual |
Moves a child to the back, so it's siblings are drawn on top of it.
Definition at line 554 of file IGUIElement.h.
|
inlinevirtual |
Writes attributes of the scene node.
Implement this to expose the attributes of your scene node for scripting languages, editors, debuggers or xml serialization purposes.
Reimplemented from irr::io::IAttributeExchangingObject.
Definition at line 772 of file IGUIElement.h.
|
inline |
The alignment defines how the borders of this element will be positioned when the parent element is resized.
Definition at line 188 of file IGUIElement.h.
|
inlinevirtual |
Sets the id of this element.
Definition at line 520 of file IGUIElement.h.
|
inline |
Sets the maximum size allowed for this element.
If set to 0,0, there is no maximum size
Definition at line 168 of file IGUIElement.h.
|
inline |
Sets the minimum size allowed for this element.
Definition at line 176 of file IGUIElement.h.
Sets the name of the element.
name | New name of the gui element. |
Definition at line 755 of file IGUIElement.h.
|
inlinevirtual |
Sets the name of the element.
name | New name of the gui element. |
Definition at line 763 of file IGUIElement.h.
|
inline |
Sets whether the element will ignore its parent's clipping rectangle.
noClip | If true, the element will not be clipped by its parent's clipping rectangle. |
Definition at line 151 of file IGUIElement.h.
|
inline |
Sets the relative rectangle of this element.
r | The absolute position to set |
Definition at line 78 of file IGUIElement.h.
|
inline |
Sets the relative rectangle of this element, maintaining its current width and height.
position | The new relative position to set. Width and height will not be changed. |
Definition at line 102 of file IGUIElement.h.
|
inline |
Sets the relative rectangle of this element as a proportion of its parent's area.
r | The rectangle to set, interpreted as a proportion of the parent's area. Meaningful values are in the range [0...1], unless you intend this element to spill outside its parent. |
Definition at line 116 of file IGUIElement.h.
|
inlinevirtual |
Sets whether this control was created as part of its parent.
For example, it is true when a scrollbar is part of a listbox. SubElements are not saved to disk when calling guiEnvironment->saveGUI()
Definition at line 376 of file IGUIElement.h.
|
inline |
Sets whether this element is a container for a group of elements which can be navigated using the tab key.
For example, windows are tab groups. Groups can be navigated using ctrl+tab, providing isTabStop is true.
Definition at line 438 of file IGUIElement.h.
Sets the priority of focus when using the tab key to navigate between a group of elements.
See setTabGroup, isTabGroup and getTabGroup for information on tab groups. Elements with a lower number are focused first
Definition at line 401 of file IGUIElement.h.
|
inline |
If set to true, the focus will visit this element when using the tab key to cycle through elements.
If this element is a tab group (see isTabGroup/setTabGroup) then ctrl+tab will be used instead.
Definition at line 385 of file IGUIElement.h.
|
inlinevirtual |
|
inlinevirtual |
Updates the absolute position.
Definition at line 214 of file IGUIElement.h.
|
protected |
absolute clipping rect of element
Definition at line 983 of file IGUIElement.h.
|
protected |
absolute rect of element
Definition at line 980 of file IGUIElement.h.
|
protected |
Definition at line 1032 of file IGUIElement.h.
|
protected |
tells the element how to act when its parent is resized
Definition at line 1032 of file IGUIElement.h.
|
protected |
Definition at line 1032 of file IGUIElement.h.
|
protected |
Definition at line 1032 of file IGUIElement.h.
|
protected |
List of all children of this element.
Definition at line 971 of file IGUIElement.h.
|
protected |
the rectangle the element would prefer to be, if it was not constrained by parent or max/min size
Definition at line 987 of file IGUIElement.h.
|
protected |
GUI Environment.
Definition at line 1035 of file IGUIElement.h.
|
protected |
users can set this for identifying the element by integer
Definition at line 1020 of file IGUIElement.h.
|
protected |
is enabled?
Definition at line 1002 of file IGUIElement.h.
|
protected |
is a part of a larger whole and should not be serialized?
Definition at line 1005 of file IGUIElement.h.
|
protected |
tab groups are containers like windows, use ctrl+tab to navigate
Definition at line 1029 of file IGUIElement.h.
|
protected |
tab stop like in windows
Definition at line 1023 of file IGUIElement.h.
|
protected |
is visible?
Definition at line 999 of file IGUIElement.h.
|
protected |
for calculating the difference when resizing parent
Definition at line 990 of file IGUIElement.h.
|
protected |
maximum and minimum size of the element
Definition at line 996 of file IGUIElement.h.
|
protected |
Definition at line 996 of file IGUIElement.h.
|
protected |
users can set this for identifying the element by string
Definition at line 1017 of file IGUIElement.h.
|
protected |
does this element ignore its parent's clipping rectangle?
Definition at line 1008 of file IGUIElement.h.
|
protected |
Pointer to the parent.
Definition at line 974 of file IGUIElement.h.
|
protected |
relative rect of element
Definition at line 977 of file IGUIElement.h.
|
protected |
relative scale of the element inside its parent
Definition at line 993 of file IGUIElement.h.
|
protected |
tab order
Definition at line 1026 of file IGUIElement.h.
|
protected |
caption
Definition at line 1011 of file IGUIElement.h.
|
protected |
tooltip
Definition at line 1014 of file IGUIElement.h.
|
protected |
type of element
Definition at line 1038 of file IGUIElement.h.