43 #include "UI/tabset.h"
44 #include "UI/stackbutton.h"
45 #include "UI/screen.h"
46 #include "UI/layoutstrategy.h"
48 #include "Input/inputmanager.h"
49 #include "Input/mouse.h"
150 (*It)->SetVisible(CanSee);
184 this->
SubSetBindings.insert( std::pair<StackButton*,UInt16>(ConfigButton,Config) );
194 return (*SubIt).second;
240 SerializeError(
"Create XML Version Attribute",
"SubSetBinding",
true);
244 SerializeError(
"Create XML Version Attribute",
"SubSetBindings",
true);
260 if( !BindingsNode.
Empty() ) {
264 if( (*BindingNodeIt).GetAttribute(
"Version").AsInt() == 1 ) {
268 CurrAttrib = (*BindingNodeIt).GetAttribute(
"ConfigID");
269 if( !CurrAttrib.
Empty() )
270 ConfigID = static_cast<UInt16>( CurrAttrib.
AsUint() );
272 CurrAttrib = (*BindingNodeIt).GetAttribute(
"ButtonName");
273 if( !CurrAttrib.
Empty() )
276 if( !ButtonName.empty() ) {
279 this->
SetButtonConfig(ConfigID,static_cast<StackButton*>(NamedButton));
282 ExceptionStream <<
"Named StackButton \"" << ButtonName <<
"\" not found when deserializing Widget named \"" << this->
GetName() <<
"\".";
353 {
return this->
CreateTabSet(RendName,RendRect,Parent); }
359 {
delete static_cast<TabSet*
>( ToBeDestroyed ); }
virtual void DestroyWidget(Widget *ToBeDestroyed)
Destroys a Widget created by this factory.
virtual ~TabSet()
Class destructor.
virtual void ProtoSerializeProperties(XML::Node &SelfRoot) const
Convert the properties of this class to an XML::Node ready for serialization.
virtual UInt16 GetButtonConfig(const StackButton *ConfigButton) const
Gets the role of the specified StackedButton for this StackedContainer.
Attribute AppendAttribute(const Char8 *Name)
Creates an Attribute and puts it at the end of this Nodes attributes.
static String GetSerializableName()
Get the name of the the XML tag the Renderable class will leave behind as its instances are serialize...
const String & GetName() const
Gets the name of this renderable.
TabbedSubSet * VisibleChild
A pointer to the only visible child of this TabSet.
static const String TypeName
String containing the type name for this class: "TabSet".
A light-weight handle for manipulating attributes in DOM tree.
This is a base class for the algorithms used by QuadRenderables to determine how they should update t...
virtual void _NotifyButtonSelected(StackButton *Selected)
Notifies this StackedContainer a button has been selected.
bool Boole
Generally acts a single bit, true or false.
virtual TabbedSubSet * GetVisibleSubSet() const
Gets a pointer to the TabbedSubSet that is currently visible within this TabSet.
virtual String GetWidgetTypeName() const
Gets the name of the Widget that is created by this factory.
virtual void SetVisibleSubSet(TabbedSubSet *MakeVisible)
Makes a child TabbedSubSet in this TabSet visible.
virtual const String & GetTypeName() const
Gets the type of widget this is.
#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...
virtual void SetVisible(Boole CanSee)
Sets the visibility of this renderable.
const Char8 * AsString(const Char8 *def="") const
Attempts to convert the value of the attribute to a String and returns the results.
Boole Visible
Stores whether this Renderable is to be rendered (also dependent on parent visibility).
This is a widget that stores sets of renderables but only displays one at a time. ...
bool Empty() const
Is this storing anything at all?
virtual void ProtoDeSerializeProperties(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite the properties of this object with it...
virtual void RemoveButtonConfig(StackButton *ConfigButton)
Removes a button from the configuration of this TabSet.
virtual Widget * GetChild(const UInt16 Zorder) const
Gets a child by it's ZOrder.
std::stringstream StringStream
A Datatype used for streaming operations with strings.
ChildContainer ChildWidgets
This is a container storing all the children that belong to this Quad.
virtual const UInt16 & GetZOrder() const
Gets the currently set ZOrder of this QuadRenderable with it's parent.
virtual TabSet * CreateTabSet(const String &RendName, Screen *Parent)
Creates a new TabSet.
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...
uint16_t UInt16
An 16-bit unsigned integer.
virtual void ProtoDeSerializeProperties(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite the properties of this object with it...
virtual void ProtoSerializeButtonBindings(XML::Node &SelfRoot) const
Convert the Button Bindings of this class to an XML::Node ready for serialization.
Child node iterator (a bidirectional iterator over a collection of Node)
A light-weight handle for manipulating nodes in DOM tree.
iterator begin() const
Get a Child node iterator that references the first child Node.
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. ...
iterator end() const
Get a Child node iterator that references one past the last child Node.
bool Empty() const
Is this storing anything at all?
virtual TabbedSubSet * CreateTabbedSubSet(const String &Name, const UInt16 ChildZOrder)
Creates a new TabbedSubSet for this TabSet.
virtual void ProtoSerializeImpl(XML::Node &SelfRoot) const
Implementation method for serializing additional sets of data.
virtual void Hide()
Forces this renderable to hide.
TabbedSubSetContainer::iterator TabbedSubSetIterator
Iterator type for TabbedSubSet instances stored by this class.
virtual void Show()
Forces this renderable to be shown.
TabbedSubSetContainer::const_iterator ConstTabbedSubSetIterator
Const Iterator type for TabbedSubSet instances stored stored by this class.
virtual void AddChild(Widget *Child)
Adds a Widget to this as a child of this quad.
Thrown when parameters are checked at runtime and found invalid.
virtual void _SetLayoutStrat(LayoutStrategy *ToSet)
Sets a new LayoutStrategy for this quad to use.
virtual void ProtoDeSerializeButtonBindings(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite the Button Bindings of this object with it...
virtual Widget * GetWidget(const String &Name)
Gets a widget in this screen by name.
virtual void ProtoSerializeProperties(XML::Node &SelfRoot) const
Convert the properties of this class to an XML::Node ready for serialization.
virtual Widget * CreateWidget(Screen *Parent)
Creates a Widget of the type represented by this factory.
virtual void ProtoDeSerializeImpl(const XML::Node &SelfRoot)
Implementation method for deseriailizing additional sets of data.
The bulk of the engine components go in this namspace.
TabSet(Screen *Parent)
Blank constructor.
ChildContainer::iterator ChildIterator
Iterator type for Widget instances stored by this class.
virtual void ProtoDeSerialize(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite this object with it.
virtual void SetButtonConfig(const UInt16 Config, StackButton *ConfigButton)
Binds a StackedButton to this container according to the provided config value.
virtual void _MarkDirty()
Marks this renderable as dirty, and informs other renderables if needed.
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.
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.
TabbedSubSetContainer SubSetBindings
A container storing all the bindings to.
virtual Widget * CreateWidget(const XML::Node &WidgetNode)
Creates a widget from an XML::Node.