gui::uiobject Class Reference

The base of the GUI. More...

#include <gui_uiobject.hpp>

Inheritance diagram for gui::uiobject:
gui::region gui::frame gui::layered_region gui::button gui::focus_frame gui::scroll_frame gui::slider gui::status_bar gui::font_string gui::texture gui::check_button gui::edit_box

List of all members.

Public Member Functions

 uiobject (manager *pManager)
 Contructor.
virtual ~uiobject ()
 Destructor.
virtual void render ()=0
 Renders this widget on the current render target.
virtual void update_anchors ()
 updates this widget's anchors.
virtual void update (float fDelta)
 updates this widget's logic.
virtual std::string serialize (const std::string &sTab) const
 Prints all relevant information about this widget in a string.
virtual void copy_from (uiobject *pObj)
 Copies an uiobject's parameters into this uiobject (inheritance).
virtual void fire_update_borders () const
 Tells this widget to update its borders.
void fire_update_dimensions () const
 Tells this widget to update its dimensions.
const std::string & get_name () const
 Returns this widget's name.
const std::string & get_lua_name () const
 Returns this widget's Lua name.
const std::string & get_raw_name () const
 Returns this widget's raw name.
void set_name (const std::string &sName)
 Sets this widget's name.
virtual void set_parent (uiobject *pParent)
 Changes this widget's parent.
const uiobjectget_parent () const
 Returns this widget's parent.
uiobjectget_parent ()
 Returns this widget's parent.
uiobjectget_base ()
 Returns the widget this one inherits from.
void set_alpha (float fAlpha)
 Changes this widget's alpha (opacity).
float get_alpha () const
 Returns this widget's alpha (opacity).
virtual void show ()
 shows this widget.
virtual void hide ()
 hides this widget.
virtual void set_shown (bool bIsShown)
 shows/hides this widget.
bool is_shown () const
 Checks if this widget is shown.
virtual bool is_visible () const
 Checks if this widget can be seen on the screen.
virtual void set_abs_width (uint uiAbsWidth)
 Changes this widget's absolute width (in pixels).
virtual void set_abs_height (uint uiAbsHeight)
 Changes this widget's absolute height (in pixels).
bool is_width_absolute () const
 Checks if this widget's width has been defined as absolute.
bool is_height_absolute () const
 Checks if this widget's height has been defined as absolute.
void set_rel_width (float fRelWidth)
 Changes this widget's width (relative to its parent).
void set_rel_height (float fRelHeight)
 Changes this widget's height (relative to its parent).
uint get_abs_width () const
 Returns this widget's absolute width (in pixels).
uint get_apparent_width () const
 Returns this widget's appearend width (in pixels).
uint get_abs_height () const
 Returns this widget's absolute height (in pixels).
uint get_apparent_height () const
 Returns this widget's appearend height (in pixels).
float get_rel_width () const
 Returns this widget's width (relative to its parent).
float get_rel_height () const
 Returns this widget's height (relative to its parent).
const std::string & get_object_type () const
 Returns the type of this widget.
bool is_object_type (const std::string &sType) const
 Checks if this widget is of the provided type.
const std::vector< std::string > & get_object_typeList () const
 Returns an array containing all the types of this widget.
int get_bottom () const
 Returns the vertical position of this widget's bottom border.
vector2< int > get_center () const
 Returns the position of this widget's center.
int get_left () const
 Returns the horizontal position of this widget's left border.
int get_right () const
 Returns the horizontal position of this widget's right border.
int get_top () const
 Returns the vertical position of this widget's top border.
const std::array< int, 4 > & get_borders () const
 Returns this widget's borders.
void clear_all_points ()
 Removes all anchors.
void set_all_points (uiobject *pObj)
 Adjusts this widgets anchors to fit the provided widget.
void set_all_points (const std::string &sObjName)
 Adjusts this widgets anchors to fit the provided widget.
void set_abs_point (anchor_point mPoint, const std::string &sParentName, anchor_point mRelativePoint, int iX=0, int iY=0)
 create_s/modifies an anchor.
void set_rel_point (anchor_point mPoint, const std::string &sParentName, anchor_point mRelativePoint, float fX=0, float fY=0)
 create_s/modifies an anchor.
