40 #ifndef _uisizinginfo_h
41 #define _uisizinginfo_h
43 #include "uienumerations.h"
44 #include "UI/unifieddim.h"
95 USize(Size), VerticalRules(VRules), HorizontalRules(HRules), RatioLock(UI::
ARL_Ratio_Unlocked) { }
99 USize(Other.USize), MaxSize(Other.MaxSize), MinSize(Other.MinSize),
100 VerticalRules(Other.VerticalRules), HorizontalRules(Other.HorizontalRules), RatioLock(Other.RatioLock) { }
118 {
return (this->CanExpandHorizontally() || this->CanExpandVertically()); }
128 return ( this->USize == Other.
USize &&
129 this->MaxSize == Other.
MaxSize &&
130 this->MinSize == Other.
MinSize &&
140 return ( this->USize != Other.
USize ||
141 this->MaxSize != Other.
MaxSize ||
142 this->MinSize != Other.
MinSize ||
184 if( !CurrAttrib.
Empty() )
185 this->HorizontalRules = CurrAttrib.
AsUint();
188 if( !CurrAttrib.
Empty() )
189 this->VerticalRules = CurrAttrib.
AsUint();
192 if( !CurrAttrib.
Empty() )
193 this->RatioLock = static_cast<UI::AspectRatioLock>(CurrAttrib.
AsUint());
196 if( !MinSizeNode.
Empty() )
200 if( !MaxSizeNode.
Empty() )
204 if( !USizeNode.
Empty() )
Attribute AppendAttribute(const Char8 *Name)
Creates an Attribute and puts it at the end of this Nodes attributes.
A light-weight handle for manipulating attributes in DOM tree.
bool Boole
Generally acts a single bit, true or false.
SizingInfo(const UnifiedVec2 &Size)
Size constructor.
Boole CanExpandVertically() const
Checks to see if this will expand vertically.
SizingInfo(const UI::SizingRules HRules, const UI::SizingRules VRules)
Rules constructor.
SizingInfo()
Class constructor.
Boole operator!=(const SizingInfo &Other) const
Inequality comparison operator.
Unified dimensions are ignored and will instead us all available space.
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...
SizingInfo(const SizingInfo &Other)
Copy constructor.
Thrown when a version is accessed/parsed/required and it cannot work correctly or is missing...
UI::AspectRatioLock RatioLock
Rule for determining aspect ratio lock.
bool Empty() const
Is this storing anything at all?
Whole VerticalRules
Rules for resizing on the Y axis.
bool SetValue(const Char8 *rhs)
Set the value of this.
SizingInfo(const UI::SizingRules HRules, const UI::SizingRules VRules, const UnifiedVec2 &Size)
Descriptive constructor.
AspectRatioLock
Used by sizing behavior classes to determine how resizes that preserve aspect ratio should behave...
Resizing will use the provided unified dimensions with no further alterations. This is the default fo...
A light-weight handle for manipulating nodes in DOM tree.
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. ...
void ProtoSerialize(XML::Node &ParentNode) const
Convert this class to an XML::Node ready for serialization.
Boole CanExpand() const
Cheacks to see if this will expand horizontally or vertically.
bool Empty() const
Is this storing anything at all?
Boole operator==(const SizingInfo &Other) const
Equality comparison operator.
void ProtoSerialize(XML::Node &ParentNode) const
Convert this class to an XML::Node ready for serialization.
Boole CanExpandHorizontally() const
Checks to see if this will expand horizontally.
static String GetSerializableName()
Get the name of the the XML tag the Renderable class will leave behind as its instances are serialize...
void ProtoDeSerialize(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite this object with it.
SizingRules
Used by UI container classes to determine their resize behavior on a given axis when the container is...
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.
UnifiedVec2 MinSize
The minumum permitted size.
The aspect ratio is not locked and both dimensions can resize freely.
UnifiedVec2 USize
Unified dimensions to be used if the resize rules permits it.
This class represents a point in 2D space using UnifiedDim's.
const Char8 * Name() const
ptrdiff_tGet the name of this Node.
Whole HorizontalRules
Rules for resizing on the X axis.
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::string String
A datatype used to a series of characters.
~SizingInfo()
Class destructor.
UnifiedVec2 MaxSize
The maximum permitted size.
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.