gui::status_bar Class Reference

A variable length bar. More...

#include <gui_statusbar.hpp>

Inheritance diagram for gui::status_bar:
gui::frame gui::event_receiver gui::region gui::uiobject

List of all members.

Public Types

enum  orientation { ORIENT_HORIZONTAL, ORIENT_VERTICAL }

Public Member Functions

 status_bar (manager *pManager)
 Constructor.
virtual ~status_bar ()
 Destructor.
virtual std::string serialize (const std::string &sTab) const
 Prints all relevant information about this widget in a string.
virtual bool can_use_script (const std::string &sScriptName) const
 Returns 'true' if this status_bar can use a script.
virtual void copy_from (uiobject *pObj)
 Copies an uiobject's parameters into this status_bar (inheritance).
void set_min_value (float fMin)
 Sets this status_bar's minimum value.
void set_max_value (float fMax)
 Sets this status_bar's maximum value.
void set_min_max_values (float fMin, float fMax)
 Sets this status_bar's value range.
void set_value (float fValue)
 Sets this status_bar's value.
void set_bar_draw_layer (layer_type mBarLayer)
 Sets the draw layer of this status_bar's bar texture.
void set_bar_draw_layer (const std::string &sBarLayer)
 Sets the draw layer of this status_bar's bar texture.
void set_bar_texture (texture *pBarTexture)
 Sets this status_bar's bar texture.
void set_bar_color (const color &mBarColor)
 Sets this status_bar's bar color.
void set_orientation (orientation mOrient)
 Sets this status_bar's orientation.
void set_reversed (bool bReversed)
 Reverses this status_bar.
float get_min_value () const
 Returns this status_bar's minimum value.
float get_max_value () const
 Returns this status_bar's maximum value.
float get_value () const
 Returns this status_bar's value.
layer_type get_bar_draw_layer () const
 Returns the draw layer of status_bar's bar texture.
textureget_bar_texture () const
 Returns this status_bar's bar texture.
const colorget_bar_color () const
 Returns this status_bar's bar color.
orientation get_orientation () const
 Returns this status_bar's orientation.
bool is_reversed () const
 Checks if this status_bar is reversed.
virtual void create_glue ()
 Returns this widget's Lua glue.
virtual void parse_block (xml::block *pBlock)
 Parses data from an xml::block.
virtual void update (float fDelta)
 updates this widget's logic.

Static Public Member Functions

static void register_glue (utils::wptr< lua::state > pLua)
 Registers this widget to the provided lua::state.

Protected Member Functions

texturecreate_bar_texture_ ()
void fire_update_bar_texture_ ()

Protected Attributes

bool bUpdateBarTexture_
orientation mOrientation_
bool bReversed_
float fValue_
float fMinValue_
float fMaxValue_
color mBarColor_
layer_type mBarLayer_
texturepBarTexture_
std::array< float, 4 > lInitialTextCoords_

Detailed Description

A variable length bar.

This is a very simple widget : you give it three values : a minimum and a maximum, and a value between those two. It then Renders a bar that will be full, empty, or anything in between depending on the value.
Can be used to display health or cast bars.

Definition at line 20 of file gui_statusbar.hpp.


Member Enumeration Documentation

Enumerator:
ORIENT_HORIZONTAL 
ORIENT_VERTICAL 

Definition at line 24 of file gui_statusbar.hpp.


Constructor & Destructor Documentation

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

Constructor.

Definition at line 15 of file gui_statusbar.cpp.

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

Destructor.


Member Function Documentation

virtual bool gui::status_bar::can_use_script ( const std::string &  sScriptName  )  const [virtual]

Returns 'true' if this status_bar can use a script.

Parameters:
sScriptName The name of the script
Note:
This method can be overriden if needed.

Reimplemented from gui::frame.

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

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

Parameters:
pObj The uiobject to copy

Reimplemented from gui::frame.

texture* gui::status_bar::create_bar_texture_ (  )  [protected]
virtual void gui::status_bar::create_glue (  )  [virtual]

Returns this widget's Lua glue.

Reimplemented from gui::frame.

void gui::status_bar::fire_update_bar_texture_ (  )  [protected]
const color& gui::status_bar::get_bar_color (  )  const

Returns this status_bar's bar color.