void set_point (const anchor &mAnchor)
 Adds/replaces an anchor.
bool depends_on (uiobject *pObj) const
 Checks if this widget depends on another.
uint get_num_point () const
 Returns the number of defined anchors.
anchormodify_point (anchor_point mPoint)
 Returns one of this widget's anchor to modify it.
const anchorget_point (anchor_point mPoint) const
 Returns one of this widget's anchor.
const std::map< anchor_point,
anchor > & 
get_point_list () const
 Returns all of this widgets's anchors.
void notify_anchored_object (uiobject *pObj, bool bAnchored) const
 Notifies this widget that another one is anchored to it.
bool is_virtual () const
 Checks if this uiobject is virtual.
void set_virtual ()
 Makes this uiobject virtual.
uint get_id () const
 Returns this widget's unique ID.
void set_id (uint uiID)
 Sets this widget's unique ID.
void set_special ()
 Flags this object as "special".
bool is_special () const
 Checks if this object is special.
virtual void set_manually_rendered (bool bManuallyRendered, uiobject *pRenderer=nullptr)
 Flags this object as "manually rendered".
bool is_manually_rendered () const
 Checks if this object is manually rendered.
void set_newly_created ()
 Flags this object as newly created.
bool is_newly_created () const
 Checks if this object has been newly created.
virtual void notify_renderer_need_redraw () const
 Notifies the renderer of this widget that it needs to be redrawn.
virtual void fire_redraw () const
 Tells this widget that a manually rendered widget requires redraw.
void mark_for_copy (const std::string &sVariable)
 Adds a Lua variable to copy when derivating.
virtual std::vector< uiobject * > clear_links ()
 Removes all anchors that point to this widget and all other kind of links.
std::map< uint, uiobject * > get_anchored_objects () const
 Returns the list of all objects that are anchored to this one.
virtual void notify_loaded ()
 Notifies this widget that it has been fully loaded.
managerget_manager ()
 Returns this widget's manager.
const managerget_manager () const
 Returns this widget's manager.
virtual void create_glue ()=0
 Creates the associated Lua glue.
void remove_glue ()
 Removes the Lua glue.
virtual void push_on_lua (lua::state *pLua) const
 Pushes this uiobject on the provided lua::State.
virtual void parse_block (xml::block *pBlock)=0
 Parses data from an xml::block.

Protected Member Functions

virtual void parse_size_block_ (xml::block *pBlock)
virtual void parse_anchor_block_ (xml::block *pBlock)
void read_anchors_ (float &iLeft, float &iRight, float &iTop, float &iBottom, float &iXCenter, float &iYCenter) const
void make_borders_ (float &iMin, float &iMax, float iCenter, float iSize) const
virtual void update_borders_ () const
virtual void update_dimensions_ () const
virtual void notify_manually_rendered_object_ (uiobject *pObject, bool bManuallyRendered)

Protected Attributes

managerpManager_
std::string sName_
std::string sRawName_
std::string sLuaName_
uint uiID_
uiobjectpParent_
uiobjectpInheritance_
bool bSpecial_
bool bManuallyRendered_
bool bNewlyCreated_
uiobjectpRenderer_
bool bInherits_
bool bVirtual_
bool bLoaded_
bool bReady_
std::vector< lua_glue * > lGlueList_
std::vector< std::string > lCopyList_
std::vector< std::string > lType_
std::map< anchor_point, anchorlAnchorList_
std::vector< const uiobject * > lPreviousAnchorParentList_
std::array< bool, 4 > lDefinedBorderList_
std::array< int, 4 > lBorderList_
float fAlpha_
bool bIsShown_
bool bIsVisible_
bool bIsWidthAbs_
bool bIsHeightAbs_
uint uiAbsWidth_
uint uiAbsHeight_
float fRelWidth_
float fRelHeight_
bool bUpdateAnchors_
bool bUpdateBorders_
bool bUpdateDimensions_
std::map< uint, uiobject * > lAnchoredObjectList_

Detailed Description

The base of the GUI.

This widget (GUI element) is a virtual base. It doesn't display anything on its own and must be inherited to allow new features. It provides several virtual functions : update, render... They should be overriden and contain all the required logic for it to work.
Look at the provided widgets (Frame, Slider, ...) to see how it's done.

