Crazy Eddie's GUI System
${CEGUI_VERSION}
|
Interface providing introspection capabilities. More...
Inherits CEGUI::PropertyReceiver, and CEGUI::PropertyReceiver.
Inherited by CEGUI::Element, CEGUI::Element, CEGUI::Font, CEGUI::Font, CEGUI::XMLParser, CEGUI::XMLParser, TestingPropertySet, and TestPropertySet.
Public Types | |
typedef ConstMapIterator< PropertyRegistry > | PropertyIterator |
typedef ConstMapIterator< PropertyRegistry > | PropertyIterator |
Public Member Functions | |
PropertySet (void) | |
Constructs a new PropertySet object. | |
virtual | ~PropertySet (void) |
Destructor for PropertySet objects. | |
void | addProperty (Property *property) |
Adds a new Property to the PropertySet. More... | |
void | removeProperty (const String &name) |
Removes a Property from the PropertySet. More... | |
Property * | getPropertyInstance (const String &name) const |
Retrieves a property instance (that was previously added) More... | |
void | clearProperties (void) |
Removes all Property objects from the PropertySet. | |
bool | isPropertyPresent (const String &name) const |
Checks to see if a Property with the given name is in the PropertySet. More... | |
const String & | getPropertyHelp (const String &name) const |
Return the help text for the specified Property. More... | |
String | getProperty (const String &name) const |
Gets the current value of the specified Property. More... | |
template<typename T > | |
PropertyHelper< T >::return_type | getProperty (const String &name) const |
Gets the current value of the specified Property. More... | |
void | setProperty (const String &name, const String &value) |
Sets the current value of a Property. More... | |
template<typename T > | |
void | setProperty (const String &name, typename PropertyHelper< T >::pass_type value) |
Sets the current value of a Property. More... | |
bool | isPropertyDefault (const String &name) const |
Returns whether a Property is at it's default value. More... | |
String | getPropertyDefault (const String &name) const |
Returns the default value of a Property as a String. More... | |
PropertyIterator | getPropertyIterator (void) const |
Return a PropertySet::PropertyIterator object to iterate over the available Properties. | |
PropertySet (void) | |
Constructs a new PropertySet object. | |
virtual | ~PropertySet (void) |
Destructor for PropertySet objects. | |
void | addProperty (Property *property) |
Adds a new Property to the PropertySet. More... | |
void | removeProperty (const String &name) |
Removes a Property from the PropertySet. More... | |
Property * | getPropertyInstance (const String &name) const |
Retrieves a property instance (that was previously added) More... | |
void | clearProperties (void) |
Removes all Property objects from the PropertySet. | |
bool | isPropertyPresent (const String &name) const |
Checks to see if a Property with the given name is in the PropertySet. More... | |
const String & | getPropertyHelp (const String &name) const |
Return the help text for the specified Property. More... | |
String | getProperty (const String &name) const |
Gets the current value of the specified Property. More... | |
template<typename T > | |
PropertyHelper< T >::return_type | getProperty (const String &name) const |
Gets the current value of the specified Property. More... | |
void | setProperty (const String &name, const String &value) |
Sets the current value of a Property. More... | |
template<typename T > | |
void | setProperty (const String &name, typename PropertyHelper< T >::pass_type value) |
Sets the current value of a Property. More... | |
bool | isPropertyDefault (const String &name) const |
Returns whether a Property is at it's default value. More... | |
String | getPropertyDefault (const String &name) const |
Returns the default value of a Property as a String. More... | |
PropertyIterator | getPropertyIterator (void) const |
Return a PropertySet::PropertyIterator object to iterate over the available Properties. | |
Interface providing introspection capabilities.
CEGUI uses this interface for introspection and serialisation, especially in CEGUI::Window and classes that inherit it.
If you are just a user of an existing PropertySet class there are just 2 methods that you should be aware of - PropertySet::setProperty and PropertySet::getProperty. Both methods are available in 2 variants - string fallback mode and templated native mode. It is recommended to use the native mode. Code example:
If you use native mode with the wrong type CEGUI will resort to string fallback and will try to convert the type to whatever you requested.
We will always offer string fallback mode because it is necessary for serialisation and scripting. Scripting languages are often duck typed and cannot use C++ templated code.
The CEGUI::Property instances hold pointers to getter and setter of a given property. They are designed in such a way that multiple PropertySets (multiple widgets) can share the Property instances to save memory. This means that PropertySets don't own the Properties themselves. The Property instances are usually static members of the PropertySet classes or static local variables in the scope of the constructor or a method called from there.
It's unusual but multiple instances of the same class can have different Properties added to them.
It is recommended to use the CEGUI_DEFINE_PROPERTY macro instead of using PropertySet::addProperty directly. This takes care of property initialisation as well as it's addition to the PropertySet instance.
void CEGUI::PropertySet::addProperty | ( | Property * | property | ) |
Adds a new Property to the PropertySet.
property | Pointer to the Property object to be added to the PropertySet. |
NullObjectException | Thrown if property is NULL. |
AlreadyExistsException | Thrown if a Property with the same name as property already exists in the PropertySet |
References CEGUI::Property::getName().
Referenced by CEGUI::Window::addWindowProperties(), CEGUI::WidgetLookFeel::initialiseWidget(), CEGUI::WindowRenderer::onAttach(), and Timer::updateSelf().
void CEGUI::PropertySet::addProperty | ( | Property * | property | ) |
Adds a new Property to the PropertySet.
property | Pointer to the Property object to be added to the PropertySet. |
NullObjectException | Thrown if property is NULL. |
AlreadyExistsException | Thrown if a Property with the same name as property already exists in the PropertySet |
Gets the current value of the specified Property.
UnknownObjectException | Thrown if no Property named name is in the PropertySet. |
Gets the current value of the specified Property.
UnknownObjectException | Thrown if no Property named name is in the PropertySet. |
Referenced by CEGUI::Window::clonePropertiesTo(), CEGUI::FalagardToggleButton::FalagardToggleButton(), CEGUI::TextComponent::getFontObject(), CEGUI::FrameComponent::getImage(), CEGUI::ComponentArea::getPixelRect(), CEGUI::ImagePropertyDim::getSourceImage(), CEGUI::PropertyDim::getValue(), CEGUI::SectionSpecification::initColourRectForOverride(), CEGUI::FalagardComponentBase::initColoursRect(), CEGUI::ColourPicker::initialiseColourPickerControlsWindow(), CEGUI::ImagerySection::initMasterColourRect(), CEGUI::Window::isPropertyAtDefault(), CEGUI::ImageryComponent::render_impl(), CEGUI::AnimationInstance::savePropertyValue(), CEGUI::ColourPickerControls::setCallingColourPicker(), CEGUI::FalagardEditbox::setColourRectToOptionalPropertyColour(), CEGUI::FalagardMultiLineEditbox::setColourRectToOptionalPropertyColour(), CEGUI::SectionSpecification::shouldBeDrawn(), and CEGUI::TextComponent::updateFormatting().
|
inline |
Gets the current value of the specified Property.
UnknownObjectException | Thrown if no Property named name is in the PropertySet. |
This method tries to do a native type get without string conversion if possible, if that is not possible, it gracefully falls back to string conversion
References CEGUI::Property::get(), and CEGUI::TypedProperty< T >::getNative().
|
inline |
Gets the current value of the specified Property.
UnknownObjectException | Thrown if no Property named name is in the PropertySet. |
This method tries to do a native type get without string conversion if possible, if that is not possible, it gracefully falls back to string conversion
References CEGUI::Property::get(), and CEGUI::TypedProperty< T >::getNative().
Return the help text for the specified Property.
UnknownObjectException | Thrown if no Property named name is in the PropertySet. |
Return the help text for the specified Property.
UnknownObjectException | Thrown if no Property named name is in the PropertySet. |
Retrieves a property instance (that was previously added)
name | String containing the name of the Property to be retrieved. If Property name is not in the set, exception is thrown. |
Referenced by CEGUI::Window::banPropertyFromXML(), CEGUI::PropertyDim::getValue(), and CEGUI::Window::isPropertyBannedFromXML().
bool CEGUI::PropertySet::isPropertyDefault | ( | const String & | name | ) | const |
bool CEGUI::PropertySet::isPropertyDefault | ( | const String & | name | ) | const |
bool CEGUI::PropertySet::isPropertyPresent | ( | const String & | name | ) | const |
Checks to see if a Property with the given name is in the PropertySet.
bool CEGUI::PropertySet::isPropertyPresent | ( | const String & | name | ) | const |
Checks to see if a Property with the given name is in the PropertySet.
Referenced by CEGuiBaseApplication::initialiseDefaultResourceGroups(), CEGUI::TabControl::performChildWindowLayout(), CEGUI::FalagardEditbox::setColourRectToOptionalPropertyColour(), and CEGUI::FalagardMultiLineEditbox::setColourRectToOptionalPropertyColour().
void CEGUI::PropertySet::removeProperty | ( | const String & | name | ) |
Removes a Property from the PropertySet.
name | String containing the name of the Property to be removed. If Property name is not in the set, nothing happens. |
Referenced by CEGUI::WidgetLookFeel::cleanUpWidget(), and CEGUI::WindowRenderer::onDetach().
void CEGUI::PropertySet::removeProperty | ( | const String & | name | ) |
Removes a Property from the PropertySet.
Sets the current value of a Property.
name | String containing the name of the Property who's value is to be set. |
value | String containing a textual representation of the new value for the Property |
UnknownObjectException | Thrown if no Property named name is in the PropertySet. |
InvalidRequestException | Thrown when the Property was unable to interpret the content of value. |
Referenced by CEGUI::PropertyInitialiser::apply(), CEGUI::Affector::apply(), CEGUI::Window::clonePropertiesTo(), CEGuiBaseApplication::initialiseDefaultResourceGroups(), CEGUI::PropertyLinkDefinition< CEGUI::Vector2< float > >::initialisePropertyReceiver(), CEGUI::TabControl::performChildWindowLayout(), SamplesFramework::renderGUIContexts(), CEGUI::ColourPickerControls::setCallingColourPicker(), CEGUI::ColourPicker::setColour(), ElasticWindowEffect::update(), and CEGUI::ColourPickerControls::~ColourPickerControls().
Sets the current value of a Property.
name | String containing the name of the Property who's value is to be set. |
value | String containing a textual representation of the new value for the Property |
UnknownObjectException | Thrown if no Property named name is in the PropertySet. |
InvalidRequestException | Thrown when the Property was unable to interpret the content of value. |
|
inline |
Sets the current value of a Property.
name | String containing the name of the Property who's value is to be set. |
value | String containing a textual representation of the new value for the Property |
UnknownObjectException | Thrown if no Property named name is in the PropertySet. |
InvalidRequestException | Thrown when the Property was unable to interpret the content of value. |
This method tries to do a native type set without string conversion if possible, if that is not possible, it gracefully falls back to string conversion
References CEGUI::Property::set(), and CEGUI::TypedProperty< T >::setNative().
|
inline |
Sets the current value of a Property.
name | String containing the name of the Property who's value is to be set. |
value | String containing a textual representation of the new value for the Property |
UnknownObjectException | Thrown if no Property named name is in the PropertySet. |
InvalidRequestException | Thrown when the Property was unable to interpret the content of value. |
This method tries to do a native type set without string conversion if possible, if that is not possible, it gracefully falls back to string conversion
References CEGUI::Property::set(), and CEGUI::TypedProperty< T >::setNative().