CGUIWidget Class Reference

Description

Component wrapper for GUIWidget.

Inherits Component.

Inherited by GUIDropDownMenu, GUITooltip, and WindowFrameWidget.

Methods

void setSkin (const HGUISkin &skin)
 Sets the skin used for all GUI elements in the widget. More...
 
const GUISkingetSkin () const
 Returns the currently active GUI skin. More...
 
const HGUISkingetSkinResource () const
 Returns the currently active GUI skin resource. More...
 
GUIPanelgetPanel () const
 Returns the root GUI panel for the widget. More...
 
UINT8 getDepth () const
 Returns the depth to render the widget at. More...
 
void setDepth (UINT8 depth)
 Changes the depth to render the widget at. More...
 
bool inBounds (const Vector2I &position) const
 Checks are the specified coordinates within widget bounds. More...
 
const Rect2IgetBounds () const
 Returns bounds of the widget, relative to the parent window. More...
 
bool isDirty (bool cleanIfDirty)
 Return true if widget or any of its elements are dirty. More...
 
ViewportgetTarget () const
 Returns the viewport that this widget will be rendered on. More...
 
SPtr< CameragetCamera () const
 Returns the camera this widget is being rendered to. More...
 
const Vector< GUIElement * > & getElements () const
 Returns a list of all elements parented to this widget. More...
 
RTTITypeBasegetRTTI () const override
 Returns an interface you can use to access class' Run Time Type Information. More...
 
Internal
GUIWidget_getInternal () const
 Returns the internal GUIWidget that is wrapped by this component. More...
 
- Methods inherited from Component
HSceneObject sceneObject () const
 Returns the SceneObject this Component is assigned to. More...
 
HSceneObject SO () const
 Returns the SceneObject this Component is assigned to. More...
 
HComponent getHandle () const
 Returns a handle to this object. More...
 
virtual bool calculateBounds (Bounds &bounds)
 Calculates bounds of the visible contents represented by this component (for example a mesh for Renderable). More...
 
virtual bool typeEquals (const Component &other)
 Checks if this and the provided component represent the same type. More...
 
void destroy (bool immediate=false)
 Removes the component from parent SceneObject and deletes it. More...
 
virtual void _instantiate ()
 Construct any resources the component needs before use. More...
 
void setNotifyFlags (TransformChangedFlags flags)
 Sets new flags that determine when is onTransformChanged called. More...
 
TransformChangedFlags _getNotifyFlags () const
 Gets the currently assigned notify flags. More...
 
- Methods inherited from GameObject
UINT64 getInstanceId () const
 Returns the unique instance ID of the GameObject. More...
 
UINT32 getLinkId () const
 Returns an ID that identifies a link between this object and its equivalent in the linked prefab. More...
 
const StringgetName () const
 Gets the name of the object. More...
 
void setName (const String &name)
 Sets the name of the object. More...
 
void _setIsDestroyed ()
 Marks the object as destroyed. More...
 
bool _getIsDestroyed () const
 Checks if the object has been destroyed. More...
 
void _setLinkId (UINT32 id)
 Changes the prefab link ID for this object. More...
 
virtual void _setInstanceData (GameObjectInstanceDataPtr &other)
 Replaces the instance data with another objects instance data. More...
 
virtual GameObjectInstanceDataPtr _getInstanceData () const
 Returns instance data that identifies this GameObject and is used for referencing by game object handles. More...
 
- Methods inherited from IReflectable
bool isDerivedFrom (RTTITypeBase *base)
 Returns true if current RTTI class is derived from base (Or if it is the same type as base). More...
 
UINT32 getTypeId () const
 Returns an unique type identifier of the class. More...
 
const StringgetTypeName () const
 Returns the type name of the class. More...
 

Static methods

static RTTITypeBasegetRTTIStatic ()
 
- Static methods inherited from Component
static RTTITypeBasegetRTTIStatic ()
 
- Static methods inherited from GameObject
static RTTITypeBasegetRTTIStatic ()
 