Definition at line 45 of file gui_uiobject.hpp.


Constructor & Destructor Documentation

gui::uiobject::uiobject ( manager pManager  )  [explicit]

Contructor.

Definition at line 13 of file gui_uiobject.cpp.

gui::uiobject::~uiobject (  )  [virtual]

Destructor.

Definition at line 26 of file gui_uiobject.cpp.


Member Function Documentation

void gui::uiobject::clear_all_points (  ) 

Removes all anchors.

Note:
This widget and its children won't be visible until you define at least one anchor.

Definition at line 409 of file gui_uiobject.cpp.

std::vector< uiobject * > gui::uiobject::clear_links (  )  [virtual]

Removes all anchors that point to this widget and all other kind of links.

Returns:
The list of all widgets that have been cleared
Note:
Also clears children objects (see frame::clear_links()).
Must be called before deleting the widget, except when closing the whole UI.

Reimplemented in gui::frame.

Definition at line 1077 of file gui_uiobject.cpp.

void gui::uiobject::copy_from ( uiobject pObj  )  [virtual]

Copies an uiobject's parameters into this uiobject (inheritance).

Parameters:
pObj The uiobject to copy

Definition at line 86 of file gui_uiobject.cpp.

virtual void gui::uiobject::create_glue (  )  [pure virtual]

Creates the associated Lua glue.

Note:
This method is pure virtual : it must be overriden.

Implemented in gui::button, gui::check_button, gui::edit_box, gui::focus_frame, gui::font_string, gui::frame, gui::layered_region, gui::region, gui::scroll_frame, gui::slider, gui::status_bar, and gui::texture.

bool gui::uiobject::depends_on ( uiobject pObj  )  const

Checks if this widget depends on another.

Parameters:
pObj The widget to test
Note:
Usefull to detect circular refences.

Definition at line 632 of file gui_uiobject.cpp.

void gui::uiobject::fire_redraw (  )  const [virtual]

Tells this widget that a manually rendered widget requires redraw.

Note:
This function does nothing by default.

Reimplemented in gui::scroll_frame.

Definition at line 1053 of file gui_uiobject.cpp.

void gui::uiobject::fire_update_borders (  )  const [virtual]

Tells this widget to update its borders.

Reimplemented in gui::slider.

Definition at line 960 of file gui_uiobject.cpp.

void gui::uiobject::fire_update_dimensions (  )  const

Tells this widget to update its dimensions.

Definition at line 969 of file gui_uiobject.cpp.

uint gui::uiobject::get_abs_height (  )  const

Returns this widget's absolute height (in pixels).

Returns:
This widget's absolute height (in pixels)
Note:
If you need to get the size of a widget on the screen, use get_apparent_height() instead, because some widgets can have an infinite or undefined height.

Definition at line 324 of file gui_uiobject.cpp.

uint gui::uiobject::get_abs_width (  )  const

Returns this widget's absolute width (in pixels).

Returns:
This widget's absolute width (in pixels)
Note:
If you need to get the size of a widget on the screen, use get_apparent_width() instead, because some widgets can have an infinite or undefined width.

Definition at line 313 of file gui_uiobject.cpp.

float gui::uiobject::get_alpha (  )  const

Returns this widget's alpha (opacity).

Returns:
This widget's alpha (opacity).

Definition at line 216 of file gui_uiobject.cpp.

std::map< uint, uiobject * > gui::uiobject::get_anchored_objects (  )  const

Returns the list of all objects that are anchored to this one.

Returns:
The list of all objects that are anchored to this one

Definition at line 1072 of file gui_uiobject.cpp.

uint gui::uiobject::get_apparent_height (  )  const

Returns this widget's appearend height (in pixels).

Returns:
This widget's appearend height (in pixels)
Note:
If you need to get the size of a widget on the screen, use this function instead of get_abs_height(), because some widgets can have an infinite or undefined height.

Definition at line 329 of file gui_uiobject.cpp.

uint gui::uiobject::get_apparent_width (  )  const

Returns this widget's appearend width (in pixels).

Returns:
This widget's appearend width (in pixels)
Note:
If you need to get the size of a widget on the screen, use this function instead of get_abs_width(), because some widgets can have an infinite or undefined width.

