Loading...
Searching...
No Matches
irr::gui::IGUIElement Class Reference

Base class of all GUI elements. More...

`#include <IGUIElement.h>`

Inheritance diagram for irr::gui::IGUIElement:

## Public Member Functions

| IGUIElement (EGUI_ELEMENT_TYPE type, IGUIEnvironment *environment, IGUIElement *parent, s32 id, const core::rect< s32 > &rectangle)
| Constructor.
virtual | ~IGUIElement ()
| Destructor.
virtual void | addChild (IGUIElement *child)
| Adds a GUI element as new child of this element.
virtual bool | bringToFront (IGUIElement *element)
| Brings a child to front.
virtual void | deserializeAttributes (io::IAttributes *in, io::SAttributeReadWriteOptions *options=0)
| Reads attributes of the scene node.
virtual void | draw ()
| Draws the element and its children.
core::rect< s32 > | getAbsoluteClippingRect () const
| Returns the visible area of the element.
core::rect< s32 > | getAbsolutePosition () const
| Gets the absolute rectangle of this element.
virtual const core::list< IGUIElement * > & | getChildren () const
| Returns list with children of this element.
virtual IGUIElement * | getElementFromId (s32 id, bool searchchildren=false) const
| Finds the first element with the given id.
IGUIElement * | getElementFromPoint (const core::position2d< s32 > &point)
| Returns the topmost GUI element at the specific position.
virtual s32 | getID () const
| Returns id. Can be used to identify the element.
virtual const c8 * | getName () const
| Returns the name of the element.
bool | getNextElement (s32 startOrder, bool reverse, bool group, IGUIElement *&first, IGUIElement *&closest, bool includeInvisible=false) const
| searches elements to find the closest next element to tab to
IGUIElement * | getParent () const
| Returns parent of this element.
core::rect< s32 > | getRelativePosition () const
| Returns the relative rectangle of this element.
IGUIElement * | getTabGroup ()
| Returns the container element which holds all elements in this element's tab group.
s32 | getTabOrder () const
| Returns the number in the tab order sequence.
virtual const wchar_t * | getText () const
| Returns caption of this element.
virtual const core::stringw & | getToolTipText () const
| Returns caption of this element.
EGUI_ELEMENT_TYPE | getType () const
| Returns the type of the gui element.
virtual const c8 * | getTypeName () const
| Returns the type name of the gui element.
virtual bool | hasType (EGUI_ELEMENT_TYPE type) const
| Returns true if the gui element supports the given type.
virtual bool | isEnabled () const
| Returns true if element is enabled.
bool | isMyChild (IGUIElement *child) const
bool | isNotClipped () const
| Gets whether the element will ignore its parent's clipping rectangle.
virtual bool | isPointInside (const core::position2d< s32 > &point) const
| Returns true if a point is within this element.
virtual bool | isSubElement () const
| Returns true if this element was created as part of its parent control.
bool | isTabGroup () const
| Returns true if this element is a tab group.
bool | isTabStop () const
| Returns true if this element can be focused by navigating with the tab key.
virtual bool | isVisible () const
| Returns true if element is visible.
virtual void | move (core::position2d< s32 > absoluteMovement)
| Moves this element.
virtual bool | OnEvent (const SEvent &event)
| Called if an event happened.
virtual void | OnPostRender (u32 timeMs)
| animate the element and its children.
virtual void | remove ()
| Removes this element from its parent.
virtual void | removeChild (IGUIElement *child)
| Removes a child.
virtual bool | sendToBack (IGUIElement *child)
| Moves a child to the back, so it's siblings are drawn on top of it.
virtual void | serializeAttributes (io::IAttributes *out, io::SAttributeReadWriteOptions *options=0) const
| Writes attributes of the scene node.
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.
virtual void | setEnabled (bool enabled)
| Sets the enabled state of this element.
virtual void | setID (s32 id)
| Sets the id of this element.
void | setMaxSize (core::dimension2du size)
| Sets the maximum size allowed for this element.
void | setMinSize (core::dimension2du size)
| Sets the minimum size allowed for this element.
virtual void | setName (const c8 *name)
| Sets the name of the element.
virtual void | setName (const core::stringc &name)
| Sets the name of the element.
void | setNotClipped (bool noClip)
| Sets whether the element will ignore its parent's clipping rectangle.
void | setRelativePosition (const core::position2di &position)
| Sets the relative rectangle of this element, maintaining its current width and height.
void | setRelativePosition (const core::rect< s32 > &r)
| Sets the relative rectangle of this element.
void | setRelativePositionProportional (const core::rect< f32 > &r)
| Sets the relative rectangle of this element as a proportion of its parent's area.
virtual void | setSubElement (bool subElement)
| Sets whether this control was created as part of its parent.
void | setTabGroup (bool isGroup)
| Sets whether this element is a container for a group of elements which can be navigated using the tab key.
void | setTabOrder (s32 index)
| Sets the priority of focus when using the tab key to navigate between a group of elements.
void | setTabStop (bool enable)
| If set to true, the focus will visit this element when using the tab key to cycle through elements.
virtual void | setText (const wchar_t *text)
| Sets the new caption of this element.
virtual void | setToolTipText (const wchar_t *text)
| Sets the new caption of this element.
virtual void | setVisible (bool visible)
| Sets the visible state of this element.
virtual void | updateAbsolutePosition ()
| Updates the absolute position.
Public Member Functions inherited from irr::IReferenceCounted
| IReferenceCounted ()
| Constructor.
virtual | ~IReferenceCounted ()
| Destructor.
bool | drop () const
| Drops the object. Decrements the reference counter by one.
const c8 * | getDebugName () const
| Returns the debug name of the object.
s32 | getReferenceCount () const
| Get the reference count.
void | grab () const
| Grabs the object. Increments the reference counter by one.
Public Member Functions inherited from irr::IEventReceiver
virtual | ~IEventReceiver ()
| Destructor.

