Crazy Eddies GUI System  0.7.9
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
CEGUI::PropertyLinkDefinition Class Reference

Class representing a property that links to another property defined on an attached child widget. More...

+ Inheritance diagram for CEGUI::PropertyLinkDefinition:
+ Collaboration diagram for CEGUI::PropertyLinkDefinition:

Classes

struct  LinkTarget
 Internal struct used to keep track of targets. More...
 

Public Member Functions

 PropertyLinkDefinition (const String &propertyName, const String &widgetNameSuffix, const String &targetProperty, const String &initialValue, bool redrawOnWrite, bool layoutOnWrite)
 
void addLinkTarget (const String &widget, const String &property)
 add a new link target to property on widget (name suffix).
 
void clearLinkTargets ()
 clear all link targets from this link definition.
 
String get (const PropertyReceiver *receiver) const
 Return the current value of the Property as a String. More...
 
void set (PropertyReceiver *receiver, const String &value)
 Sets the value of the property. More...
 
void initialisePropertyReceiver (PropertyReceiver *receiver) const
 function to allow initialisation of a PropertyReceiver.
 
- Public Member Functions inherited from CEGUI::PropertyDefinitionBase
 PropertyDefinitionBase (const String &name, const String &help, const String &initialValue, bool redrawOnWrite, bool layoutOnWrite)
 
virtual void writeXMLToStream (XMLSerializer &xml_stream) const
 Writes an xml representation of the PropertyDefinitionBase based object to out_stream. More...
 
- Public Member Functions inherited from CEGUI::Property
 Property (const String &name, const String &help, const String &defaultValue="", bool writesXML=true)
 Creates a new Property object. More...
 
virtual ~Property (void)
 Destructor for Property objects.
 
const StringgetHelp (void) const
 Return a String that describes the purpose and usage of this Property. More...
 
const StringgetName (void) const
 Return a the name of this Property. More...
 
virtual bool isDefault (const PropertyReceiver *receiver) const
 Returns whether the property is at it's default value. More...
 
virtual String getDefault (const PropertyReceiver *receiver) const
 Returns the default value of the Property as a String. More...
 
virtual void writeXMLToStream (const PropertyReceiver *receiver, XMLSerializer &xml_stream) const
 Writes out an XML representation of this class to the given stream. More...
 

Protected Types

typedef std::vector< LinkTargetLinkTargetCollection
 type used for the collection of targets.
 

Protected Member Functions

void writeXMLElementType (XMLSerializer &xml_stream) const
 Write out the text of the XML element type. Note that you should not write the opening '<' character, nor any other information such as attributes in this function. The writeExtraAttributes function can be used for writing attributes. More...
 
void writeXMLAttributes (XMLSerializer &xml_stream) const
 Write out any xml attributes added in a sub-class. Note that you should not write the closing '/>' character sequence, nor any other information in this function. You should always call the base class implementation of this function when overriding. More...
 
const WindowgetTargetWindow (const PropertyReceiver *receiver) const
 return a pointer to the window containing the target property to be accessed. More...
 
WindowgetTargetWindow (PropertyReceiver *receiver) const
 
const WindowgetTargetWindow (const PropertyReceiver *receiver, const String &name_suffix) const
 Return a pointer to the target window with the given suffix.
 
WindowgetTargetWindow (PropertyReceiver *receiver, const String &name_suffix) const
 Return a pointer to the target window with the given suffix.
 
void updateLinkTargets (PropertyReceiver *receiver, const String &value) const
 Updates all linked properties to the given value.
 

Protected Attributes

LinkTargetCollection d_targets
 collection of targets for this PropertyLinkDefinition.
 
- Protected Attributes inherited from CEGUI::PropertyDefinitionBase
bool d_writeCausesRedraw
 
bool d_writeCausesLayout
 
- Protected Attributes inherited from CEGUI::Property
String d_name
 String that stores the Property name.
 
String d_help
 String that stores the Property help text.
 
String d_default
 String that stores the Property default value string.
 
bool d_writeXML
 Specifies whether writeXMLToStream should do anything for this property.
 

Detailed Description

Class representing a property that links to another property defined on an attached child widget.

Member Function Documentation

String CEGUI::PropertyLinkDefinition::get ( const PropertyReceiver receiver) const
virtual

Return the current value of the Property as a String.

Parameters
receiverPointer to the target object.
Returns
String object containing a textual representation of the current value of the Property

Implements CEGUI::Property.

const Window* CEGUI::PropertyLinkDefinition::getTargetWindow ( const PropertyReceiver receiver) const
protected

return a pointer to the window containing the target property to be accessed.

Exceptions
UnknownObjectExceptionthrown if no such target window exists within the system.
Deprecated:
This will be removed in 0.8.x. Use the version taking a suffix string instead!
Window* CEGUI::PropertyLinkDefinition::getTargetWindow ( PropertyReceiver receiver) const
protected
Deprecated:
This will be removed in 0.8.x. Use the version taking a suffix string instead!
void CEGUI::PropertyLinkDefinition::set ( PropertyReceiver receiver,
const String value 
)
virtual

Sets the value of the property.

Note
When overriding the set() member of PropertyDefinitionBase, you MUST call the base class implementation after you have set the property value (i.e. you must call PropertyDefinitionBase::set()).
Parameters
receiverPointer to the target object.
valueA String object that contains a textual representation of the new value to assign to the Property.
Returns
Nothing.
Exceptions
InvalidRequestExceptionThrown when the Property was unable to interpret the content of value.

Reimplemented from CEGUI::PropertyDefinitionBase.

void CEGUI::PropertyLinkDefinition::writeXMLAttributes ( XMLSerializer xml_stream) const
protectedvirtual

Write out any xml attributes added in a sub-class. Note that you should not write the closing '/>' character sequence, nor any other information in this function. You should always call the base class implementation of this function when overriding.

Parameters
xml_streamStream where xml data should be output.

Reimplemented from CEGUI::PropertyDefinitionBase.

void CEGUI::PropertyLinkDefinition::writeXMLElementType ( XMLSerializer xml_stream) const
protectedvirtual

Write out the text of the XML element type. Note that you should not write the opening '<' character, nor any other information such as attributes in this function. The writeExtraAttributes function can be used for writing attributes.

Parameters
xml_streamStream where xml data should be output.

Implements CEGUI::PropertyDefinitionBase.