40 #ifndef _uistackbutton_cpp
41 #define _uistackbutton_cpp
43 #include "UI/stackbutton.h"
44 #include "UI/stackedcontainer.h"
45 #include "UI/screen.h"
47 #include "stringtool.h"
74 Button(RendName,RendRect,Parent),
128 if( !PropertiesNode.
Empty() ) {
133 CurrAttrib = PropertiesNode.
GetAttribute(
"ContainerName");
134 if( !CurrAttrib.
Empty() )
135 ContainerName = CurrAttrib.
AsString();
137 CurrAttrib = PropertiesNode.
GetAttribute(
"ButtonConfig");
138 if( !CurrAttrib.
Empty() )
139 ContainerConfig = static_cast<UInt16>( CurrAttrib.
AsUint() );
141 if( !ContainerName.empty() ) {
144 static_cast<StackedContainer*
>( UncastedMenu )->SetButtonConfig(ContainerConfig,
this);
194 {
return new StackButton(RendName,RendRect,Parent); }
212 {
delete static_cast<StackButton*
>( ToBeDestroyed ); }
Attribute AppendAttribute(const Char8 *Name)
Creates an Attribute and puts it at the end of this Nodes attributes.
const String & GetName() const
Gets the name of this renderable.
A light-weight handle for manipulating attributes in DOM tree.
Thrown when the requested identity could not be found.
#define MEZZ_EXCEPTION(num, desc)
An easy way to throw exceptions with rich information.
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.
bool Empty() const
Is this storing anything at all?
This implements the exception hiearchy for Mezzanine.
The interface for serialization.
bool SetValue(const Char8 *rhs)
Set the value of this.
static const String TypeName
String containing the type name for this class: "StackedContainer".
This class represents a 2D rect which can express the size and position of a renderable on screen...
uint16_t UInt16
An 16-bit unsigned integer.
A light-weight handle for manipulating nodes in DOM tree.
This is the base class for containers that stack their children one on top of the other...
unsigned int AsUint(unsigned int def=0) const
Attempts to convert the value of the attribute to an unsigned int and returns the results...
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?
Thrown when parameters are checked at runtime and found invalid.
virtual Widget * GetWidget(const String &Name)
Gets a widget in this screen by name.
The bulk of the engine components go in this namspace.
virtual void ProtoDeSerialize(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite this object with it.
virtual UInt16 GetButtonConfig(const StackButton *ConfigButton) const =0
Gets the role of the specified StackedButton for this StackedContainer.
void SerializeError(const String &FailedTo, const String &ClassName, Boole SOrD)
Simply does some string concatenation, then throws an Exception.
virtual void _NotifyButtonSelected(StackButton *Selected)=0
Notifies this StackedContainer a button has been selected.
Node AppendChild(NodeType Type=NodeElement)
Creates a Node and makes it a child of this one.
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.
Node GetChild(const Char8 *Name) const
Attempt to get a child Node with a given name.
Screen * ParentScreen
A pointer to the Screen that created this Renderable.