Crazy Eddie's GUI System  0.8.7
CEGUI::FontDim Class Reference

Dimension type that represents some metric of a Font. Implements BaseDim interface. More...

+ Inheritance diagram for CEGUI::FontDim:
+ Collaboration diagram for CEGUI::FontDim:

Public Member Functions

 FontDim (const String &name, const String &font, const String &text, FontMetricType metric, float padding=0)
 Constructor. More...
 
const StringgetName () const
 Get the current name of the FontDim.
 
void setName (const String &name)
 Set the current name of the FontDim.
 
const StringgetFont () const
 Get the current font of the FontDim.
 
void setFont (const String &font)
 Set the current font of the FontDim.
 
const StringgetText () const
 Get the current text of the FontDim.
 
void setText (const String &text)
 Set the current text of the FontDim.
 
FontMetricType getMetric () const
 Get the current metric of the FontDim.
 
void setMetric (FontMetricType metric)
 Set the current metric of the FontDim.
 
float getPadding () const
 Get the current padding of the FontDim.
 
void setPadding (float padding)
 Set the current padding of the FontDim.
 
bool handleFontRenderSizeChange (Window &window, const Font *font) const
 perform any processing required due to the given font having changed.
 
float getValue (const Window &wnd) const
 Return a value that represents this dimension as absolute pixels. More...
 
float getValue (const Window &wnd, const Rectf &container) const
 Return a value that represents this dimension as absolute pixels. More...
 
BaseDimclone () const
 Create an exact copy of the specialised object and return it as a pointer to a BaseDim object. More...
 
- Public Member Functions inherited from CEGUI::BaseDim
virtual void writeXMLToStream (XMLSerializer &xml_stream) const
 Writes an xml representation of this BaseDim to out_stream. More...
 

Protected Member Functions

void writeXMLElementName_impl (XMLSerializer &xml_stream) const
 Implementataion method to output real xml element name.
 
void writeXMLElementAttributes_impl (XMLSerializer &xml_stream) const
 Implementataion method to create the element attributes.
 
const FontgetFontObject (const Window &window) const
 

Detailed Description

Dimension type that represents some metric of a Font. Implements BaseDim interface.

Constructor & Destructor Documentation

CEGUI::FontDim::FontDim ( const String name,
const String font,
const String text,
FontMetricType  metric,
float  padding = 0 
)

Constructor.

Parameters
nameString holding the name suffix of the window to be accessed to obtain the font and / or text strings to be used when these items are not explicitly given.
fontString holding the name of the font to use for this dimension. If the string is empty, the font assigned to the window passed to getValue will be used.
textString holding the text to be measured for horizontal extent. If this is empty, the text from the window passed to getValue will be used.
metricOne of the FontMetricType values indicating what we should represent.
paddingconstant pixel padding value to be added.

Member Function Documentation

BaseDim* CEGUI::FontDim::clone ( ) const
virtual

Create an exact copy of the specialised object and return it as a pointer to a BaseDim object.

Since the system needs to be able to copy objects derived from BaseDim, but only has knowledge of the BaseDim interface, this clone method is provided to prevent slicing issues.

Implements CEGUI::BaseDim.

float CEGUI::FontDim::getValue ( const Window wnd) const
virtual

Return a value that represents this dimension as absolute pixels.

Parameters
wndWindow object that may be used by the specialised class to aid in calculating the final value.
Returns
float value which represents, in pixels, the same value as this BaseDim.

Implements CEGUI::BaseDim.

float CEGUI::FontDim::getValue ( const Window wnd,
const Rectf container 
) const
virtual

Return a value that represents this dimension as absolute pixels.

Parameters
wndWindow object that may be used by the specialised class to aid in calculating the final value (typically would be used to obtain window/widget dimensions).
containerRect object which describes an area to be considered as the base area when calculating the final value. Basically this means that relative values are calculated from the dimensions of this Rect.
Returns
float value which represents, in pixels, the same value as this BaseDim.

Implements CEGUI::BaseDim.