## 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.

## Protected Attributes

core::rect< s32 > | AbsoluteClippingRect
| absolute clipping rect of element
core::rect< s32 > | AbsoluteRect
| absolute rect of element
EGUI_ALIGNMENT | AlignBottom
EGUI_ALIGNMENT | AlignLeft
| tells the element how to act when its parent is resized
EGUI_ALIGNMENT | AlignRight
EGUI_ALIGNMENT | AlignTop
core::list< IGUIElement * > | Children
| List of all children of this element.
core::rect< s32 > | DesiredRect
IGUIEnvironment * | Environment
| GUI Environment.
s32 | ID
| users can set this for identificating the element by integer
bool | IsEnabled
| is enabled?
bool | IsSubElement
| is a part of a larger whole and should not be serialized?
bool | IsTabGroup
| tab groups are containers like windows, use ctrl+tab to navigate
bool | IsTabStop
| tab stop like in windows
bool | IsVisible
| is visible?
core::rect< s32 > | LastParentRect
| for calculating the difference when resizing parent
core::dimension2du | MaxSize
| maximum and minimum size of the element
core::dimension2du | MinSize
core::stringc | Name
| users can set this for identificating the element by string
bool | NoClip
| does this element ignore its parent's clipping rectangle?
IGUIElement * | Parent
| Pointer to the parent.
core::rect< s32 > | RelativeRect
| relative rect of element
core::rect< f32 > | ScaleRect
| relative scale of the element inside its parent
s32 | TabOrder
| tab order
core::stringw | Text
| caption
core::stringw | ToolTipText
| tooltip
EGUI_ELEMENT_TYPE | Type
| type of element

## Detailed Description

Base class of all GUI elements.

Definition at line 25 of file IGUIElement.h.

## Constructor & Destructor Documentation

## IGUIElement()

irr::gui::IGUIElement::IGUIElement | ( | EGUI_ELEMENT_TYPE | type,
|  | IGUIEnvironment * | environment,
|  | IGUIElement * | parent,
|  | s32 | id,
|  | const core::rect< s32 > & | rectangle )

inline

Constructor.

Definition at line 30 of file IGUIElement.h.

References IGUIElement(), AbsoluteClippingRect, AbsoluteRect, addChildToEnd(), AlignBottom, AlignLeft, AlignRight, AlignTop, DesiredRect, irr::gui::EGUIA_UPPERLEFT, Environment, ID, IsEnabled, IsSubElement, IsTabGroup, IsTabStop, IsVisible, MaxSize, MinSize, NoClip, Parent, recalculateAbsolutePosition(), RelativeRect, irr::IReferenceCounted::setDebugName(), TabOrder, and Type.

Referenced by irr::gui::IGUIButton::IGUIButton(), irr::gui::IGUICheckBox::IGUICheckBox(), irr::gui::IGUIColorSelectDialog::IGUIColorSelectDialog(), irr::gui::IGUIComboBox::IGUIComboBox(), irr::gui::IGUIContextMenu::IGUIContextMenu(), irr::gui::IGUIEditBox::IGUIEditBox(), IGUIElement(), irr::gui::IGUIFileOpenDialog::IGUIFileOpenDialog(), irr::gui::IGUIImage::IGUIImage(), irr::gui::IGUIInOutFader::IGUIInOutFader(), irr::gui::IGUIListBox::IGUIListBox(), irr::gui::IGUIMeshViewer::IGUIMeshViewer(), irr::gui::IGUIScrollBar::IGUIScrollBar(), irr::gui::IGUISpinBox::IGUISpinBox(), irr::gui::IGUIStaticText::IGUIStaticText(), irr::gui::IGUITab::IGUITab(), irr::gui::IGUITabControl::IGUITabControl(), irr::gui::IGUITable::IGUITable(), irr::gui::IGUIToolBar::IGUIToolBar(), irr::gui::IGUITreeView::IGUITreeView(), irr::gui::IGUIWindow::IGUIWindow(), addChild(), addChildToEnd(), bringToFront(), getElementFromId(), getElementFromPoint(), getNextElement(), getParent(), getTabGroup(), isMyChild(), recalculateAbsolutePosition(), removeChild(), sendToBack(), irr::gui::IGUIContextMenu::setEventParent(), and setTabOrder().

