Crazy Eddie's GUI System
0.8.4
|
Dimension type that represents some metric of a Font. Implements BaseDim interface. More...
Public Member Functions | |
FontDim (const String &name, const String &font, const String &text, FontMetricType metric, float padding=0) | |
Constructor. | |
const String & | getName () const |
Get the current name of the FontDim. | |
void | setName (const String &name) |
Set the current name of the FontDim. | |
const String & | getFont () const |
Get the current font of the FontDim. | |
void | setFont (const String &font) |
Set the current font of the FontDim. | |
const String & | getText () 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. | |
float | getValue (const Window &wnd, const Rectf &container) const |
Return a value that represents this dimension as absolute pixels. | |
BaseDim * | clone () const |
Create an exact copy of the specialised object and return it as a pointer to a BaseDim object. | |
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 Font * | getFontObject (const Window &window) const |
CEGUI::FontDim::FontDim | ( | const String & | name, |
const String & | font, | ||
const String & | text, | ||
FontMetricType | metric, | ||
float | padding = 0 |
||
) |
Constructor.
name | String 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. |
font | String 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. |
text | String holding the text to be measured for horizontal extent. If this is empty, the text from the window passed to getValue will be used. |
metric | One of the FontMetricType values indicating what we should represent. |
padding | constant pixel padding value to be added. |
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.
wnd | Window object that may be used by the specialised class to aid in calculating the final value. |
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.
wnd | Window 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). |
container | Rect 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. |
Implements CEGUI::BaseDim.