Crazy Eddie's GUI System
0.8.7
|
27 #ifndef _CEGUIFalPropertyDefinition_h_
28 #define _CEGUIFalPropertyDefinition_h_
30 #include "CEGUI/falagard/FalagardPropertyBase.h"
31 #include "CEGUI/falagard/XMLHandler.h"
32 #include "CEGUI/Logger.h"
37 class PropertyDefinition :
public FalagardPropertyBase<T>
40 typedef typename TypedProperty<T>::Helper Helper;
43 PropertyDefinition(
const String& name,
const String& initialValue,
44 const String& help,
const String& origin,
45 bool redrawOnWrite,
bool layoutOnWrite,
46 const String& fireEvent,
const String& eventNamespace) :
47 FalagardPropertyBase<T>(name, help, initialValue, origin,
48 redrawOnWrite, layoutOnWrite,
49 fireEvent, eventNamespace),
55 ~PropertyDefinition() {}
60 setWindowUserString(
static_cast<Window*
>(receiver), FalagardPropertyBase<T>::d_initialValue);
71 typename Helper::safe_method_return_type
72 getNative_impl(
const PropertyReceiver* receiver)
const
74 const Window*
const wnd =
static_cast<const Window*
>(receiver);
85 return Helper::fromString(wnd->getUserString(d_userStringName));
87 CEGUI_CATCH (UnknownObjectException&)
89 Logger::getSingleton().logEvent(
90 "PropertyDefiniton::get: Defining new user string: " +
97 const_cast<Window*
>(wnd)->
98 setUserString(d_userStringName, FalagardPropertyBase<T>::d_initialValue);
100 return Helper::fromString(FalagardPropertyBase<T>::d_initialValue);
105 void setNative_impl(PropertyReceiver* receiver,
typename Helper::pass_type value)
107 setWindowUserString(
static_cast<Window*
>(receiver), Helper::toString(value));
112 void setWindowUserString(
Window* window,
const String& value)
const
121 writeDefinitionXMLAdditionalAttributes(xml_stream);
124 void writeDefinitionXMLAdditionalAttributes(XMLSerializer& xml_stream)
const
136 String d_userStringName;
static const String GenericDataType
Default or unspecified value for the "dataType" attribute.
Definition: falagard/XMLHandler.h:113
static const String HelpStringAttribute
Attribute name that stores a help string.
Definition: falagard/XMLHandler.h:203
static const String TypeAttribute
Attribute name that stores a type string.
Definition: falagard/XMLHandler.h:176
void setUserString(const String &name, const String &value)
Sets the value a named user string, creating it as required.
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
String d_dataType
Holds data type of this property.
Definition: Property.h:276
static const String UserStringNameSuffix
The PropertyDefinition's user string name suffix, which is appended to each #d_userStringName.
Definition: PropertyDefinitionBase.h:108
static const String PropertyDefinitionElement
Tag name for property definition elements.
Definition: falagard/XMLHandler.h:153
Definition: PropertyDefinition.h:61
void writeDefinitionXMLElementType(XMLSerializer &xml_stream) const
Write out the text of the XML element type. Note that you should not write the opening '<' character,...
Definition: PropertyDefinition.h:166
static const String PropertyDefinitionHelpDefaultValue
Default value for the "type" attribute of PropertyDefinition elements.
Definition: falagard/XMLHandler.h:107
An abstract base class providing common functionality and specifying the required interface for deriv...
Definition: Window.h:175
void initialisePropertyReceiver(PropertyReceiver *receiver) const
function to allow initialisation of a PropertyReceiver.
Definition: PropertyDefinition.h:106
String class used within the GUI system.
Definition: String.h:88
An abstract class that defines the interface to access object properties by name.
Definition: Property.h:87
Definition: FalagardPropertyBase.h:60