## ~IGUIElement()

virtual irr::gui::IGUIElement::~IGUIElement | ( |  | ) |

inline virtual

Destructor.

Definition at line 53 of file IGUIElement.h.

References Children.

## Member Function Documentation

## addChild()

virtual void irr::gui::IGUIElement::addChild | ( | IGUIElement * | child | ) |

inline virtual

Adds a GUI element as new child of this element.

Definition at line 279 of file IGUIElement.h.

References IGUIElement(), addChildToEnd(), and updateAbsolutePosition().

## addChildToEnd()

void irr::gui::IGUIElement::addChildToEnd | ( | IGUIElement * | child | ) |

inline protected

Definition at line 818 of file IGUIElement.h.

References IGUIElement(), Children, getAbsolutePosition(), irr::IReferenceCounted::grab(), LastParentRect, Parent, and remove().

Referenced by IGUIElement(), and addChild().

## bringToFront()

virtual bool irr::gui::IGUIElement::bringToFront | ( | IGUIElement * | element | ) |

inline virtual

Brings a child to front.

Returns
  True if successful, false if not.

Definition at line 530 of file IGUIElement.h.

References IGUIElement(), _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX, and Children.

## deserializeAttributes()

virtual void irr::gui::IGUIElement::deserializeAttributes | ( | io::IAttributes * | in,
|  | io::SAttributeReadWriteOptions * | options = 0 )

inline virtual

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 789 of file IGUIElement.h.

References irr::core::string< T, TAlloc >::c_str(), irr::io::IAttributes::getAttributeAsBool(), irr::io::IAttributes::getAttributeAsEnumeration(), irr::io::IAttributes::getAttributeAsInt(), irr::io::IAttributes::getAttributeAsPosition2d(), irr::io::IAttributes::getAttributeAsRect(), irr::io::IAttributes::getAttributeAsString(), irr::io::IAttributes::getAttributeAsStringW(), irr::gui::GUIAlignmentNames, IsTabGroup, IsTabStop, setAlignment(), setEnabled(), setID(), setMaxSize(), setMinSize(), setName(), setNotClipped(), setRelativePosition(), setText(), setVisible(), TabOrder, irr::core::vector2d< T >::X, and irr::core::vector2d< T >::Y.

## draw()

virtual void irr::gui::IGUIElement::draw | ( |  | ) |

inline virtual

Draws the element and its children.

Definition at line 312 of file IGUIElement.h.

References Children, and isVisible().

Referenced by irr::gui::IGUIEditBox::setDrawBackground(), irr::gui::IGUIListBox::setDrawBackground(), irr::gui::IGUIStaticText::setDrawBackground(), irr::gui::IGUITab::setDrawBackground(), irr::gui::IGUIWindow::setDrawBackground(), irr::gui::IGUIStaticText::setDrawBorder(), and irr::gui::IGUIWindow::setDrawTitlebar().

## getAbsoluteClippingRect()

core::rect< s32 > irr::gui::IGUIElement::getAbsoluteClippingRect | ( |  | ) | const

inline

Returns the visible area of the element.

Definition at line 146 of file IGUIElement.h.

References AbsoluteClippingRect.

## getAbsolutePosition()

core::rect< s32 > irr::gui::IGUIElement::getAbsolutePosition | ( |  | ) | const

inline

Gets the absolute rectangle of this element.

Definition at line 139 of file IGUIElement.h.

References AbsoluteRect.

Referenced by addChildToEnd().

## getChildren()

virtual const core::list< IGUIElement * > & irr::gui::IGUIElement::getChildren | ( |  | ) | const

inline virtual

Returns list with children of this element.

Definition at line 570 of file IGUIElement.h.

References Children.

## getElementFromId()

virtual IGUIElement * irr::gui::IGUIElement::getElementFromId | ( | s32 | id,
|  | bool | searchchildren = false ) const

inline virtual

Finds the first element with the given id.

Parameters

  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.

Returns
  Returns the first element with the given id. If no element with this id was found, 0 is returned.

Definition at line 583 of file IGUIElement.h.

References IGUIElement(), Children, and getElementFromId().

Referenced by getElementFromId().

## getElementFromPoint()