Definition at line 318 of file gui_uiobject.cpp.

uiobject * gui::uiobject::get_base (  ) 

Returns the widget this one inherits from.

Returns:
The widget this one inherits from

Definition at line 366 of file gui_uiobject.cpp.

const std::array< int, 4 > & gui::uiobject::get_borders (  )  const

Returns this widget's borders.

Returns:
This widget's borders

Definition at line 404 of file gui_uiobject.cpp.

int gui::uiobject::get_bottom (  )  const

Returns the vertical position of this widget's bottom border.

Returns:
The vertical position of this widget's bottom border

Definition at line 398 of file gui_uiobject.cpp.

vector2< int > gui::uiobject::get_center (  )  const

Returns the position of this widget's center.

Returns:
The position of this widget's center

Definition at line 371 of file gui_uiobject.cpp.

uint gui::uiobject::get_id (  )  const

Returns this widget's unique ID.

Returns:
This widget's unique ID

Definition at line 693 of file gui_uiobject.cpp.

int gui::uiobject::get_left (  )  const

Returns the horizontal position of this widget's left border.

Returns:
The horizontal position of this widget's left border

Definition at line 380 of file gui_uiobject.cpp.

const std::string & gui::uiobject::get_lua_name (  )  const

Returns this widget's Lua name.

Returns:
This widget's Lua name

Definition at line 168 of file gui_uiobject.cpp.

const manager * gui::uiobject::get_manager (  )  const

Returns this widget's manager.

Returns:
This widget's manager

Definition at line 33 of file gui_uiobject.cpp.

manager * gui::uiobject::get_manager (  ) 

Returns this widget's manager.

Returns:
This widget's manager

Definition at line 38 of file gui_uiobject.cpp.

const std::string & gui::uiobject::get_name (  )  const

Returns this widget's name.

Returns:
This widget's name

Definition at line 163 of file gui_uiobject.cpp.

uint gui::uiobject::get_num_point (  )  const

Returns the number of defined anchors.

Returns:
The number of defined anchors

Definition at line 651 of file gui_uiobject.cpp.

const std::string & gui::uiobject::get_object_type (  )  const

Returns the type of this widget.

Returns:
The type of this widget

Definition at line 201 of file gui_uiobject.cpp.

const std::vector< std::string > & gui::uiobject::get_object_typeList (  )  const

Returns an array containing all the types of this widget.

Returns:
An array containing all the types of this widget

Definition at line 206 of file gui_uiobject.cpp.

uiobject * gui::uiobject::get_parent (  ) 

Returns this widget's parent.

Returns:
This widget's parent

Definition at line 361 of file gui_uiobject.cpp.

const uiobject * gui::uiobject::get_parent (  )  const

Returns this widget's parent.

Returns:
This widget's parent

Definition at line 356 of file gui_uiobject.cpp.

const anchor * gui::uiobject::get_point ( anchor_point  mPoint  )  const

Returns one of this widget's anchor.

Parameters:
mPoint The anchor point
Returns:
A pointer to the anchor, nullptr if none

Definition at line 669 of file gui_uiobject.cpp.

const std::map< anchor_point, anchor > & gui::uiobject::get_point_list (  )  const

Returns all of this widgets's anchors.

Returns:
All of this widgets's anchors

Definition at line 678 of file gui_uiobject.cpp.

const std::string & gui::uiobject::get_raw_name (  )  const

Returns this widget's raw name.

Returns:
This widget's raw name
Note:
This is the name of the widget before "$parent" has been replaced by its parent's name.

Definition at line 173 of file gui_uiobject.cpp.

float gui::uiobject::get_rel_height (  )  const

Returns this widget's height (relative to its parent).

Returns:
This widget's height (relative to its parent)

Definition at line 340 of file gui_uiobject.cpp.

float gui::uiobject::get_rel_width (  )  const

Returns this widget's width (relative to its parent).

Returns:
This widget's width (relative to its parent)

Definition at line 335 of file gui_uiobject.cpp.

int gui::uiobject::get_right (  )  const

Returns the horizontal position of this widget's right border.

Returns:
The horizontal position of this widget's right border

Definition at line 386 of file gui_uiobject.cpp.

int gui::uiobject::get_top (  )  const

