gui::anchor Class Reference

Stores a position for a UI widget. More...

#include <gui_anchor.hpp>

List of all members.

Public Member Functions

 anchor ()
 Default constructor.
 anchor (uiobject *pObj, anchor_point mPoint, const std::string &pParent, anchor_point mParentPoint)
 Constructor.
int get_abs_x () const
 Returns this anchor absolute X (in pixel).
int get_abs_y () const
 Returns this anchor absolute Y (in pixel).
const uiobjectget_object () const
 Returns this anchor's base widget.
const uiobjectget_parent () const
 Returns this anchor's parent widget.
const std::string & get_parent_raw_name () const
 Returns this anchor's parent's raw name (unmodified).
anchor_point get_point () const
 Returns this anchor's point.
anchor_point get_parent_point () const
 Returns this anchor's parent point.
anchor_type get_type () const
 Returns the type of this anchor (abs or rel).
int get_abs_offset_x () const
 Returns this anchor's absolute horizontal offset.
int get_abs_offset_y () const
 Returns this anchor's absolute vertical offset.
float get_rel_offset_x () const
 Returns this anchor's relative horizontal offset.
float get_rel_offset_y () const
 Returns this anchor's relative vertical offset.
void set_object (uiobject *pObj)
 Sets this anchor's base widget.
void set_parent_raw_name (const std::string &sName)
 Sets this anchor's parent's raw name.
void set_point (anchor_point mPoint)
 Sets this anchor's point.
void set_parent_point (anchor_point mParentPoint)
 Sets this anchor's parent point.
void set_abs_offset (int iX, int iY)
 Sets this anchor's absolute offset.
void set_rel_offset (float fX, float fY)
 Sets this anchor's relative offset.
std::string serialize (const std::string &sTab) const
 Prints all relevant information about this anchor in a string.
void update_parent () const
 get_s the anchor parent from the parent string.

Static Public Member Functions

static std::string get_string_point (anchor_point mPoint)
 Returns the name of an anchor point.
static anchor_point get_anchor_point (const std::string &sPoint)
 Returns the anchor point from its name.

Detailed Description

Stores a position for a UI widget.

Definition at line 38 of file gui_anchor.hpp.


Constructor & Destructor Documentation

gui::anchor::anchor (  ) 

Default constructor.

Definition at line 12 of file gui_anchor.cpp.

gui::anchor::anchor ( uiobject pObj,
anchor_point  mPoint,
const std::string &  pParent,
anchor_point  mParentPoint 
)

Constructor.

Definition at line 19 of file gui_anchor.cpp.


Member Function Documentation

int gui::anchor::get_abs_offset_x (  )  const

Returns this anchor's absolute horizontal offset.

Returns:
This anchor's absolute horizontal offset

Definition at line 170 of file gui_anchor.cpp.

int gui::anchor::get_abs_offset_y (  )  const

Returns this anchor's absolute vertical offset.

Returns:
This anchor's absolute vertical offset

Definition at line 175 of file gui_anchor.cpp.

int gui::anchor::get_abs_x (  )  const

Returns this anchor absolute X (in pixel).

Returns:
This anchor absolute X.

Definition at line 61 of file gui_anchor.cpp.

int gui::anchor::get_abs_y (  )  const

Returns this anchor absolute Y (in pixel).

Returns:
This anchor absolute Y.

Definition at line 100 of file gui_anchor.cpp.

anchor_point gui::anchor::get_anchor_point ( const std::string &  sPoint  )  [static]

Returns the anchor point from its name.

Parameters:
sPoint The name of the anchor point

Definition at line 270 of file gui_anchor.cpp.

const uiobject * gui::anchor::get_object (  )  const

Returns this anchor's base widget.

Returns:
This anchor's base widget

Definition at line 139 of file gui_anchor.cpp.

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

Returns this anchor's parent widget.

Returns:
This anchor's parent widget

Definition at line 144 of file gui_anchor.cpp.

anchor_point gui::anchor::get_parent_point (  )  const

Returns this anchor's parent point.

Returns:
This anchor's parent point

Definition at line 160 of file gui_anchor.cpp.

const std::string & gui::anchor::get_parent_raw_name (  )  const

Returns this anchor's parent's raw name (unmodified).

Returns:
This anchor's parent's raw name (unmodified)

Definition at line 150 of file gui_anchor.cpp.

anchor_point gui::anchor::get_point (  )  const

Returns this anchor's point.

Returns:
This anchor's point

Definition at line 155 of file gui_anchor.cpp.

float gui::anchor::get_rel_offset_x (  )  const

Returns this anchor's relative horizontal offset.

Returns:
This anchor's relative horizontal offset

Definition at line 180 of file gui_anchor.cpp.

float gui::anchor::get_rel_offset_y (  )  const

Returns this anchor's relative vertical offset.

Returns:
This anchor's relative vertical offset

Definition at line 185 of file gui_anchor.cpp.

std::string gui::anchor::get_string_point ( anchor_point  mPoint  )  [static]

Returns the name of an anchor point.

Parameters:
mPoint The anchor point

Definition at line 253 of file gui_anchor.cpp.

anchor_type gui::anchor::get_type (  )  const

Returns the type of this anchor (abs or rel).

Returns:
The type of this anchor (abs or rel)

Definition at line 165 of file gui_anchor.cpp.

std::string gui::anchor::serialize ( const std::string &  sTab  )  const

Prints all relevant information about this anchor in a string.

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

Definition at line 225 of file gui_anchor.cpp.

void gui::anchor::set_abs_offset ( int  iX,
int  iY 
)

Sets this anchor's absolute offset.

Parameters:
iX The new horizontal offset
iY The new vertical offset

Definition at line 211 of file gui_anchor.cpp.

void gui::anchor::set_object ( uiobject pObj  ) 

Sets this anchor's base widget.

Parameters:
pObj The new base widget

Definition at line 190 of file gui_anchor.cpp.

void gui::anchor::set_parent_point ( anchor_point  mParentPoint  ) 

Sets this anchor's parent point.

Parameters:
mParentPoint The new parent point

Definition at line 206 of file gui_anchor.cpp.

void gui::anchor::set_parent_raw_name ( const std::string &  sName  ) 

Sets this anchor's parent's raw name.

Parameters:
sName The parent's raw name

Definition at line 195 of file gui_anchor.cpp.

void gui::anchor::set_point ( anchor_point  mPoint  ) 

Sets this anchor's point.

Parameters:
mPoint The new point

Definition at line 201 of file gui_anchor.cpp.

void gui::anchor::set_rel_offset ( float  fX,
float  fY 
)

Sets this anchor's relative offset.

Parameters:
fX The new horizontal offset
fY The new vertical offset

Definition at line 218 of file gui_anchor.cpp.

void gui::anchor::update_parent (  )  const

get_s the anchor parent from the parent string.

Definition at line 27 of file gui_anchor.cpp.


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