IGUIElement * irr::gui::IGUIElement::getElementFromPoint | ( | const core::position2d< s32 > & | point | ) |

inline

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.

Parameters

  point | The point at which to find a GUI element.

Returns
  The topmost GUI element at that point, or 0 if there are no candidate elements at this point.

Definition at line 242 of file IGUIElement.h.

References IGUIElement(), Children, getElementFromPoint(), isPointInside(), and isVisible().

Referenced by getElementFromPoint().

## getID()

virtual s32 irr::gui::IGUIElement::getID | ( |  | ) | const

inline virtual

Returns id. Can be used to identify the element.

Definition at line 508 of file IGUIElement.h.

References ID.

## getName()

virtual const c8 * irr::gui::IGUIElement::getName | ( |  | ) | const

inline virtual

Returns the name of the element.

Returns
  Name as character string.

Definition at line 740 of file IGUIElement.h.

References Name.

## getNextElement()

bool irr::gui::IGUIElement::getNextElement | ( | s32 | startOrder,
|  | bool | reverse,
|  | bool | group,
|  | IGUIElement *& | first,
|  | IGUIElement *& | closest,
|  | bool | includeInvisible = false ) const

inline

searches elements to find the closest next element to tab to

Parameters

  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)

Returns
  true if successfully found an element, false to continue searching/fail

Definition at line 630 of file IGUIElement.h.

References IGUIElement(), _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX, Children, and getTabOrder().

Referenced by setTabOrder().

## getParent()

IGUIElement * irr::gui::IGUIElement::getParent | ( |  | ) | const

inline

Returns parent of this element.

Definition at line 66 of file IGUIElement.h.

References IGUIElement(), and Parent.

Referenced by getTabGroup(), and isEnabled().

## getRelativePosition()

core::rect< s32 > irr::gui::IGUIElement::getRelativePosition | ( |  | ) | const

inline

Returns the relative rectangle of this element.

Definition at line 73 of file IGUIElement.h.

References RelativeRect.

## getTabGroup()

IGUIElement * irr::gui::IGUIElement::getTabGroup | ( |  | ) |

inline

Returns the container element which holds all elements in this element's tab group.

Definition at line 446 of file IGUIElement.h.

References IGUIElement(), getParent(), and isTabGroup().

Referenced by setTabOrder().

## getTabOrder()

s32 irr::gui::IGUIElement::getTabOrder | ( |  | ) | const

inline

Returns the number in the tab order sequence.

Definition at line 422 of file IGUIElement.h.

References TabOrder.

Referenced by getNextElement(), and setTabOrder().

## getText()

virtual const wchar_t * irr::gui::IGUIElement::getText | ( |  | ) | const

inline virtual

Returns caption of this element.

Definition at line 487 of file IGUIElement.h.

References Text.

Referenced by serializeAttributes().

## getToolTipText()

virtual const core::stringw & irr::gui::IGUIElement::getToolTipText | ( |  | ) | const

inline virtual

Returns caption of this element.

Definition at line 501 of file IGUIElement.h.

References ToolTipText.

## getType()

EGUI_ELEMENT_TYPE irr::gui::IGUIElement::getType | ( |  | ) | const

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 710 of file IGUIElement.h.

References Type.

## getTypeName()

virtual const c8 * irr::gui::IGUIElement::getTypeName | ( |  | ) | const

inline virtual

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 733 of file IGUIElement.h.

References irr::gui::GUIElementTypeNames, and Type.

## hasType()

virtual bool irr::gui::IGUIElement::hasType | ( | EGUI_ELEMENT_TYPE | type | ) | const

inline virtual

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 membervariable Type which contains the type of your derived class.

Definition at line 724 of file IGUIElement.h.

References Type.

## isEnabled()

virtual bool irr::gui::IGUIElement::isEnabled | ( |  | ) | const

inline virtual

Returns true if element is enabled.

Currently elements do not care about parent-states. So if you want to affect childs you have to enable/disable them all. The only exception to this are sub-elements which also check their parent.

Definition at line 462 of file IGUIElement.h.

References _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX, getParent(), IsEnabled, isEnabled(), and isSubElement().

Referenced by isEnabled().

## isMyChild()

bool irr::gui::IGUIElement::isMyChild | ( | IGUIElement * | child | ) | const

inline

returns true if the given element is a child of this one.

Parameters

  child | The child element to check

Definition at line 606 of file IGUIElement.h.

References IGUIElement(), _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX, and Parent.

## isNotClipped()

bool irr::gui::IGUIElement::isNotClipped | ( |  | ) | const

inline

Gets whether the element will ignore its parent's clipping rectangle.

Returns
  true if the element is not clipped by its parent's clipping rectangle.

Definition at line 163 of file IGUIElement.h.

References NoClip.

## isPointInside()

virtual bool irr::gui::IGUIElement::isPointInside | ( | const core::position2d< s32 > & | point | ) | const