- Static methods inherited from IReflectable
static Vector< RTTITypeBase * > & getDerivedClasses ()
 Returns all classes deriving directly from IReflectable. More...
 
static SPtr< IReflectablecreateInstanceFromTypeId (UINT32 rttiTypeId)
 Creates an empty instance of a class from a type identifier. More...
 
static void _registerDerivedClass (RTTITypeBase *derivedClass)
 Called by each type deriving from IReflectable, on program load. More...
 
static RTTITypeBase_getRTTIfromTypeId (UINT32 rttiTypeId)
 Returns class' RTTI type from type id. More...
 
static bool _isTypeIdDuplicate (UINT32 typeId)
 Checks if the provided type id is unique. More...
 
static void _checkForCircularReferences ()
 Iterates over all RTTI types and reports any circular references (for example one type having a field referencing another type, and that type having a field referencing the first type). More...
 
static RTTITypeBasegetRTTIStatic ()
 Returns an interface you can use to access class' Run Time Type Information. More...
 

Method documentation

GUIWidget* _getInternal ( ) const

Returns the internal GUIWidget that is wrapped by this component.

const Rect2I& getBounds ( ) const

Returns bounds of the widget, relative to the parent window.

SPtr<Camera> getCamera ( ) const

Returns the camera this widget is being rendered to.

UINT8 getDepth ( ) const

Returns the depth to render the widget at.

If two widgets overlap the widget with the lower depth will be rendered in front.

const Vector<GUIElement*>& getElements ( ) const

Returns a list of all elements parented to this widget.

GUIPanel* getPanel ( ) const

Returns the root GUI panel for the widget.

RTTITypeBase* getRTTI ( ) const
overridevirtual

Returns an interface you can use to access class' Run Time Type Information.

Note
You must derive your own version of RTTITypeBase, in which you may encapsulate all reflection specific operations.

Reimplemented from Component.

Reimplemented in WindowFrameWidget.

const GUISkin& getSkin ( ) const

Returns the currently active GUI skin.

const HGUISkin& getSkinResource ( ) const

Returns the currently active GUI skin resource.

Viewport* getTarget ( ) const

Returns the viewport that this widget will be rendered on.

bool inBounds ( const Vector2I position) const

Checks are the specified coordinates within widget bounds.

Coordinates should be relative to the parent window.

bool isDirty ( bool  cleanIfDirty)

Return true if widget or any of its elements are dirty.

Parameters
[in]cleanIfDirtyIf true, all dirty elements will be updated and widget will be marked as clean.
Returns
True if dirty, false if not. If "cleanIfDirty" is true, the returned state is the one before cleaning.
void onDestroyed ( )
overrideprotectedvirtual

Called once just before the component is destroyed.

Called regardless of the state the component is in.

Reimplemented from Component.

virtual void ownerTargetResized ( )
protectedvirtual

Called when the viewport size changes and widget elements need to be updated.

Reimplemented in WindowFrameWidget.

virtual void ownerWindowFocusChanged ( )
protectedvirtual

Called when the parent window gained or lost focus.

Reimplemented in WindowFrameWidget.

void setDepth ( UINT8  depth)

Changes the depth to render the widget at.

If two widgets overlap the widget with the lower depth will be rendered in front.

void setSkin ( const HGUISkin skin)

Sets the skin used for all GUI elements in the widget.

This will update the look of all current elements.

void update ( )
overrideprotectedvirtual

Called once per frame.

Only called if the component is in Running state.

Reimplemented from Component.

Constructor & Destructor Documentation

CGUIWidget ( const HSceneObject parent,
const SPtr< Camera > &  camera 
)
protected

Constructs a new GUI widget attached to the specified parent scene object.

Widget elements will be rendered on the provided camera.

CGUIWidget ( const HSceneObject parent,
const HCamera camera 
)
protected

Constructs a new GUI widget attached to the specified parent scene object.

Widget elements will be rendered on the provided camera.