Returns the vertical position of this widget's top border.

Returns:
The vertical position of this widget's top border

Definition at line 392 of file gui_uiobject.cpp.

void gui::uiobject::hide (  )  [virtual]

hides this widget.

Note:
All its children won't be visible on the screen anymore, even if they are still marked as shown.

Reimplemented in gui::frame, and gui::layered_region.

Definition at line 235 of file gui_uiobject.cpp.

bool gui::uiobject::is_height_absolute (  )  const

Checks if this widget's height has been defined as absolute.

Returns:
'true' if this widget's height has been defined as absolute

Definition at line 284 of file gui_uiobject.cpp.

bool gui::uiobject::is_manually_rendered (  )  const

Checks if this object is manually rendered.

Returns:
'true' if this object is manually rendered
Note:
For more informations, see set_manually_rendered().

Definition at line 1034 of file gui_uiobject.cpp.

bool gui::uiobject::is_newly_created (  )  const

Checks if this object has been newly created.

Returns:
'true' if this object has been newly created
Note:
For more informations, see set_newly_created().

Definition at line 1044 of file gui_uiobject.cpp.

bool gui::uiobject::is_object_type ( const std::string &  sType  )  const

Checks if this widget is of the provided type.

Parameters:
sType The type to test
Returns:
'true' if this widget is of the provided type

Definition at line 211 of file gui_uiobject.cpp.

bool gui::uiobject::is_shown (  )  const

Checks if this widget is shown.

Returns:
'true' if this widget is shown

Definition at line 245 of file gui_uiobject.cpp.

bool gui::uiobject::is_special (  )  const

Checks if this object is special.

Returns:
'true' if this objet is special
Note:
For more informations, see set_special().

Definition at line 1008 of file gui_uiobject.cpp.

bool gui::uiobject::is_virtual (  )  const

Checks if this uiobject is virtual.

Returns:
'true' if this uiobject is virtual
Note:
A virtual uiobject can be inherited.

Definition at line 683 of file gui_uiobject.cpp.

bool gui::uiobject::is_visible (  )  const [virtual]

Checks if this widget can be seen on the screen.

Returns:
'true' if this widget can be seen on the screen

Reimplemented in gui::layered_region.

Definition at line 250 of file gui_uiobject.cpp.

bool gui::uiobject::is_width_absolute (  )  const

Checks if this widget's width has been defined as absolute.

Returns:
'true' if this widget's width has been defined as absolute

Definition at line 279 of file gui_uiobject.cpp.

void gui::uiobject::make_borders_ ( float &  iMin,
float &  iMax,
float  iCenter,
float  iSize 
) const [protected]

Definition at line 748 of file gui_uiobject.cpp.

void gui::uiobject::mark_for_copy ( const std::string &  sVariable  ) 

Adds a Lua variable to copy when derivating.

Parameters:
sVariable The name of the variable
Note:
The variable must be an element of the widget's Lua glue.
If you have a virtual widget called "Test", and in some lua code you do :
Test.someVariable = 2;
... then you can call this function with "someVariable".

Definition at line 1061 of file gui_uiobject.cpp.

anchor * gui::uiobject::modify_point ( anchor_point  mPoint  ) 

Returns one of this widget's anchor to modify it.

Parameters:
mPoint The anchor point
Returns:
A pointer to the anchor, nullptr if none

Definition at line 656 of file gui_uiobject.cpp.

void gui::uiobject::notify_anchored_object ( uiobject pObj,
bool  bAnchored 
) const

Notifies this widget that another one is anchored to it.

Parameters:
pObj The anchored widget
bAnchored 'true' if it is anchored, 'false' if it's no longer the case

Definition at line 706 of file gui_uiobject.cpp.

void gui::uiobject::notify_loaded (  )  [virtual]

Notifies this widget that it has been fully loaded.

Reimplemented in gui::frame.

Definition at line 1192 of file gui_uiobject.cpp.

void gui::uiobject::notify_manually_rendered_object_ ( uiobject pObject,
bool  bManuallyRendered 
) [protected, virtual]

Definition at line 1057 of file gui_uiobject.cpp.

void gui::uiobject::notify_renderer_need_redraw (  )  const [virtual]

Notifies the renderer of this widget that it needs to be redrawn.

