40 #ifndef _uicheckbox_cpp
41 #define _uicheckbox_cpp
43 #include "UI/uimanager.h"
44 #include "UI/checkbox.h"
45 #include "UI/screen.h"
47 #include "stringtool.h"
76 Button(RendName,RendRect,Parent),
91 this->
AddEvent(CheckBox::EventSelected);
92 this->
AddEvent(CheckBox::EventDeselected);
101 this->
BindGroupToState( WS_Selected | WS_Hovered | WS_Focused, SelectedHoveredGroup );
102 this->
BindGroupToState( WS_Selected | WS_Focused | WS_Dragged, SelectedNormalGroup );
103 this->
BindGroupToState( WS_Selected | WS_Dragged | WS_Hovered, SelectedHoveredGroup );
104 this->
BindGroupToState( WS_Selected | WS_Hovered | WS_Focused | WS_Dragged, SelectedHoveredGroup );
112 return (this->
State & WS_Selected);
164 if( !PropertiesNode.
Empty() ) {
166 CurrAttrib = PropertiesNode.
GetAttribute(
"LockoutTime");
167 if( !CurrAttrib.
Empty() )
204 this->
State |= WS_Selected;
213 this->
State &= ~WS_Selected;
227 {
return new CheckBox(RendName,Parent); }
230 {
return new CheckBox(RendName,RendRect,Parent); }
233 {
return new CheckBox(XMLNode,Parent); }
248 {
delete static_cast<CheckBox*
>( ToBeDestroyed ); }
static const String TypeName
String containing the type name for this class: "CheckBox".
Attribute AppendAttribute(const Char8 *Name)
Creates an Attribute and puts it at the end of this Nodes attributes.
virtual void DestroyWidget(Widget *ToBeDestroyed)
Destroys a Widget created by this factory.
A light-weight handle for manipulating attributes in DOM tree.
virtual void SetSelectLock(Boole Lock)
Locks (or unlocks) the current state of this checkbox.
bool Boole
Generally acts a single bit, true or false.
virtual void _OnDeselected()
Self logic to be executed when this checkbox is deselected.
virtual Boole IsLocked()
Gets wether this checkbox is locked into it's current state.
virtual Boole IsSelected()
Gets whether this checkbox is selected or not.
Boole SelectLock
Stores whether or not the current state of this CheckBox is locked.
Thrown when the requested identity could not be found.
#define MEZZ_EXCEPTION(num, desc)
An easy way to throw exceptions with rich information.
virtual void ProtoDeSerializeProperties(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite the properties of this object with it...
A simple reference counting pointer.
Thrown when a version is accessed/parsed/required and it cannot work correctly or is missing...
const Char8 * AsString(const Char8 *def="") const
Attempts to convert the value of the attribute to a String and returns the results.
virtual ~CheckBox()
Class destructor.
virtual const String & GetTypeName() const
Gets the type of widget this is.
static String GetSerializableName()
Get the name of the the XML tag the Renderable class will leave behind as its instances are serialize...
RenderLayerGroup * CreateRenderLayerGroup(const UInt16 GroupID)
Creates a new RenderLayerGroup that can have. function will throw an exception if a group already exi...
virtual void _OnActivate()
Self logic to be executed when this button is activated.
bool Empty() const
Is this storing anything at all?
This implements the exception hiearchy for Mezzanine.
static const String EventSelected
Event name for when this checkbox is Selected.
virtual String GetWidgetTypeName() const
Gets the name of the Widget that is created by this factory.
virtual void _OnDeactivate()
Self logic to be executed when this button is deactivated.
bool SetValue(const Char8 *rhs)
Set the value of this.
This class represents a 2D rect which can express the size and position of a renderable on screen...
A light-weight handle for manipulating nodes in DOM tree.
int AsInt(int def=0) const
Attempts to convert the value of the attribute to an int and returns the results. ...
bool Empty() const
Is this storing anything at all?
Event * AddEvent(const String &EventName)
Creates a new event this Publisher can fire.
virtual Widget * CreateWidget(Screen *Parent)
Creates a Widget of the type represented by this factory.
String Name
The unique name of this Renderable.
void FireEvent(EventArgumentsPtr Args)
Fires an event.
This class stores a group of render layers that can be set to be rendered.
static const String EventDeselected
Event name for when this checkbox is Deselected.
virtual CheckBox * CreateCheckBox(const String &RendName, Screen *Parent)
Creates a new CheckBox.
void ConstructCheckbox()
Contains all the common necessary startup initializations for this class.
The bulk of the engine components go in this namspace.
virtual void ManualSelect(Boole Select)
Manually select or deselect this checkbox.
virtual void ProtoDeSerialize(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite this object with it.
virtual void _OnSelected()
Self logic to be executed when this checkbox is selected.
This is a simple widget for storing a bool value.
void SerializeError(const String &FailedTo, const String &ClassName, Boole SOrD)
Simply does some string concatenation, then throws an Exception.
Node AppendChild(NodeType Type=NodeElement)
Creates a Node and makes it a child of this one.
virtual void ProtoSerializeProperties(XML::Node &SelfRoot) const
Convert the properties of this class to an XML::Node ready for serialization.
std::map< String, String > NameValuePairMap
This is a datatype mostly used for describing settings or parameters that can't be declared in advanc...
This class is a helper class for creating UI's. It is responsible for storing and keeping track of al...
std::string String
A datatype used to a series of characters.
Attribute GetAttribute(const Char8 *Name) const
Attempt to get an Attribute on this Node with a given name.
CheckBox(Screen *Parent)
Blank constructor.
Node GetChild(const Char8 *Name) const
Attempt to get a child Node with a given name.