41 #ifndef _uilinearcontainer_cpp
42 #define _uilinearcontainer_cpp
44 #include "UI/linearcontainer.h"
45 #include "UI/layoutstrategy.h"
53 ForcedSizingRules(SE_None),
54 VisibleChildAlign(UI::LA_TopLeft)
59 ForcedSizingRules(SE_None),
60 VisibleChildAlign(UI::LA_TopLeft)
65 ForcedSizingRules(SE_None),
66 VisibleChildAlign(UI::LA_TopLeft)
152 if( !PropertiesNode.
Empty() ) {
155 CurrAttrib = PropertiesNode.
GetAttribute(
"ForcedSizingRules");
156 if( !CurrAttrib.
Empty() )
159 CurrAttrib = PropertiesNode.
GetAttribute(
"VisibleChildAlign");
160 if( !CurrAttrib.
Empty() )
165 if( !ChildSizingNode.
Empty() )
169 if( !LinearPaddingNode.
Empty() )
181 return "LinearContainer";
This is the base class for containers that have a render area and work area of different sizes...
The preset size for children of this container will only be applied when they are added to this conta...
Attribute AppendAttribute(const Char8 *Name)
Creates an Attribute and puts it at the end of this Nodes attributes.
UnifiedDim LinearPadding
The amount of space to add to both sides of a child object on the relevant axis.
virtual void ProtoSerializeProperties(XML::Node &SelfRoot) const
Convert the properties of this class to an XML::Node ready for serialization.
A light-weight handle for manipulating attributes in DOM tree.
virtual void AddChild(Widget *Child)
Adds a Widget to this as a child of this quad.
PositioningInfo PositioningPolicy
This stores all the information needed to determine the specific behaviors this Quad should have when...
virtual void SetChildSizing(const SizingInfo &ForcedSize, const Whole Enforcement)
Sets both the size and enforcement rules for forced child sizing in this container.
SizingInfo SizingPolicy
This stores all the information needed to determine the specific behaviors this Quad should have when...
Thrown when the requested identity could not be found.
Node GetFirstChild() const
Get the first child Node of this Node.
#define MEZZ_EXCEPTION(num, desc)
An easy way to throw exceptions with rich information.
This is a helper class designed to describe the behaviors of a quad when it needs to be resized...
static String GetSerializableName()
Get the name of the the XML tag the Renderable class will leave behind as its instances are serialize...
virtual void SetPadding(const UnifiedDim &Padding)
Sets the spacing to be split between both sides of each child quad on the relevant axis...
Thrown when a version is accessed/parsed/required and it cannot work correctly or is missing...
void ProtoSerialize(XML::Node &ParentNode) const
Convert this class to an XML::Node ready for serialization.
bool Empty() const
Is this storing anything at all?
LinearAlignment
Used by various UI classes to determine the alignment of their child objects, such as text in text li...
virtual void ProtoDeSerializeProperties(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite the properties of this object with it...
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.
Whole AsWhole(Whole def=0) const
Attempts to convert the value of the attribute to a Whole and returns the results.
virtual const SizingInfo & GetChildSize() const
Gets the size to be given to children processed by this container if forced sizing is enabled...
virtual void ProtoSerializeProperties(XML::Node &SelfRoot) const
Convert the properties of this class to an XML::Node ready for serialization.
virtual ~LinearContainer()
Class destructor.
A light-weight handle for manipulating nodes in DOM tree.
void ProtoDeSerialize(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite this object with it.
int AsInt(int def=0) const
Attempts to convert the value of the attribute to an int and returns the results. ...
Whole ForcedSizingRules
The current enforcement for child size in this container.
bool Empty() const
Is this storing anything at all?
void ProtoSerialize(XML::Node &ParentNode) const
Convert this class to an XML::Node ready for serialization.
virtual void SetChildSize(const SizingInfo &ForcedSize)
Sets the size to be given to children processed by this container if forced sizing is enabled...
virtual void AddChild(Widget *Child)
Adds a Widget to this as a child of this quad.
virtual void SetVisibleChildAlignment(const UI::LinearAlignment ChildAlign)
Sets the alignment for visible children of this container when they don't take up all the visible spa...
virtual void SetChildSizeEnforcement(const Whole Enforcement)
Sets when the set child sizing will be applied to any given child.
SizingInfo ChildSizing
The size given to children layed out by this container.
This class represents both the relative and absolute values that can be expressed for the values on o...
virtual void SetSizingPolicy(const SizingInfo &Policy)
Sets the behavior to be used when this QuadRenderable is sized.
LinearContainer(Screen *Parent)
Blank constructor.
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 Whole GetChildSizeEnforcement() const
Gets when the set child sizing will be applied to any given child.
The bulk of the engine components go in this namspace.
unsigned long Whole
Whole is an unsigned integer, it will be at least 32bits in size.
void ProtoDeSerialize(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite this object with it.
virtual const UnifiedDim & GetPadding() const
Gets the spacing being split between both sides of each child quad on the relevant axis...
UI::LinearAlignment VisibleChildAlign
The alignment to be given to the sequence of children visible in this container.
static String GetSerializableName()
Get the name of the the XML tag the Renderable class will leave behind as its instances are serialize...
virtual UI::LinearAlignment GetVisibleChildAlignment() const
Gets the alignment for visible children of this container when they don't take up all the visible spa...
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.
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.