Note:
Automatically called by any shape changing function.

Reimplemented in gui::frame, and gui::layered_region.

Definition at line 1049 of file gui_uiobject.cpp.

void gui::uiobject::parse_anchor_block_ ( xml::block *  pBlock  )  [protected, virtual]

Definition at line 39 of file gui_uiobject_parser.cpp.

virtual void gui::uiobject::parse_block ( xml::block *  pBlock  )  [pure virtual]

Parses data from an xml::block.

Parameters:
pBlock The uiobject's xml::block

Implemented in gui::button, gui::check_button, gui::edit_box, gui::focus_frame, gui::font_string, gui::frame, gui::layered_region, gui::region, gui::scroll_frame, gui::slider, gui::status_bar, and gui::texture.

void gui::uiobject::parse_size_block_ ( xml::block *  pBlock  )  [protected, virtual]

Definition at line 16 of file gui_uiobject_parser.cpp.

void gui::uiobject::push_on_lua ( lua::state *  pLua  )  const [virtual]

Pushes this uiobject on the provided lua::State.

Parameters:
pLua The lua::State on which to push the glue

Definition at line 991 of file gui_uiobject.cpp.

void gui::uiobject::read_anchors_ ( float &  iLeft,
float &  iRight,
float &  iTop,
float &  iBottom,
float &  iXCenter,
float &  iYCenter 
) const [protected]

Definition at line 780 of file gui_uiobject.cpp.

void gui::uiobject::remove_glue (  ) 

Removes the Lua glue.

Definition at line 996 of file gui_uiobject.cpp.

virtual void gui::uiobject::render (  )  [pure virtual]

Renders this widget on the current render target.

Implemented in gui::font_string, gui::frame, gui::region, and gui::texture.

std::string gui::uiobject::serialize ( const std::string &  sTab  )  const [virtual]

Prints all relevant information about this widget in a string.

Parameters:
sTab The offset to give to all lines
Returns:
All relevant information about this widget

Reimplemented in gui::button, gui::check_button, gui::font_string, gui::frame, gui::layered_region, gui::slider, gui::status_bar, and gui::texture.

Definition at line 43 of file gui_uiobject.cpp.

void gui::uiobject::set_abs_height ( uint  uiAbsHeight  )  [virtual]

Changes this widget's absolute height (in pixels).

Parameters:
uiAbsHeight The new height

Reimplemented in gui::frame.

Definition at line 267 of file gui_uiobject.cpp.

void gui::uiobject::set_abs_point ( anchor_point  mPoint,
const std::string &  sParentName,
anchor_point  mRelativePoint,
int  iX = 0,
int  iY = 0 
)

create_s/modifies an anchor.

Parameters:
mPoint The anchor point for this object
sParentName The anchor's parent
mRelativePoint The anchor point for the parent
iX The horizontal offset
iY The vertical offset

Definition at line 477 of file gui_uiobject.cpp.

void gui::uiobject::set_abs_width ( uint  uiAbsWidth  )  [virtual]

Changes this widget's absolute width (in pixels).

Parameters:
uiAbsWidth The new width

Reimplemented in gui::frame.

Definition at line 255 of file gui_uiobject.cpp.

void gui::uiobject::set_all_points ( const std::string &  sObjName  ) 

Adjusts this widgets anchors to fit the provided widget.

Parameters:
sObjName The name of the object to fit to
Note:
Removes all anchors and defines two new ones.
This version is to be used by virtual widgets to preserve the anchor hierarchy.

Definition at line 427 of file gui_uiobject.cpp.

void gui::uiobject::set_all_points ( uiobject pObj  ) 

Adjusts this widgets anchors to fit the provided widget.

Parameters:
pObj A pointer to the object you want to wrap
Note:
Removes all anchors and defines two new ones.

Definition at line 452 of file gui_uiobject.cpp.

void gui::uiobject::set_alpha ( float  fAlpha  ) 

Changes this widget's alpha (opacity).

Parameters:
fAlpha The new alpha value
Note:
Default is 1.0f.

Definition at line 221 of file gui_uiobject.cpp.

void gui::uiobject::set_id ( uint  uiID  ) 

Sets this widget's unique ID.

Parameters:
uiID The ID
Note:
Can only be called once.