inline virtual

Returns true if a point is within this element.

Elements with a shape other than a rectangle should override this method

Definition at line 272 of file IGUIElement.h.

References AbsoluteClippingRect.

Referenced by getElementFromPoint().

## isSubElement()

virtual bool irr::gui::IGUIElement::isSubElement | ( |  | ) | const

inline virtual

Returns true if this element was created as part of its parent control.

Definition at line 358 of file IGUIElement.h.

References _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX, and IsSubElement.

Referenced by isEnabled().

## isTabGroup()

bool irr::gui::IGUIElement::isTabGroup | ( |  | ) | const

inline

Returns true if this element is a tab group.

Definition at line 438 of file IGUIElement.h.

References _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX, and IsTabGroup.

Referenced by getTabGroup().

## isTabStop()

bool irr::gui::IGUIElement::isTabStop | ( |  | ) | const

inline

Returns true if this element can be focused by navigating with the tab key.

Definition at line 384 of file IGUIElement.h.

References _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX, and IsTabStop.

## isVisible()

virtual bool irr::gui::IGUIElement::isVisible | ( |  | ) | const

inline virtual

Returns true if element is visible.

Definition at line 343 of file IGUIElement.h.

References _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX, and IsVisible.

Referenced by draw(), getElementFromPoint(), and OnPostRender().

## move()

virtual void irr::gui::IGUIElement::move | ( | core::position2d< s32 > | absoluteMovement | ) |

inline virtual

Moves this element.

Definition at line 336 of file IGUIElement.h.

References DesiredRect, and setRelativePosition().

## OnEvent()

virtual bool irr::gui::IGUIElement::OnEvent | ( | const SEvent & | event | ) |

inline virtual

Called if an event happened.

Implements irr::IEventReceiver.

Definition at line 522 of file IGUIElement.h.

References Parent.

## OnPostRender()

virtual void irr::gui::IGUIElement::OnPostRender | ( | u32 | timeMs | ) |

inline virtual

animate the element and its children.

Definition at line 324 of file IGUIElement.h.

References Children, and isVisible().

## recalculateAbsolutePosition()

void irr::gui::IGUIElement::recalculateAbsolutePosition | ( | bool | recursive | ) |

inline protected

Definition at line 831 of file IGUIElement.h.

References IGUIElement(), AbsoluteClippingRect, AbsoluteRect, AlignBottom, AlignLeft, AlignRight, AlignTop, Children, DesiredRect, irr::gui::EGUIA_CENTER, irr::gui::EGUIA_LOWERRIGHT, irr::gui::EGUIA_SCALE, irr::gui::EGUIA_UPPERLEFT, irr::core::rect< T >::getHeight(), irr::core::rect< T >::getWidth(), LastParentRect, MaxSize, MinSize, NoClip, Parent, RelativeRect, irr::core::round32(), ScaleRect, and irr::core::rect< T >::UpperLeftCorner.

Referenced by IGUIElement(), and updateAbsolutePosition().

## remove()

virtual void irr::gui::IGUIElement::remove | ( |  | ) |

inline virtual

Removes this element from its parent.

Definition at line 304 of file IGUIElement.h.

References Parent.

Referenced by addChildToEnd().

## removeChild()

virtual void irr::gui::IGUIElement::removeChild | ( | IGUIElement * | child | ) |

inline virtual

Removes a child.

Definition at line 289 of file IGUIElement.h.

References IGUIElement(), and Children.

## sendToBack()

virtual bool irr::gui::IGUIElement::sendToBack | ( | IGUIElement * | child | ) |

inline virtual

Moves a child to the back, so it's siblings are drawn on top of it.

Returns
  True if successful, false if not.

Definition at line 550 of file IGUIElement.h.

References IGUIElement(), _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX, and Children.

## serializeAttributes()

virtual void irr::gui::IGUIElement::serializeAttributes | ( | io::IAttributes * | out,
|  | io::SAttributeReadWriteOptions * | options = 0 ) const

inline virtual

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 765 of file IGUIElement.h.

References irr::io::IAttributes::addBool(), irr::io::IAttributes::addEnum(), irr::io::IAttributes::addInt(), irr::io::IAttributes::addPosition2d(), irr::io::IAttributes::addRect(), irr::io::IAttributes::addString(), AlignBottom, AlignLeft, AlignRight, AlignTop, DesiredRect, getText(), irr::gui::GUIAlignmentNames, ID, IsEnabled, IsTabGroup, IsTabStop, IsVisible, MaxSize, MinSize, Name, NoClip, and TabOrder.

## setAlignment()

void irr::gui::IGUIElement::setAlignment | ( | EGUI_ALIGNMENT | left,
|  | EGUI_ALIGNMENT | right,
|  | EGUI_ALIGNMENT | top,
|  | EGUI_ALIGNMENT | bottom )

