MezzanineEngine March 18, 2012

Mezzanine::UI::Widget Class Reference

This class is the base class for all widgets. More...

#include <uiwidget.h>

Inheritance diagram for Mezzanine::UI::Widget:
Mezzanine::UI::Cell Mezzanine::UI::CellGrid Mezzanine::UI::CheckBox Mezzanine::UI::DropDownList Mezzanine::UI::ListBox Mezzanine::UI::Menu Mezzanine::UI::RadioButton Mezzanine::UI::RenderableContainerWidget Mezzanine::UI::Scrollbar Mezzanine::UI::Spinner Mezzanine::UI::TabSet

List of all members.

Public Types

typedef std::map< Whole,
RenderablePair > 
RenderableMap
typedef std::pair
< BasicRenderable *, Widget * > 
RenderablePair
enum  WidgetType {
  W_ButtonListBox, W_Cell, W_CellGrid, W_CheckBox,
  W_DropDownList, W_DropDownMenu, W_GenericWidgetContainer, W_ListBox,
  W_Menu, W_MenuWindow, W_RadioButton, W_Scrollbar,
  W_Spinner, W_TabSet, W_TextBox, W_Window
}

Public Member Functions

 Widget (const String &name, Layer *Parent)
 Standard initialization constructor.
virtual ~Widget ()
 Standard destructor.
virtual void _AppendVertices (ScreenVertexData &Vertices)
 Appends the vertices of this renderable to another vector.
virtual void _MarkDirty ()
 Marks this renderable as well as all parent objects as dirty.
virtual void _Redraw ()
 Regenerates the verticies in this renderable.
virtual bool CheckMouseHover ()
 Checks to see if the current mouse position is over this widget.
virtual Vector2 GetActualPosition () const
 Sets the pixel position of this widget.
virtual Vector2 GetActualSize () const
 Sets the pixel size of this widget.
virtual ButtonGetHoveredButton () const
 Gets the hovered button within this widget, if any.
virtual WidgetGetHoveredSubWidget () const
 Gets the hovered sub-widget within this widget, if any.
virtual InputCaptureDataGetInputCaptureData () const
 Gets the data determining what input should be captured.
virtual LayerGetLayer () const
 Gets the layer this widget belongs to.
virtual ConstStringGetName () const
 Gets the name of this widget.
virtual Vector2 GetPosition () const
 Gets the relative position of this widget.
virtual RenderableRect GetRect (bool Relative=true) const
 Gets this Widgets' Rect.
virtual UI::RenderPriority GetRenderPriority () const
 Gets the priority this widget should be rendered with.
virtual Vector2 GetSize () const
 Gets the relative size of this widget.
virtual WidgetType GetType () const
 Gets the type of widget this is.
virtual bool GetVisible () const
 Gets the visibility setting of this widget.
virtual void Hide ()
 Forces this widget to hide.
virtual bool IsHovered () const
 Gets the result of the last mouse hover check.
virtual bool IsInputCaptureWidget () const
 Checks if this is an input capturing widget.
virtual bool IsVisible () const
 Gets whether or not this widget is being drawn.
virtual void SetActualPosition (const Vector2 &Position)=0
 Sets the pixel position of this widget.
virtual void SetActualSize (const Vector2 &Size)=0
 Sets the pixel size of this widget.
virtual void SetPosition (const Vector2 &Position)=0
 Sets the relative position of this widget.
virtual void SetRect (const RenderableRect &Rect)
 Sets the Rect(Position and Size) of this Widget.
virtual void SetRenderPriority (const UI::RenderPriority &Priority)
 Sets the priority this widget should be rendered with.
virtual void SetSize (const Vector2 &Size)=0
 Sets the relative size of this widget.
virtual void SetVisible (bool visible)
 Sets the visibility of this widget.
virtual void SetWidgetCallback (WidgetCallback *CB)
 Sets the callback to be used by this widget.
virtual void Show ()
 Forces this widget to be shown.
virtual void UpdateDimensions ()=0
 Updates the dimensions of this widget to match those of the new screen size.

Protected Member Functions

virtual void AddSubRenderable (const Whole &Zorder, const RenderablePair &ToAdd)
 Adds a renderable as a subrenderable to this widget.
virtual bool CheckMouseHoverImpl ()=0
 Child specific mouse hover method.
virtual void ProcessCapturedInputs ()
 Processes the captured inputs. This is an empty function and should be overridden if making an input capturing widget.
virtual void SetVisibleImpl (bool visible)=0
 Child specific visibility method.
virtual void SubWidgetFocusUpdate (bool Force=false)
 For use with sub-widget update/automation when the mouse isn't hovered.
virtual void SubWidgetUpdate (bool Force=false)
 For use with sub-widget update/automation.
virtual void Update (bool Force=false)
 For use with widget update/automation.
virtual void UpdateImpl (bool Force=false)=0
 Child specific update method.