Definition at line 698 of file gui_uiobject.cpp.

void gui::uiobject::set_manually_rendered ( bool  bManuallyRendered,
uiobject pRenderer = nullptr 
) [virtual]

Flags this object as "manually rendered".

Parameters:
bManuallyRendered 'true' to flag it as manually rendered
pRenderer The uiobject that will take care of rendering this widget
Note:
Manually rendered objects are not automatically rendered by their parent (for layered_regions) or the manager (for frames). They also don't receive input automatically.

Definition at line 1013 of file gui_uiobject.cpp.

void gui::uiobject::set_name ( const std::string &  sName  ) 

Sets this widget's name.

Parameters:
sName This widget's name
Note:
Can only be called once.

Definition at line 178 of file gui_uiobject.cpp.

void gui::uiobject::set_newly_created (  ) 

Flags this object as newly created.

Note:
Newly created objects aren't rendered. They unflag themselves after the first update() call.
This function is only called on objects created in Lua.

Definition at line 1039 of file gui_uiobject.cpp.

void gui::uiobject::set_parent ( uiobject pParent  )  [virtual]

Changes this widget's parent.

Parameters:
pParent The new parent
Note:
Default is nullptr.

Definition at line 345 of file gui_uiobject.cpp.

void gui::uiobject::set_point ( const anchor mAnchor  ) 

Adds/replaces an anchor.

Parameters:
mAnchor The anchor to add

Definition at line 589 of file gui_uiobject.cpp.

void gui::uiobject::set_rel_height ( float  fRelHeight  ) 

Changes this widget's height (relative to its parent).

Parameters:
fRelHeight The new height
Note:
Height will automatically be adjusted to include all of this widget's children.

Definition at line 301 of file gui_uiobject.cpp.

void gui::uiobject::set_rel_point ( anchor_point  mPoint,
const std::string &  sParentName,
anchor_point  mRelativePoint,
float  fX = 0,
float  fY = 0 
)

create_s/modifies an anchor.

Parameters:
mPoint The anchor point for this object
sParentName The anchor's parent
mRelativePoint The anchor point for the parent
fX The horizontal offset
fY The vertical offset

Definition at line 533 of file gui_uiobject.cpp.

void gui::uiobject::set_rel_width ( float  fRelWidth  ) 

Changes this widget's width (relative to its parent).

Parameters:
fRelWidth The new width
Note:
Width will automatically be adjusted to include all of this widget's children.

Definition at line 289 of file gui_uiobject.cpp.

void gui::uiobject::set_shown ( bool  bIsShown  )  [virtual]

shows/hides this widget.

Parameters:
bIsShown 'true' if you want to show this widget
Note:
See show() and hide() for more infos.
Contrary to show() and hide(), this function doesn't trigger any event ("OnShow" or "OnHide"). It should only be used to set the initial state of the widget.

Reimplemented in gui::frame.

Definition at line 240 of file gui_uiobject.cpp.

void gui::uiobject::set_special (  ) 

Flags this object as "special".

Note:
Special objects are not automatically copied in the frame inheritance process. They must be explicitely copied by the derived class (example : Button will have to copy its button textures itself).

Definition at line 1003 of file gui_uiobject.cpp.

void gui::uiobject::set_virtual (  ) 

Makes this uiobject virtual.

Note:
See is_virtual().

Definition at line 688 of file gui_uiobject.cpp.

void gui::uiobject::show (  )  [virtual]

shows this widget.

Note:
Its parent must be shown for it to appear on the screen.

Reimplemented in gui::frame, and gui::layered_region.

Definition at line 230 of file gui_uiobject.cpp.

void gui::uiobject::update ( float  fDelta  )  [virtual]

updates this widget's logic.

Reimplemented in gui::edit_box, gui::font_string, gui::frame, gui::scroll_frame, gui::slider, and gui::status_bar.

Definition at line 975 of file gui_uiobject.cpp.

void gui::uiobject::update_anchors (  )  [virtual]

updates this widget's anchors.

Note:
Must be called on *all* widgets before update().

Definition at line 907 of file gui_uiobject.cpp.

void gui::uiobject::update_borders_ (  )  const [protected, virtual]

Reimplemented in gui::frame.