inline

The alignment defines how the borders of this element will be positioned when the parent element is resized.

Definition at line 191 of file IGUIElement.h.

References AlignBottom, AlignLeft, AlignRight, AlignTop, DesiredRect, irr::gui::EGUIA_SCALE, irr::core::rect< T >::getSize(), irr::core::dimension2d< T >::Height, Parent, ScaleRect, and irr::core::dimension2d< T >::Width.

Referenced by deserializeAttributes().

## setEnabled()

virtual void irr::gui::IGUIElement::setEnabled | ( | bool | enabled | ) |

inline virtual

Sets the enabled state of this element.

Definition at line 473 of file IGUIElement.h.

References IsEnabled.

Referenced by deserializeAttributes().

## setID()

virtual void irr::gui::IGUIElement::setID | ( | s32 | id | ) |

inline virtual

Sets the id of this element.

Definition at line 515 of file IGUIElement.h.

References ID.

Referenced by deserializeAttributes().

## setMaxSize()

void irr::gui::IGUIElement::setMaxSize | ( | core::dimension2du | size | ) |

inline

Sets the maximum size allowed for this element.

If set to 0,0, there is no maximum size

Definition at line 171 of file IGUIElement.h.

References MaxSize, and updateAbsolutePosition().

Referenced by deserializeAttributes().

## setMinSize()

void irr::gui::IGUIElement::setMinSize | ( | core::dimension2du | size | ) |

inline

Sets the minimum size allowed for this element.

Definition at line 179 of file IGUIElement.h.

References MinSize, and updateAbsolutePosition().

Referenced by deserializeAttributes().

## setName() [1/2]

virtual void irr::gui::IGUIElement::setName | ( | const c8 * | name | ) |

inline virtual

Sets the name of the element.

Parameters

  name | New name of the gui element.

Definition at line 748 of file IGUIElement.h.

References Name.

Referenced by deserializeAttributes().

## setName() [2/2]

virtual void irr::gui::IGUIElement::setName | ( | const core::stringc & | name | ) |

inline virtual

Sets the name of the element.

Parameters

  name | New name of the gui element.

Definition at line 756 of file IGUIElement.h.

References Name.

## setNotClipped()

void irr::gui::IGUIElement::setNotClipped | ( | bool | noClip | ) |

inline

Sets whether the element will ignore its parent's clipping rectangle.

Parameters

  noClip | If true, the element will not be clipped by its parent's clipping rectangle.

Definition at line 154 of file IGUIElement.h.

References NoClip, and updateAbsolutePosition().

Referenced by deserializeAttributes().

## setRelativePosition() [1/2]

void irr::gui::IGUIElement::setRelativePosition | ( | const core::position2di & | position | ) |

inline

Sets the relative rectangle of this element, maintaining its current width and height.

Parameters

  position | The new relative position to set. Width and height will not be changed.

Definition at line 105 of file IGUIElement.h.

References irr::core::dimension2d< T >::Height, RelativeRect, setRelativePosition(), irr::core::dimension2d< T >::Width, irr::core::vector2d< T >::X, and irr::core::vector2d< T >::Y.

## setRelativePosition() [2/2]

void irr::gui::IGUIElement::setRelativePosition | ( | const core::rect< s32 > & | r | ) |

inline

Sets the relative rectangle of this element.

Parameters

  r | The absolute position to set

Definition at line 81 of file IGUIElement.h.

References AlignBottom, AlignLeft, AlignRight, AlignTop, DesiredRect, irr::gui::EGUIA_SCALE, irr::core::rect< T >::getSize(), irr::core::dimension2d< T >::Height, irr::core::rect< T >::LowerRightCorner, Parent, ScaleRect, updateAbsolutePosition(), irr::core::rect< T >::UpperLeftCorner, and irr::core::dimension2d< T >::Width.

Referenced by deserializeAttributes(), move(), and setRelativePosition().

## setRelativePositionProportional()

void irr::gui::IGUIElement::setRelativePositionProportional | ( | const core::rect< f32 > & | r | ) |

inline

Sets the relative rectangle of this element as a proportion of its parent's area.

Note
  This method used to be 'void setRelativePosition(const core::rect<f32>& r)'

Parameters

  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 119 of file IGUIElement.h.

References DesiredRect, irr::core::floor32(), irr::core::dimension2d< T >::Height, irr::core::rect< T >::LowerRightCorner, Parent, ScaleRect, updateAbsolutePosition(), irr::core::rect< T >::UpperLeftCorner, and irr::core::dimension2d< T >::Width.

## setSubElement()

virtual void irr::gui::IGUIElement::setSubElement | ( | bool | subElement | ) |

inline virtual

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 368 of file IGUIElement.h.

References IsSubElement.

## setTabGroup()

