Crazy Eddie's GUI System  0.8.4
CEGUI::PropertyDim Class Reference

Dimension type that represents the value of a Window property. Implements BaseDim interface. More...

+ Inheritance diagram for CEGUI::PropertyDim:
+ Collaboration diagram for CEGUI::PropertyDim:

List of all members.

Public Member Functions

 PropertyDim (const String &name, const String &property, DimensionType type)
 Constructor.
const StringgetWidgetName () const
 Get the name suffix to use for this WidgetDim.
void setWidgetName (const String &name)
 Set the name suffix to use for this WidgetDim.
const StringgetPropertyName () const
 Get the name of the property to use for this WidgetDim.
void setPropertyName (const String &property)
 Set the name of the property to use for this WidgetDim.
DimensionType getSourceDimension () const
 Gets the source dimension type for this WidgetDim.
void setSourceDimension (DimensionType dim)
 Sets the source dimension type for this WidgetDim.
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.
BaseDimclone () 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.

Detailed Description

Dimension type that represents the value of a Window property. Implements BaseDim interface.


Constructor & Destructor Documentation

CEGUI::PropertyDim::PropertyDim ( const String name,
const String property,
DimensionType  type 
)

Constructor.

Parameters:
nameString holding the name suffix of the window on which the property is to be accessed.
propertyString object holding the name of the property this PropertyDim represents the value of. The property named should represent either a UDim value or a simple float value - dependning upon what type is specified as.
typeDimensionType value indicating what dimension named property represents. The possible DimensionType values are as follows:
  • DT_INVALID the property should represent a simple float value.
  • DT_WIDTH the property should represent a UDim value where the scale is relative to the targetted Window's width.
  • DT_HEIGHT the property should represent a UDim value where the scale is relative to the targetted Window's height.
  • All other values will cause an InvalidRequestException exception to be thrown.

Member Function Documentation

BaseDim* CEGUI::PropertyDim::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.

Get the name of the property to use for this WidgetDim.

Returns:
String object holding the name of the property.

Gets the source dimension type for this WidgetDim.

Returns:
DimensionType value indicating which dimension of the target window to use as the reference / base value when accessing a property that represents a unified dimension:
  • DT_INVALID if the property does not represent a unified dim.
  • DT_WIDTH to use target width as reference value.
  • DT_HEIGHT to use target hight as reference value.
float CEGUI::PropertyDim::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::PropertyDim::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.

Get the name suffix to use for this WidgetDim.

Returns:
String object holding the name suffix for a window/widget.
void CEGUI::PropertyDim::setPropertyName ( const String property)

Set the name of the property to use for this WidgetDim.

Parameters:
propertyString object holding the name of the property.
Returns:
Nothing.

Sets the source dimension type for this WidgetDim.

Parameters:
dimDimensionType value indicating which dimension of the target window to use as the reference / base value when accessing a property that represents a unified dimension:
  • DT_INVALID if the property does not represent a unified dim.
  • DT_WIDTH to use target width as reference value.
  • DT_HEIGHT to use target hight as reference value.
void CEGUI::PropertyDim::setWidgetName ( const String name)

Set the name suffix to use for this WidgetDim.

Parameters:
nameString object holding the name suffix for a window/widget.
Returns:
Nothing.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends