Pyrogenesis
trunk
|
This setting interface allows GUI objects to call setting function functions without having to know the setting type. More...
#include <CGUISetting.h>
Public Member Functions | |
NONCOPYABLE (IGUISetting) | |
IGUISetting (const CStr &name, IGUIObject *owner) | |
bool | FromString (const CStrW &value, const bool sendMessage) |
Parses the given string and assigns to the setting value. More... | |
bool | FromJSVal (const ScriptRequest &rq, JS::HandleValue value, const bool sendMessage) |
Parses the given JS::Value using Script::FromJSVal and assigns it to the setting data. More... | |
virtual void | ToJSVal (const ScriptRequest &rq, JS::MutableHandleValue value)=0 |
Converts the setting data to a JS::Value using Script::ToJSVal. More... | |
Protected Member Functions | |
IGUISetting (IGUISetting &&o) | |
virtual | ~IGUISetting ()=default |
virtual bool | DoFromString (const CStrW &value)=0 |
virtual bool | DoFromJSVal (const ScriptRequest &rq, JS::HandleValue value)=0 |
virtual void | OnSettingChange (const CStr &setting, bool sendMessage) |
Triggers the IGUIObject logic when a setting changes. More... | |
virtual CStr | GetName () const =0 |
Return the name of the setting, from JS. More... | |
Protected Attributes | |
IGUIObject & | m_pObject |
The object that stores this setting. More... | |
This setting interface allows GUI objects to call setting function functions without having to know the setting type.
This is fact is used for setting the value from a JS value or XML value (string) and when deleting the setting, when the type of the setting value is not known in advance.
IGUISetting::IGUISetting | ( | const CStr & | name, |
IGUIObject * | owner | ||
) |
|
protected |
|
protectedvirtualdefault |
|
protectedpure virtual |
Implemented in CGUISimpleSetting< T >, CGUISimpleSetting< CGUISize >, CGUISimpleSetting< CGUIString >, CGUISimpleSetting< CStrW >, CGUISimpleSetting< CStr >, CGUISimpleSetting< float >, CGUISimpleSetting< EAlign >, CGUISimpleSetting< CVector2D >, CGUISimpleSetting< CGUIList >, CGUISimpleSetting< CGUISpriteInstance >, CGUISimpleSetting< CGUISeries >, CGUISimpleSetting< u32 >, CGUISimpleSetting< bool >, CGUISimpleSetting< EVAlign >, CGUISimpleSetting< i32 >, CGUISimpleSetting< CGUIColor >, CGUIMouseEventMask, and CGUIHotkey.
|
protectedpure virtual |
Implemented in CGUISimpleSetting< T >, CGUISimpleSetting< CGUISize >, CGUISimpleSetting< CGUIString >, CGUISimpleSetting< CStrW >, CGUISimpleSetting< CStr >, CGUISimpleSetting< float >, CGUISimpleSetting< EAlign >, CGUISimpleSetting< CVector2D >, CGUISimpleSetting< CGUIList >, CGUISimpleSetting< CGUISpriteInstance >, CGUISimpleSetting< CGUISeries >, CGUISimpleSetting< u32 >, CGUISimpleSetting< bool >, CGUISimpleSetting< EVAlign >, CGUISimpleSetting< i32 >, CGUISimpleSetting< CGUIColor >, CGUIMouseEventMask, and CGUIHotkey.
bool IGUISetting::FromJSVal | ( | const ScriptRequest & | rq, |
JS::HandleValue | value, | ||
const bool | sendMessage | ||
) |
Parses the given JS::Value using Script::FromJSVal and assigns it to the setting data.
Parses the given JS::Value using ScriptInterface::FromJSVal and assigns it to the setting data.
bool IGUISetting::FromString | ( | const CStrW & | value, |
const bool | sendMessage | ||
) |
Parses the given string and assigns to the setting value.
Used for parsing XML attributes.
|
protectedpure virtual |
Return the name of the setting, from JS.
Implemented in CGUISimpleSetting< T >, CGUISimpleSetting< CGUISize >, CGUISimpleSetting< CGUIString >, CGUISimpleSetting< CStrW >, CGUISimpleSetting< CStr >, CGUISimpleSetting< float >, CGUISimpleSetting< EAlign >, CGUISimpleSetting< CVector2D >, CGUISimpleSetting< CGUIList >, CGUISimpleSetting< CGUISpriteInstance >, CGUISimpleSetting< CGUISeries >, CGUISimpleSetting< u32 >, CGUISimpleSetting< bool >, CGUISimpleSetting< EVAlign >, CGUISimpleSetting< i32 >, CGUISimpleSetting< CGUIColor >, and CGUIMouseEventMask.
IGUISetting::NONCOPYABLE | ( | IGUISetting | ) |
|
protectedvirtual |
Triggers the IGUIObject logic when a setting changes.
This should be called by derived classes when something externally visible changes, unless overloaded to provide similar behaviour.
Reimplemented in CGUIHotkey.
|
pure virtual |
Converts the setting data to a JS::Value using Script::ToJSVal.
Implemented in CGUISimpleSetting< T >, CGUISimpleSetting< CGUISize >, CGUISimpleSetting< CGUIString >, CGUISimpleSetting< CStrW >, CGUISimpleSetting< CStr >, CGUISimpleSetting< float >, CGUISimpleSetting< EAlign >, CGUISimpleSetting< CVector2D >, CGUISimpleSetting< CGUIList >, CGUISimpleSetting< CGUISpriteInstance >, CGUISimpleSetting< CGUISeries >, CGUISimpleSetting< u32 >, CGUISimpleSetting< bool >, CGUISimpleSetting< EVAlign >, CGUISimpleSetting< i32 >, CGUISimpleSetting< CGUIColor >, and CGUIMouseEventMask.
|
protected |
The object that stores this setting.