void irr::gui::IGUIElement::setTabGroup | ( | bool | isGroup | ) |

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 431 of file IGUIElement.h.

References IsTabGroup.

## setTabOrder()

void irr::gui::IGUIElement::setTabOrder | ( | s32 | index | ) |

inline

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 394 of file IGUIElement.h.

References IGUIElement(), getNextElement(), getTabGroup(), getTabOrder(), IsTabGroup, Parent, and TabOrder.

## setTabStop()

void irr::gui::IGUIElement::setTabStop | ( | bool | enable | ) |

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 377 of file IGUIElement.h.

References IsTabStop.

## setText()

virtual void irr::gui::IGUIElement::setText | ( | const wchar_t * | text | ) |

inline virtual

Sets the new caption of this element.

Definition at line 480 of file IGUIElement.h.

References Text.

Referenced by deserializeAttributes().

## setToolTipText()

virtual void irr::gui::IGUIElement::setToolTipText | ( | const wchar_t * | text | ) |

inline virtual

Sets the new caption of this element.

Definition at line 494 of file IGUIElement.h.

References ToolTipText.

## setVisible()

virtual void irr::gui::IGUIElement::setVisible | ( | bool | visible | ) |

inline virtual

Sets the visible state of this element.

Definition at line 351 of file IGUIElement.h.

References IsVisible.

Referenced by deserializeAttributes().

## updateAbsolutePosition()

virtual void irr::gui::IGUIElement::updateAbsolutePosition | ( |  | ) |

inline virtual

Updates the absolute position.

Definition at line 217 of file IGUIElement.h.

References Children, and recalculateAbsolutePosition().

Referenced by addChild(), setMaxSize(), setMinSize(), setNotClipped(), setRelativePosition(), and setRelativePositionProportional().

## Member Data Documentation

## AbsoluteClippingRect

core::rect<s32> irr::gui::IGUIElement::AbsoluteClippingRect

protected

absolute clipping rect of element

Definition at line 974 of file IGUIElement.h.

Referenced by IGUIElement(), getAbsoluteClippingRect(), isPointInside(), and recalculateAbsolutePosition().

## AbsoluteRect

core::rect<s32> irr::gui::IGUIElement::AbsoluteRect

protected

absolute rect of element

Definition at line 971 of file IGUIElement.h.

Referenced by IGUIElement(), getAbsolutePosition(), and recalculateAbsolutePosition().

## AlignBottom

EGUI_ALIGNMENT irr::gui::IGUIElement::AlignBottom

protected

Definition at line 1023 of file IGUIElement.h.

Referenced by IGUIElement(), recalculateAbsolutePosition(), serializeAttributes(), setAlignment(), and setRelativePosition().

## AlignLeft

EGUI_ALIGNMENT irr::gui::IGUIElement::AlignLeft

protected

tells the element how to act when its parent is resized

Definition at line 1023 of file IGUIElement.h.

Referenced by IGUIElement(), recalculateAbsolutePosition(), serializeAttributes(), setAlignment(), and setRelativePosition().

## AlignRight

EGUI_ALIGNMENT irr::gui::IGUIElement::AlignRight

protected

Definition at line 1023 of file IGUIElement.h.

Referenced by IGUIElement(), recalculateAbsolutePosition(), serializeAttributes(), setAlignment(), and setRelativePosition().

## AlignTop

EGUI_ALIGNMENT irr::gui::IGUIElement::AlignTop

protected

Definition at line 1023 of file IGUIElement.h.

Referenced by IGUIElement(), recalculateAbsolutePosition(), serializeAttributes(), setAlignment(), and setRelativePosition().

## Children

core::list<IGUIElement*> irr::gui::IGUIElement::Children

protected

List of all children of this element.

Definition at line 962 of file IGUIElement.h.

Referenced by ~IGUIElement(), addChildToEnd(), bringToFront(), draw(), getChildren(), getElementFromId(), getElementFromPoint(), getNextElement(), OnPostRender(), recalculateAbsolutePosition(), removeChild(), sendToBack(), and updateAbsolutePosition().

## DesiredRect

core::rect<s32> irr::gui::IGUIElement::DesiredRect

protected

the rectangle the element would prefer to be, if it was not constrained by parent or max/min size

Definition at line 978 of file IGUIElement.h.

Referenced by IGUIElement(), move(), recalculateAbsolutePosition(), serializeAttributes(), setAlignment(), setRelativePosition(), and setRelativePositionProportional().

## Environment

IGUIEnvironment* irr::gui::IGUIElement::Environment

protected

GUI Environment.

Definition at line 1026 of file IGUIElement.h.

Referenced by IGUIElement().

## ID

s32 irr::gui::IGUIElement::ID

protected

users can set this for identificating the element by integer

Definition at line 1011 of file IGUIElement.h.