Protected Attributes

UI::WidgetCallbackCallback
InputCaptureDataCaptureData
bool Dirty
bool Hovered
UI::ButtonHoveredButton
UI::WidgetHoveredSubWidget
UIManagerManager
String Name
LayerParentLayer
UI::WidgetParentWidget
UI::RenderPriority Priority
Vector2 RelPosition
Vector2 RelSize
RenderableMap SubRenderables
UI::WidgetSubWidgetFocus
WidgetType Type
std::vector< VertexDataVertices
bool Visible

Friends

class Layer
class Mezzanine::UIManager

Detailed Description

This class is the base class for all widgets.

Definition at line 100 of file uiwidget.h.


Constructor & Destructor Documentation

Mezzanine::UI::Widget::Widget ( const String name,
Layer Parent 
)

Standard initialization constructor.

Parameters:
ParentThe parent layer that created this widget.
nameThe Name for the Widget.

Definition at line 98 of file uiwidget.cpp.


Member Function Documentation

void Mezzanine::UI::Widget::_AppendVertices ( ScreenVertexData Vertices) [virtual]

Appends the vertices of this renderable to another vector.

Parameters:
VerticesThe vector of vertex's to append to.

Reimplemented in Mezzanine::UI::Menu.

Definition at line 355 of file uiwidget.cpp.

bool Mezzanine::UI::Widget::CheckMouseHover ( ) [virtual]

Checks to see if the current mouse position is over this widget.

Returns:
Returns a bool value, true if the mouse is over this widget, false if it's not.

Definition at line 232 of file uiwidget.cpp.

Vector2 Mezzanine::UI::Widget::GetActualPosition ( ) const [virtual]

Sets the pixel position of this widget.

Returns:
Returns a vector2 representing the pixel position of this widget.

Definition at line 278 of file uiwidget.cpp.

Vector2 Mezzanine::UI::Widget::GetActualSize ( ) const [virtual]

Sets the pixel size of this widget.

Returns:
Returns a vector2 representing the pixel size of this widget.

Definition at line 288 of file uiwidget.cpp.

Button * Mezzanine::UI::Widget::GetHoveredButton ( ) const [virtual]

Gets the hovered button within this widget, if any.

Returns:
Returns a pointer to the button within this widget the mouse is hovering over, or NULL if none.

Definition at line 308 of file uiwidget.cpp.

Widget * Mezzanine::UI::Widget::GetHoveredSubWidget ( ) const [virtual]

Gets the hovered sub-widget within this widget, if any.

Returns:
Returns a pointer to the sub-widget within this widget the mouse is hovering over, or NULL if none.

Definition at line 313 of file uiwidget.cpp.

InputCaptureData * Mezzanine::UI::Widget::GetInputCaptureData ( ) const [virtual]

Gets the data determining what input should be captured.

Returns:
Returns a pointer to the InputCaptureData, or NULL if this widget doesn't capture data.

Definition at line 323 of file uiwidget.cpp.

Layer * Mezzanine::UI::Widget::GetLayer ( ) const [virtual]

Gets the layer this widget belongs to.

Returns:
Returns a pointer to the layer this eidget belongs to.

Definition at line 318 of file uiwidget.cpp.

ConstString & Mezzanine::UI::Widget::GetName ( ) const [virtual]

Gets the name of this widget.

Returns:
Returns a String containing the name of this widget.

Definition at line 219 of file uiwidget.cpp.

Vector2 Mezzanine::UI::Widget::GetPosition ( ) const [virtual]

Gets the relative position of this widget.

The position is relative to the screen size. Values range from 0.0 to 1.0.

Returns:
Returns a vector2 representing the relative position of this widget.

Definition at line 273 of file uiwidget.cpp.

RenderableRect Mezzanine::UI::Widget::GetRect ( bool  Relative = true) const [virtual]

Gets this Widgets' Rect.

Parameters:
RelativeWhether or not you want the Rect to be populated with Relative values.
Returns:
Returns a Rect containing this Widgets' Position and Size.

Definition at line 267 of file uiwidget.cpp.

UI::RenderPriority Mezzanine::UI::Widget::GetRenderPriority ( ) const [virtual]

Gets the priority this widget should be rendered with.

Returns:
Returns an enum value representing this widget's priority level.

Definition at line 303 of file uiwidget.cpp.

Vector2 Mezzanine::UI::Widget::GetSize ( ) const [virtual]

Gets the relative size of this widget.

The size is relative to the screen size. Values range from 0.0 to 1.0.

Returns:
Returns a vector2 representing the relative size of this widget.

Definition at line 283 of file uiwidget.cpp.

Widget::WidgetType Mezzanine::UI::Widget::GetType ( ) const [virtual]

Gets the type of widget this is.

Returns:
Returns an enum value representing the type of widget this is.

Definition at line 204 of file uiwidget.cpp.