Returns:
This status_bar's bar color
layer_type gui::status_bar::get_bar_draw_layer (  )  const

Returns the draw layer of status_bar's bar texture.

Returns:
The draw layer of status_bar's bar texture
texture* gui::status_bar::get_bar_texture (  )  const

Returns this status_bar's bar texture.

Returns:
This status_bar's bar texture
float gui::status_bar::get_max_value (  )  const

Returns this status_bar's maximum value.

Returns:
This status_bar's maximum value
float gui::status_bar::get_min_value (  )  const

Returns this status_bar's minimum value.

Returns:
This status_bar's minimum value
orientation gui::status_bar::get_orientation (  )  const

Returns this status_bar's orientation.

Returns:
This status_bar's orientation
float gui::status_bar::get_value (  )  const

Returns this status_bar's value.

Returns:
This status_bar's value
bool gui::status_bar::is_reversed (  )  const

Checks if this status_bar is reversed.

Returns:
'true' if it is the case
void gui::status_bar::parse_block ( xml::block *  pBlock  )  [virtual]

Parses data from an xml::block.

Parameters:
pBlock The status_bar's xml::block

Reimplemented from gui::frame.

Definition at line 10 of file gui_statusbar_parser.cpp.

void gui::status_bar::register_glue ( utils::wptr< lua::state >  pLua  )  [static]

Registers this widget to the provided lua::state.

Definition at line 9 of file gui_statusbar_glues.cpp.

virtual std::string gui::status_bar::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 from gui::frame.

void gui::status_bar::set_bar_color ( const color mBarColor  ) 

Sets this status_bar's bar color.

Parameters:
mBarColor The bar color
void gui::status_bar::set_bar_draw_layer ( const std::string &  sBarLayer  ) 

Sets the draw layer of this status_bar's bar texture.

Parameters:
sBarLayer The layer
void gui::status_bar::set_bar_draw_layer ( layer_type  mBarLayer  ) 

Sets the draw layer of this status_bar's bar texture.

Parameters:
mBarLayer The layer
void gui::status_bar::set_bar_texture ( texture pBarTexture  ) 

Sets this status_bar's bar texture.

Parameters:
pBarTexture The bar texture
void gui::status_bar::set_max_value ( float  fMax  ) 

Sets this status_bar's maximum value.

Parameters:
fMax The maximum value
void gui::status_bar::set_min_max_values ( float  fMin,
float  fMax 
)

Sets this status_bar's value range.

Parameters:
fMin The minimum value
fMax The maximum value
void gui::status_bar::set_min_value ( float  fMin  ) 

Sets this status_bar's minimum value.

Parameters:
fMin The minimum value
void gui::status_bar::set_orientation ( orientation  mOrient  ) 

Sets this status_bar's orientation.

Parameters:
mOrient The orientation
void gui::status_bar::set_reversed ( bool  bReversed  ) 

Reverses this status_bar.

Parameters:
bReversed 'true' to reverse it
Note:
By default, if the status bar is oriented horizontally (vertically), if will grow from left to right (bottom to top). You can use this function to reverse the growth, that is make it grow from right to left.
void gui::status_bar::set_value ( float  fValue  ) 

Sets this status_bar's value.

Parameters:
fValue The value
virtual void gui::status_bar::update ( float  fDelta  )  [virtual]

updates this widget's logic.

Reimplemented from gui::frame.


Member Data Documentation

bool gui::status_bar::bReversed_ [protected]

Definition at line 170 of file gui_statusbar.hpp.

Definition at line 167 of file gui_statusbar.hpp.

float gui::status_bar::fMaxValue_ [protected]

Definition at line 174 of file gui_statusbar.hpp.

float gui::status_bar::fMinValue_ [protected]

Definition at line 173 of file gui_statusbar.hpp.

float gui::status_bar::fValue_ [protected]

Definition at line 172 of file gui_statusbar.hpp.

std::array<float,4> gui::status_bar::lInitialTextCoords_ [protected]

Definition at line 179 of file gui_statusbar.hpp.

Definition at line 176 of file gui_statusbar.hpp.

Definition at line 177 of file gui_statusbar.hpp.

Definition at line 169 of file gui_statusbar.hpp.

Definition at line 178 of file gui_statusbar.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