Referenced by IGUIElement(), getID(), serializeAttributes(), and setID().

## IsEnabled

bool irr::gui::IGUIElement::IsEnabled

protected

is enabled?

Definition at line 993 of file IGUIElement.h.

Referenced by IGUIElement(), isEnabled(), serializeAttributes(), and setEnabled().

## IsSubElement

bool irr::gui::IGUIElement::IsSubElement

protected

is a part of a larger whole and should not be serialized?

Definition at line 996 of file IGUIElement.h.

Referenced by IGUIElement(), isSubElement(), and setSubElement().

## IsTabGroup

bool irr::gui::IGUIElement::IsTabGroup

protected

tab groups are containers like windows, use ctrl+tab to navigate

Definition at line 1020 of file IGUIElement.h.

Referenced by IGUIElement(), deserializeAttributes(), isTabGroup(), serializeAttributes(), setTabGroup(), and setTabOrder().

## IsTabStop

bool irr::gui::IGUIElement::IsTabStop

protected

tab stop like in windows

Definition at line 1014 of file IGUIElement.h.

Referenced by IGUIElement(), deserializeAttributes(), isTabStop(), serializeAttributes(), and setTabStop().

## IsVisible

bool irr::gui::IGUIElement::IsVisible

protected

is visible?

Definition at line 990 of file IGUIElement.h.

Referenced by IGUIElement(), isVisible(), serializeAttributes(), and setVisible().

## LastParentRect

core::rect<s32> irr::gui::IGUIElement::LastParentRect

protected

for calculating the difference when resizing parent

Definition at line 981 of file IGUIElement.h.

Referenced by addChildToEnd(), and recalculateAbsolutePosition().

## MaxSize

core::dimension2du irr::gui::IGUIElement::MaxSize

protected

maximum and minimum size of the element

Definition at line 987 of file IGUIElement.h.

Referenced by IGUIElement(), recalculateAbsolutePosition(), serializeAttributes(), and setMaxSize().

## MinSize

core::dimension2du irr::gui::IGUIElement::MinSize

protected

Definition at line 987 of file IGUIElement.h.

Referenced by IGUIElement(), recalculateAbsolutePosition(), serializeAttributes(), and setMinSize().

## Name

core::stringc irr::gui::IGUIElement::Name

protected

users can set this for identificating the element by string

Definition at line 1008 of file IGUIElement.h.

Referenced by getName(), serializeAttributes(), setName(), and setName().

## NoClip

bool irr::gui::IGUIElement::NoClip

protected

does this element ignore its parent's clipping rectangle?

Definition at line 999 of file IGUIElement.h.

Referenced by IGUIElement(), isNotClipped(), recalculateAbsolutePosition(), serializeAttributes(), and setNotClipped().

## Parent

IGUIElement* irr::gui::IGUIElement::Parent

protected

Pointer to the parent.

Definition at line 965 of file IGUIElement.h.

Referenced by IGUIElement(), addChildToEnd(), getParent(), isMyChild(), OnEvent(), recalculateAbsolutePosition(), remove(), setAlignment(), setRelativePosition(), setRelativePositionProportional(), and setTabOrder().

## RelativeRect

core::rect<s32> irr::gui::IGUIElement::RelativeRect

protected

relative rect of element

Definition at line 968 of file IGUIElement.h.

Referenced by IGUIElement(), getRelativePosition(), recalculateAbsolutePosition(), and setRelativePosition().

## ScaleRect

core::rect<f32> irr::gui::IGUIElement::ScaleRect

protected

relative scale of the element inside its parent

Definition at line 984 of file IGUIElement.h.

Referenced by recalculateAbsolutePosition(), setAlignment(), setRelativePosition(), and setRelativePositionProportional().

## TabOrder

s32 irr::gui::IGUIElement::TabOrder

protected

tab order

Definition at line 1017 of file IGUIElement.h.

Referenced by IGUIElement(), deserializeAttributes(), getTabOrder(), serializeAttributes(), and setTabOrder().

## Text

core::stringw irr::gui::IGUIElement::Text

protected

caption

Definition at line 1002 of file IGUIElement.h.

Referenced by getText(), and setText().

## ToolTipText

core::stringw irr::gui::IGUIElement::ToolTipText

protected

tooltip

Definition at line 1005 of file IGUIElement.h.

Referenced by getToolTipText(), and setToolTipText().

## Type

EGUI_ELEMENT_TYPE irr::gui::IGUIElement::Type

protected

type of element

Definition at line 1029 of file IGUIElement.h.

Referenced by IGUIElement(), getType(), getTypeName(), and hasType().

The documentation for this class was generated from the following file:

- IGUIElement.h

- Irrlicht Engine Documentation © 2003-2012 by Nikolaus Gebhardt. Generated on for Irrlicht 3D Engine by Doxygen 1.15.0