Definition at line 838 of file gui_uiobject.cpp.

void gui::uiobject::update_dimensions_ (  )  const [protected, virtual]

Definition at line 720 of file gui_uiobject.cpp.


Member Data Documentation

bool gui::uiobject::bInherits_ [protected]

Definition at line 524 of file gui_uiobject.hpp.

bool gui::uiobject::bIsHeightAbs_ [mutable, protected]

Definition at line 545 of file gui_uiobject.hpp.

bool gui::uiobject::bIsShown_ [protected]

Definition at line 541 of file gui_uiobject.hpp.

bool gui::uiobject::bIsVisible_ [protected]

Definition at line 542 of file gui_uiobject.hpp.

bool gui::uiobject::bIsWidthAbs_ [mutable, protected]

Definition at line 544 of file gui_uiobject.hpp.

bool gui::uiobject::bLoaded_ [protected]

Definition at line 527 of file gui_uiobject.hpp.

Definition at line 521 of file gui_uiobject.hpp.

Definition at line 522 of file gui_uiobject.hpp.

bool gui::uiobject::bReady_ [mutable, protected]

Definition at line 528 of file gui_uiobject.hpp.

bool gui::uiobject::bSpecial_ [protected]

Definition at line 520 of file gui_uiobject.hpp.

bool gui::uiobject::bUpdateAnchors_ [mutable, protected]

Definition at line 551 of file gui_uiobject.hpp.

bool gui::uiobject::bUpdateBorders_ [mutable, protected]

Definition at line 552 of file gui_uiobject.hpp.

bool gui::uiobject::bUpdateDimensions_ [mutable, protected]

Definition at line 553 of file gui_uiobject.hpp.

bool gui::uiobject::bVirtual_ [protected]

Definition at line 526 of file gui_uiobject.hpp.

float gui::uiobject::fAlpha_ [protected]

Definition at line 540 of file gui_uiobject.hpp.

float gui::uiobject::fRelHeight_ [mutable, protected]

Definition at line 549 of file gui_uiobject.hpp.

float gui::uiobject::fRelWidth_ [mutable, protected]

Definition at line 548 of file gui_uiobject.hpp.

std::map<uint, uiobject*> gui::uiobject::lAnchoredObjectList_ [mutable, protected]

Definition at line 555 of file gui_uiobject.hpp.

Definition at line 535 of file gui_uiobject.hpp.

std::array<int, 4> gui::uiobject::lBorderList_ [mutable, protected]

Definition at line 538 of file gui_uiobject.hpp.

std::vector<std::string> gui::uiobject::lCopyList_ [protected]

Definition at line 531 of file gui_uiobject.hpp.

std::array<bool, 4> gui::uiobject::lDefinedBorderList_ [protected]

Definition at line 537 of file gui_uiobject.hpp.

std::vector<lua_glue*> gui::uiobject::lGlueList_ [protected]

Definition at line 530 of file gui_uiobject.hpp.

std::vector<const uiobject*> gui::uiobject::lPreviousAnchorParentList_ [protected]

Definition at line 536 of file gui_uiobject.hpp.

std::vector<std::string> gui::uiobject::lType_ [protected]

Definition at line 533 of file gui_uiobject.hpp.

Definition at line 519 of file gui_uiobject.hpp.

Definition at line 512 of file gui_uiobject.hpp.

Definition at line 518 of file gui_uiobject.hpp.

Definition at line 523 of file gui_uiobject.hpp.

std::string gui::uiobject::sLuaName_ [protected]

Definition at line 516 of file gui_uiobject.hpp.

std::string gui::uiobject::sName_ [protected]

Definition at line 514 of file gui_uiobject.hpp.

std::string gui::uiobject::sRawName_ [protected]

Definition at line 515 of file gui_uiobject.hpp.

uint gui::uiobject::uiAbsHeight_ [mutable, protected]

Definition at line 547 of file gui_uiobject.hpp.

uint gui::uiobject::uiAbsWidth_ [mutable, protected]

Definition at line 546 of file gui_uiobject.hpp.

uint gui::uiobject::uiID_ [protected]

Definition at line 517 of file gui_uiobject.hpp.


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

Generated on Tue Jan 1 21:58:12 2013 for gui by  doxygen 1.6.1