bool Mezzanine::UI::Widget::GetVisible ( ) const [virtual]

Gets the visibility setting of this widget.

Returns:
Returns a bool that is the current visibility setting of this widget.

Definition at line 184 of file uiwidget.cpp.

bool Mezzanine::UI::Widget::IsHovered ( ) const [virtual]

Gets the result of the last mouse hover check.

Returns:
Returns whether or not the mouse was hovering over this widget during the last check.

Definition at line 214 of file uiwidget.cpp.

bool Mezzanine::UI::Widget::IsInputCaptureWidget ( ) const [virtual]

Checks if this is an input capturing widget.

Returns:
Returns a bool indicating whether or not this widget will capture input.

Definition at line 209 of file uiwidget.cpp.

bool Mezzanine::UI::Widget::IsVisible ( ) const [virtual]

Gets whether or not this widget is being drawn.

This function will check the visibility of all parent objects to see if it is being drawn. This will not tell you whether or not this widget has it's own visibility setting enabled. For that see: GetVisible().

Returns:
Returns a bool representing the visibility of this widget.

Definition at line 189 of file uiwidget.cpp.

virtual void Mezzanine::UI::Widget::SetActualPosition ( const Vector2 Position) [pure virtual]
virtual void Mezzanine::UI::Widget::SetActualSize ( const Vector2 Size) [pure virtual]
virtual void Mezzanine::UI::Widget::SetPosition ( const Vector2 Position) [pure virtual]

Sets the relative position of this widget.

The position is relative to the screen size. Values range from 0.0 to 1.0.

Parameters:
PositionA vector2 representing the relative position of this widget.

Implemented in Mezzanine::UI::Cell, Mezzanine::UI::CellGrid, Mezzanine::UI::CheckBox, Mezzanine::UI::DropDownList, Mezzanine::UI::ListBox, Mezzanine::UI::Menu, Mezzanine::UI::RenderableContainerWidget, Mezzanine::UI::Scrollbar, Mezzanine::UI::ScrolledCellGrid, Mezzanine::UI::Spinner, Mezzanine::UI::TabSet, and Mezzanine::UI::Window.

void Mezzanine::UI::Widget::SetRect ( const RenderableRect Rect) [virtual]

Sets the Rect(Position and Size) of this Widget.

Parameters:
RectThe Rect to set.

Definition at line 255 of file uiwidget.cpp.

void Mezzanine::UI::Widget::SetRenderPriority ( const UI::RenderPriority Priority) [virtual]

Sets the priority this widget should be rendered with.

The default value for this is Medium.

Parameters:
PriorityThe priority level to be used when rendering this widget.

Definition at line 293 of file uiwidget.cpp.

virtual void Mezzanine::UI::Widget::SetSize ( const Vector2 Size) [pure virtual]

Sets the relative size of this widget.

The size is relative to the screen size. Values range from 0.0 to 1.0.

Parameters:
SizeA vector2 representing the relative size of this widget.

Implemented in Mezzanine::UI::Cell, Mezzanine::UI::CellGrid, Mezzanine::UI::CheckBox, Mezzanine::UI::DropDownList, Mezzanine::UI::ListBox, Mezzanine::UI::Menu, Mezzanine::UI::RenderableContainerWidget, Mezzanine::UI::Scrollbar, Mezzanine::UI::ScrolledCellGrid, Mezzanine::UI::Spinner, Mezzanine::UI::TabSet, and Mezzanine::UI::Window.

void Mezzanine::UI::Widget::SetVisible ( bool  visible) [virtual]

Sets the visibility of this widget.

Parameters:
visibleBool determining whether or not this widget should be visible.

Definition at line 174 of file uiwidget.cpp.

void Mezzanine::UI::Widget::SetWidgetCallback ( WidgetCallback CB) [virtual]

Sets the callback to be used by this widget.

Remarks:
You can pass in a NULL pointer to clear the existing callback.
Parameters:
CBThe callback to be set for this widget.

Definition at line 224 of file uiwidget.cpp.

virtual void Mezzanine::UI::Widget::UpdateDimensions ( ) [pure virtual]

Updates the dimensions of this widget to match those of the new screen size.

This function is called automatically when a viewport changes in size, and shouldn't need to be called manually.

Implemented in Mezzanine::UI::Cell, Mezzanine::UI::CellGrid, Mezzanine::UI::CheckBox, Mezzanine::UI::DropDownList, Mezzanine::UI::ListBox, Mezzanine::UI::Menu, Mezzanine::UI::MenuWindow, Mezzanine::UI::PagedCellGrid, Mezzanine::UI::RenderableContainerWidget, Mezzanine::UI::Scrollbar, Mezzanine::UI::ScrolledCellGrid, Mezzanine::UI::Spinner, Mezzanine::UI::TabSet, and Mezzanine::UI::Window.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines