Crazy Eddie's GUI System
0.8.7
|
27 #ifndef _CEGUIFalPropertyLinkDefinition_h_
28 #define _CEGUIFalPropertyLinkDefinition_h_
30 #include "CEGUI/falagard/FalagardPropertyBase.h"
31 #include "CEGUI/falagard/XMLHandler.h"
32 #include "CEGUI/IteratorBase.h"
35 #if defined (_MSC_VER)
36 # pragma warning(push)
37 # pragma warning(disable : 4251)
59 const String& targetProperty,
const String& initialValue,
61 bool redrawOnWrite,
bool layoutOnWrite,
66 redrawOnWrite, layoutOnWrite,
67 fireEvent, eventNamespace)
71 if (!widgetName.
empty() || !targetProperty.
empty())
81 d_targets.push_back(std::make_pair(widget,property));
94 bool isTargetProperty(
const String& widget,
const String& property)
const
96 LinkTargetCollection::const_iterator i =
d_targets.begin();
99 if (property == i->second && widget == i->first)
121 typename Helper::safe_method_return_type
122 getNative_impl(
const PropertyReceiver* receiver)
const
124 const LinkTargetCollection::const_iterator i(
d_targets.begin());
126 const Window*
const target_wnd =
131 return Helper::fromString(FalagardPropertyBase<T>::d_initialValue);
135 return Helper::fromString(target_wnd->getProperty(i->second.empty() ?
140 void setNative_impl(PropertyReceiver* receiver,
141 typename Helper::pass_type value)
143 updateLinkTargets(receiver, value);
146 FalagardPropertyBase<T>::setNative_impl(receiver, value);
150 void updateLinkTargets(PropertyReceiver* receiver,
151 typename Helper::pass_type value)
const
153 LinkTargetCollection::const_iterator i =
d_targets.begin();
163 target_wnd->setProperty(propertyName, propertyValue);
164 target_wnd->banPropertyFromXML(propertyName);
173 writeFalagardXMLAttributes(xml_stream);
174 writeDefinitionXMLAdditionalAttributes(xml_stream);
178 void writeDefinitionXMLAdditionalAttributes(
XMLSerializer& xml_stream)
const
188 void writeFalagardXMLAttributes(XMLSerializer& xml_stream)
const
195 LinkTargetCollection::const_iterator i(
d_targets.begin());
200 if (!i->first.empty())
203 if (!i->second.empty())
213 if (!i->first.empty())
216 if (!i->second.empty())
219 xml_stream.closeTag();
230 return static_cast<const Window*
>(receiver);
234 return static_cast<const Window*
>(receiver)->getParent();
236 return static_cast<const Window*
>(receiver)->getChild(name);
244 return const_cast<Window*
>(
249 typedef std::pair<String,String> StringPair;
267 #if defined (_MSC_VER)
268 # pragma warning(pop)
std::vector< StringPair CEGUI_VECTOR_ALLOC(StringPair)> LinkTargetCollection
type used for the collection of targets.
Definition: PropertyLinkDefinition.h:251
static const String GenericDataType
Default or unspecified value for the "dataType" attribute.
Definition: falagard/XMLHandler.h:89
const String S_parentIdentifier
void clearLinkTargets()
clear all link targets from this link definition.
Definition: PropertyLinkDefinition.h:86
static const String ParentIdentifier
String value representing a parent link identifier.
Definition: falagard/XMLHandler.h:93
static const String HelpStringAttribute
Attribute name that stores a help string.
Definition: falagard/XMLHandler.h:179
Class representing a property that links to another property defined on an attached child widget.
Definition: PropertyLinkDefinition.h:52
static const String TypeAttribute
Attribute name that stores a type string.
Definition: falagard/XMLHandler.h:152
XMLSerializer & openTag(const String &name)
Start a new tag in the xml document.
Class used to create XML Document.
Definition: XMLSerializer.h:87
const Window * getTargetWindow(const PropertyReceiver *receiver, const String &name) const
Return a pointer to the target window with the given name.
Definition: PropertyLinkDefinition.h:226
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
LinkTargetCollection d_targets
collection of targets for this PropertyLinkDefinition.
Definition: PropertyLinkDefinition.h:254
Window * getTargetWindow(PropertyReceiver *receiver, const String &name) const
Return a pointer to the target window with the given name.
Definition: PropertyLinkDefinition.h:241
String d_name
String that stores the Property name.
Definition: Property.h:244
void addLinkTarget(const String &widget, const String &property)
add a new link target to property on widget (name).
Definition: PropertyLinkDefinition.h:79
static const String PropertyLinkDefinitionElement
Tag name for property link elements.
Definition: falagard/XMLHandler.h:130
iterator for vectors
Definition: IteratorBase.h:288
void initialisePropertyReceiver(PropertyReceiver *receiver) const
function to allow initialisation of a PropertyReceiver.
Definition: PropertyLinkDefinition.h:107
An abstract base class providing common functionality and specifying the required interface for deriv...
Definition: Window.h:151
static const String PropertyAttribute
Attribute name that stores the name of a property.
Definition: falagard/XMLHandler.h:175
static const String PropertyLinkDefinitionHelpDefaultValue
Default value for the "type" attribute of PropertyLinkDefinition elements.
Definition: falagard/XMLHandler.h:86
bool empty(void) const
Returns true if the String is empty.
Definition: String.h:633
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: PropertyLinkDefinition.h:170
String class used within the GUI system.
Definition: String.h:64
An abstract class that defines the interface to access object properties by name.
Definition: Property.h:62
static const String WidgetAttribute
Attribute name that stores the name of a widget (suffix).
Definition: falagard/XMLHandler.h:163
static const String PropertyLinkTargetElement
Tag name for property link target elements.
Definition: falagard/XMLHandler.h:131
Helper class used to convert various data types to and from the format expected in Property strings.
Definition: ForwardRefs.h:84
Dummy base class to ensure correct casting of receivers.
Definition: Property.h:46
XMLSerializer & attribute(const String &name, const String &value)
After an opening tag you can populate attribute list with this function.
static const String TargetPropertyAttribute
Attribute name that stores a name of a target property.
Definition: falagard/XMLHandler.h:172
Definition: FalagardPropertyBase.h:37