# CEGUI::WidgetDim Class Reference

Dimension type that represents some dimension of a Window/widget. Implements BaseDim interface. More...

Inheritance diagram for CEGUI::WidgetDim:

[legend]
Collaboration diagram for CEGUI::WidgetDim:

[legend]
List of all members.

## Public Member Functions

| WidgetDim (const String &name, DimensionType dim)
| Constructor.
void | setWidgetName (const String &name)
| Set the name suffix to use for this WidgetDim.
void | setSourceDimension (DimensionType dim)
| Sets the source dimension type for this WidgetDim.

## Protected Member Functions

float | getValue_impl (const Window &wnd) const
| Implementataion method to return the base value for this BaseDim. This method should not attempt to apply the mathematical operator; this is handled automatically.
float | getValue_impl (const Window &wnd, const Rect &container) const
| Implementataion method to return the base value for this BaseDim. This method should not attempt to apply the mathematical operator; this is handled automatically by BaseDim.
void | writeXMLElementName_impl (OutStream &out_stream) const
| Implementataion method to output real xml element name to an OutStream. This method should not write the element opening '<' character, nor close the element, it must write just the element name itself.
void | writeXMLElementAttributes_impl (OutStream &out_stream) const
| Implementataion method to output xml element attributes to an OutStream. This method should not write the element opening '<' character, nor close the element, it must write just the element attributes.
BaseDim * | clone_impl () const
| Implementataion method to return a clone of this sub-class of BaseDim. This method should not attempt to clone the mathematical operator or operand; theis is handled automatically by BaseDim.

## Detailed Description

Dimension type that represents some dimension of a Window/widget. Implements BaseDim interface.

When calculating the final pixel value for the dimension, a target widget name is built by appending the name suffix specified for the WidgetDim to the name of the window passed to getValue, we then find the window/widget with that name - the final value of the dimension is taken from this window/widget.

## Constructor & Destructor Documentation

CEGUI::WidgetDim::WidgetDim | ( | const String & | name,
|  | DimensionType | dim
| ) |

Constructor.

Parameters:

  | name | String object holding the name suffix for a window/widget.
  | dim | DimensionType value indicating which dimension of the described image that this ImageDim is to represent.

## Member Function Documentation

void CEGUI::WidgetDim::setSourceDimension | ( | DimensionType | dim | ) |

Sets the source dimension type for this WidgetDim.

Parameters:

  | dim | DimensionType value indicating which dimension of the described image that this WidgetDim is to represent.

Returns:
  Nothing.

void CEGUI::WidgetDim::setWidgetName | ( | const String & | name | ) |

Set the name suffix to use for this WidgetDim.

Parameters:

  | name | String object holding the name suffix for a window/widget.

Returns:
  Nothing.