Pre-resize fillparent

This commit is contained in:
2018-08-13 22:22:10 -04:00
parent 58fa6f0503
commit 353dc21750
95 changed files with 478 additions and 437 deletions
@@ -2,7 +2,7 @@
using namespace GUIHelpers;
const RGBA& GUIHelpers::StringtoRGBA( const cString& colour )
const RGBA GUIHelpers::StringtoRGBA( const cString& colour )
{
RGBA rtn = DEFAULT;
cString check = colour.upper();
@@ -18,8 +18,6 @@ namespace GUIHelpers {
typedef struct SDL_Colour RGBA;
typedef struct SDL_Rect Area;
static const RGBA DEFAULT = { 0, 0, 0, 0 };
static const RGBA WHITE = { 255, 255, 255, 255 };
static const RGBA BLACK = { 0, 0, 0, 255 };
@@ -38,8 +36,9 @@ namespace GUIHelpers {
static const RGBA MAGENTA = { 255, 0, 255, 255 };
static const RGBA ROSE = { 255, 0, 128, 255 };
static const RGBA DEFAULT = WHITE;
const RGBA& StringtoRGBA(const cString& colour);
const RGBA StringtoRGBA(const cString& colour);
}/// END NAMESPACE DEFINITION GUIHelpers
#endif/// END IFNDEF _GUIUTILITY_HPP_
@@ -21,15 +21,15 @@ bool cObject::operator == (const cObject& other)
return false;
}
///Functions
/// Functions
///Sets
/// Sets
const void cObject::setID( const signed int id )
{
m_id = id;
}
///Gets
/// Gets
const signed int cObject::getID() const
{
return m_id;
@@ -13,9 +13,7 @@ cTexture::cTexture()
cTexture::~cTexture()
{}
///Functions
//private
/// Functions
SDL_Texture* cTexture::GenerateTexture( const SDL_Rect& dimensions, TextTypeEngine::cText* text /*= nullptr*/ )
{
SDL_Rect t = text->getWH();
@@ -18,7 +18,7 @@ namespace GUIHelpers {
cTexture();
~cTexture();
///Functions
/// Functions
SDL_Texture* GenerateTexture( const SDL_Rect& dimensions, TextTypeEngine::cText* text = nullptr );
private:
@@ -12,21 +12,15 @@ using UtilityEngine::cUtility;
cXMLoader::cXMLoader()
{
m_loadDef = false;
m_orientation = GUIHelpers::eOrientation::DEFAULT_ORIENTATION;
m_align = GUIHelpers::eAlign::DEFAULT_ALIGN;
m_layout = GUIHelpers::eLayout::DEFAULT_LAYOUT;
m_pos = { -1, -1 };
m_size = { -1, -1 };
m_pad = { -1, -1, -1, -1 };
}
: m_loadDef(false), m_debugXML(false), m_orientation(GUIHelpers::eOrientation::DEFAULT_ORIENTATION),
m_align(GUIHelpers::eAlign::DEFAULT_ALIGN), m_layout(GUIHelpers::eLayout::DEFAULT_LAYOUT), m_pos({ -1, -1 }),
m_size({ -1, -1 }), m_pad({ -1, -1, -1, -1 })
{}
cXMLoader::~cXMLoader()
{}
///Functions
/// Functions
void cXMLoader::Load( const cString& filename, const cString& dir /*= ""*/, GUIEngine::cWindow* parent /*= nullptr*/ )
{
cString file = dir + filename;
@@ -83,14 +77,17 @@ void cXMLoader::GetElement( tinyxml2::XMLElement& element, GUIEngine::cWindow* p
tmp->Resize();
}
const cString& cXMLoader::GetAttribute( const tinyxml2::XMLElement& element, const cString& attribute ) const
const cString cXMLoader::GetAttribute( const tinyxml2::XMLElement& element, const cString& attribute ) const
{
cString rtn;
cString rtn = "";
const char* str = element.Attribute(attribute.c_str());
if ((str == nullptr) && (m_debugXML == true))
cUtility::Inst().Message("Error no attribute: " + attribute + " found in tag <" + element.Value() + ">");
else
rtn = str;
else {
if (str != nullptr)
rtn = str;
}
//rtn = str;
return rtn;
}
@@ -211,12 +208,12 @@ GUIEngine::cBoxSizer* cXMLoader::BoxSizerBuild(const tinyxml2::XMLElement& eleme
return rtn;
}
const cString& cXMLoader::getDir(const tinyxml2::XMLElement& element) const
const cString cXMLoader::getDir(const tinyxml2::XMLElement& element) const
{
return GetAttribute(element, "dir");
}
const cString& cXMLoader::getFileName(const tinyxml2::XMLElement& element) const
const cString cXMLoader::getFileName(const tinyxml2::XMLElement& element) const
{
return GetAttribute(element, "filename");
}
@@ -315,7 +312,7 @@ const GUIHelpers::eLayout cXMLoader::getLayout( const tinyxml2::XMLElement& elem
return rtn;
}
const GUIHelpers::Position& cXMLoader::getPosition( const tinyxml2::XMLElement& element ) const
const GUIHelpers::Position cXMLoader::getPosition( const tinyxml2::XMLElement& element ) const
{
GUIHelpers::Position rtn = { -1, -1 };
@@ -337,7 +334,7 @@ const GUIHelpers::Position& cXMLoader::getPosition( const tinyxml2::XMLElement&
return rtn;
}
const GUIHelpers::Size& cXMLoader::getSize( const tinyxml2::XMLElement& element ) const
const GUIHelpers::Size cXMLoader::getSize( const tinyxml2::XMLElement& element ) const
{
GUIHelpers::Size rtn = { -1, -1 };
@@ -359,7 +356,7 @@ const GUIHelpers::Size& cXMLoader::getSize( const tinyxml2::XMLElement& element
return rtn;
}
const GUIHelpers::Padding& cXMLoader::getPadding( const tinyxml2::XMLElement& element ) const
const GUIHelpers::Padding cXMLoader::getPadding( const tinyxml2::XMLElement& element ) const
{
GUIHelpers::Padding rtn = { -1, -1, -1, -1 };
@@ -385,12 +382,12 @@ const GUIHelpers::Padding& cXMLoader::getPadding( const tinyxml2::XMLElement& el
return rtn;
}
const cString& cXMLoader::getText( const tinyxml2::XMLElement& element ) const
const cString cXMLoader::getText( const tinyxml2::XMLElement& element ) const
{
return GetAttribute(element, "text");
}
const GUIHelpers::RGBA& cXMLoader::getColour( const tinyxml2::XMLElement& element ) const
const GUIHelpers::RGBA cXMLoader::getColour( const tinyxml2::XMLElement& element ) const
{
GUIHelpers::RGBA rtn = GUIHelpers::DEFAULT;
cString str = GetAttribute(element, "colour");
@@ -31,7 +31,7 @@ namespace GUIHelpers {
private:
void GetElement( tinyxml2::XMLElement& element, GUIEngine::cWindow* parent = nullptr ) const;
const cString& GetAttribute( const tinyxml2::XMLElement& element, const cString& attribute ) const;
const cString GetAttribute( const tinyxml2::XMLElement& element, const cString& attribute ) const;
void Include( const tinyxml2::XMLElement& element, GUIEngine::cWindow* parent ) const;
void GUISetup( const tinyxml2::XMLElement& element ) const;
@@ -43,34 +43,34 @@ namespace GUIHelpers {
GUIEngine::cLabel* LabelBuild( const tinyxml2::XMLElement& element, GUIEngine::cWindow* parent ) const;
GUIEngine::cBoxSizer* BoxSizerBuild( const tinyxml2::XMLElement& element, GUIEngine::cWindow* parent ) const;
const cString& getDir( const tinyxml2::XMLElement& element ) const;
const cString& getFileName( const tinyxml2::XMLElement& element ) const;
const cString getDir( const tinyxml2::XMLElement& element ) const;
const cString getFileName( const tinyxml2::XMLElement& element ) const;
const unsigned long int getDebug( const tinyxml2::XMLElement& element ) const;
const bool cXMLoader::getDebugXML(const tinyxml2::XMLElement& element) const;
const signed long int getID( const tinyxml2::XMLElement& element ) const;
const GUIHelpers::eOrientation getOrientation( const tinyxml2::XMLElement& element ) const;
const GUIHelpers::eAlign getAlign( const tinyxml2::XMLElement& element ) const;
const GUIHelpers::eLayout getLayout( const tinyxml2::XMLElement& element ) const;
const GUIHelpers::Position& getPosition( const tinyxml2::XMLElement& element ) const;
const GUIHelpers::Size& getSize( const tinyxml2::XMLElement& element ) const;
const GUIHelpers::Padding& getPadding( const tinyxml2::XMLElement& element ) const;
const cString& getText( const tinyxml2::XMLElement& element ) const;
const GUIHelpers::Position getPosition( const tinyxml2::XMLElement& element ) const;
const GUIHelpers::Size getSize( const tinyxml2::XMLElement& element ) const;
const GUIHelpers::Padding getPadding( const tinyxml2::XMLElement& element ) const;
const cString getText( const tinyxml2::XMLElement& element ) const;
const GUIHelpers::RGBA& getColour( const tinyxml2::XMLElement& element ) const;
const GUIHelpers::RGBA getColour( const tinyxml2::XMLElement& element ) const;
const signed long int getFontSize( const tinyxml2::XMLElement& element ) const;
void LoadDefault() const;
private:
bool m_loadDef;// = false;
bool m_debugXML;
bool m_loadDef;/// = false;
bool m_debugXML;/// = false;
GUIHelpers::eOrientation m_orientation;// = GUIHelpers::eOrientation::DEFAULT_ORIENTATION;
GUIHelpers::eAlign m_align;// = GUIHelpers::eAlign::DEFAULT_ALIGN;
GUIHelpers::eLayout m_layout;// = GUIHelpers::eLayout::DEFAULT_LAYOUT;
GUIHelpers::Position m_pos;// = { -1, -1 };
GUIHelpers::Size m_size;// = { -1, -1 };
GUIHelpers::Padding m_pad;// = { -1, -1, -1, -1 };
GUIHelpers::eOrientation m_orientation;/// = GUIHelpers::eOrientation::DEFAULT_ORIENTATION;
GUIHelpers::eAlign m_align;/// = GUIHelpers::eAlign::DEFAULT_ALIGN;
GUIHelpers::eLayout m_layout;/// = GUIHelpers::eLayout::DEFAULT_LAYOUT;
GUIHelpers::Position m_pos;/// = { -1, -1 };
GUIHelpers::Size m_size;/// = { -1, -1 };
GUIHelpers::Padding m_pad;/// = { -1, -1, -1, -1 };
};/// END CLASS DEFINITION cXMLoader
}/// END NAMESPACE DEFINITION GUIHelpers
#endif/// END IFNDEF _CXMLOADER_HPP_
@@ -15,7 +15,7 @@ cBoxSizer::cBoxSizer( cWindow* parent, const signed int id, const GUIHelpers::eA
/*virtual*/ cBoxSizer::~cBoxSizer()
{}
///Functions
/// Functions
void cBoxSizer::Create( cWindow* parent, const signed int id, const GUIHelpers::eAlign& align /*= sALIGN*/, const GUIHelpers::eLayout& layout /*= sLAYOUT*/,
const GUIHelpers::Position& pos/* = sPOSITION*/, const GUIHelpers::Size& size /*= sSIZE*/, const GUIHelpers::Padding& padding /*= sPADDING*/,
const cString& name /*= sNAME*/ )
@@ -31,7 +31,7 @@ namespace GUIEngine {
const cString& name = sNAME );
virtual ~cBoxSizer();
///Functions
/// Functions
void Create( cWindow* parent, const signed int id, const GUIHelpers::eAlign& align = sALIGN, const GUIHelpers::eLayout& layout = sLAYOUT,
const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE, const GUIHelpers::Padding& padding = sPADDING,
const cString& name = sNAME );
@@ -39,7 +39,7 @@ cButton::cButton( cWindow* parent, const signed int id, const GUIHelpers::eAlign
}
///Functions
/// Functions
void cButton::Create( cWindow* parent, const signed int id, const GUIHelpers::eAlign& align /*= sALIGN*/, const GUIHelpers::eLayout& layout /*= sLAYOUT*/,
const GUIHelpers::Position& pos /*= sPOSITION*/, const GUIHelpers::Size& size /*= sSIZE*/, const GUIHelpers::Padding& padding /*= sPADDING*/,
const cString& name /*= sNAME*/, VideoEngine::cImage** image /*= nullptr*/ )
@@ -68,7 +68,7 @@ void cButton::Create( cWindow* parent, const signed int id, const GUIHelpers::eA
// }
// }
///Gets
/// Gets
// const cString cButton::getLabel() const
// {
// cString rtn = "";
@@ -83,7 +83,7 @@ void cButton::Create( cWindow* parent, const signed int id, const GUIHelpers::eA
}
//private
/// private
void cButton::GenerateImage()
{
GenerateTexture();
@@ -35,16 +35,16 @@ namespace GUIEngine {
const cString& name = sNAME, VideoEngine::cImage** image = nullptr );
virtual ~cButton();
///Functions
/// Functions
void Create( cWindow* parent, const signed int id, const GUIHelpers::eAlign& align = sALIGN, const GUIHelpers::eLayout& layout = sLAYOUT,
const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE, const GUIHelpers::Padding& padding = sPADDING,
const cString& name = sNAME, VideoEngine::cImage** image = nullptr );
virtual void Press();
//Sets
/// Sets
///Gets
/// Gets
virtual const GUIHelpers::eType getType() const;
private:
@@ -53,11 +53,11 @@ namespace GUIEngine {
void GenerateTexture();
private:
VideoEngine::cImage* mp_texture;// = nullptr
VideoEngine::cImage* mp_texturePress;// = nullptr
VideoEngine::cImage* mp_texture;/// = nullptr
VideoEngine::cImage* mp_texturePress;/// = nullptr
//Pointer to the image that will be displayed on the button.
VideoEngine::cImage** mpp_image;// = nullptr
VideoEngine::cImage** mpp_image;/// = nullptr
};/// END CLASS DEFINITION cButton
}/// END NAMESPACE DEFINITION GUIEngine
#endif/// END IFNDEF _CBUTTON_HPP_
@@ -111,7 +111,7 @@ void cGUI::Display()
}
}
///Sets
/// Sets
void cGUI::setDebugLevel(const unsigned long int debugLevel)
{
m_debugLevel = debugLevel;
@@ -159,7 +159,7 @@ void cGUI::setAlign( const GUIHelpers::eAlign& align /*= GUIHelpers::eAlign::CEN
//cWindow::sALIGN = align;
}
///Gets
/// Gets
const unsigned long int cGUI::getDebugLevel() const
{
return m_debugLevel;
@@ -36,7 +36,7 @@ namespace GUIEngine {
MouseButton3,
Keyboard
};
///Functions
/// Functions
static cGUI& Inst();
static void Delete();
@@ -51,7 +51,7 @@ namespace GUIEngine {
void Display();
///Sets
/// Sets
void setDebugLevel( const unsigned long int debugLevel );
void setFont( TextTypeEngine::cFont* font );
@@ -65,7 +65,7 @@ namespace GUIEngine {
void setAlign( const GUIHelpers::eAlign& align = GUIHelpers::eAlign::CENTER );
///Gets
/// Gets
const unsigned long int getDebugLevel() const;
TextTypeEngine::cFont* getFont();
@@ -81,14 +81,14 @@ namespace GUIEngine {
const bool IsInit() const;
private:
static cGUI* sp_inst;// = nullptr
static cGUI* sp_inst;/// = nullptr
unsigned long int m_debugLevel;// = 0
unsigned long int m_debugLevel;/// = 0
bool m_inited;// = false
bool m_inited;/// = false
/* default GUI font */
TextTypeEngine::cFont* mp_font;// = nullptr
TextTypeEngine::cFont* mp_font;/// = nullptr
/* default GUI text colour black*/
//GUIHelpers::RBGA m_textColour;// = { 0, 0, 0 }
@@ -19,7 +19,7 @@ cLabel::cLabel(cWindow* parent, const signed int id, const cString& label /*= ""
mp_text = nullptr;
}
///Functions
/// Functions
void cLabel::Create(cWindow* parent, const signed int id, const cString& label /*= ""*/, const GUIHelpers::eAlign& align /*= sALIGN*/,
const GUIHelpers::eLayout& layout /*= sLAYOUT*/, const GUIHelpers::Position& pos /*= sPOSITION*/, const GUIHelpers::Size& size /*= sSIZE*/,
const GUIHelpers::Padding& padding /*= sPADDING*/, const cString& name /*= sNAME*/)
@@ -53,7 +53,7 @@ void cLabel::GenerateTexture()
//this->setPosition()
}
//Sets
/// Sets
void cLabel::setFontColour(const GUIHelpers::RGBA& colour)
{
mp_text->setColour(colour);
@@ -76,7 +76,7 @@ void cLabel::setFont(const TextTypeEngine::cFont* font)
mp_text->setFont((TextTypeEngine::cFont**)(&font));
}
///Gets
/// Gets
const GUIHelpers::RGBA& cLabel::getFontColour() const
{
return mp_text->getColour();
@@ -24,7 +24,7 @@ namespace GUIEngine {
const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME);
virtual ~cLabel();
///Functions
/// Functions
void Create(cWindow* parent, const signed int id, const cString& label = "", const GUIHelpers::eAlign& align = sALIGN,
const GUIHelpers::eLayout& layout = sLAYOUT, const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE,
const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME);
@@ -33,13 +33,13 @@ namespace GUIEngine {
void GenerateTexture();
//Sets
/// Sets
void setFontColour( const GUIHelpers::RGBA& colour );
void setFontSize( const unsigned long int size );
void setText( const cString& text );
void setFont( const TextTypeEngine::cFont* font );
///Gets
/// Gets
const GUIHelpers::RGBA& getFontColour() const;
const unsigned long int getFontSize() const;
const TextTypeEngine::cFont* getFont() const;
@@ -58,7 +58,7 @@ namespace GUIEngine {
private:
VideoEngine::cSprite m_sprite;
TextTypeEngine::cText* mp_text;// = nullptr
TextTypeEngine::cText* mp_text;/// = nullptr
};/// END CLASS DEFINITION cLabel
}/// END NAMESPACE DEFINITION GUIEngine
#endif/// END IFNDEF _CLABEL_HPP_
@@ -15,7 +15,7 @@ cLayout::cLayout(cWindow* parent, const signed int id, const GUIHelpers::eOrient
/*virtual*/ cLayout::~cLayout()
{}
///Functions
/// Functions
/*virtual*/ void cLayout::Create(cWindow* parent, const signed int id, const GUIHelpers::eOrientation& orientation /*= sORIENTATION*/, const GUIHelpers::eAlign& align /*= sALIGN*/,
const GUIHelpers::eLayout& layout /*= sLAYOUT*/, const GUIHelpers::Position& pos /*= sPOSITION*/, const GUIHelpers::Size& size /*= sSIZE*/,
const GUIHelpers::Padding& padding/* = sPADDING*/, const cString& name /*= sNAME*/)
@@ -34,10 +34,9 @@ cLayout::cLayout(cWindow* parent, const signed int id, const GUIHelpers::eOrient
cWindow::Display();
}
///Set
///Get
/// Set
/// Get
/*virtual*/ const GUIHelpers::eType cLayout::getType() const
{
return GUIHelpers::eType::CLAYOUT;
@@ -30,16 +30,16 @@ namespace GUIEngine {
const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME );
virtual ~cLayout();
///Functions
/// Functions
virtual void Create( cWindow* parent, const signed int id, const GUIHelpers::eOrientation& orientation = sORIENTATION, const GUIHelpers::eAlign& align = sALIGN,
const GUIHelpers::eLayout& layout = sLAYOUT, const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE,
const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME );
virtual void Display();
///Set
/// Set
///Get
/// Get
virtual const GUIHelpers::eType getType() const;
virtual const GUIHelpers::RGBA& getDebugColour() const;
@@ -15,7 +15,7 @@ cPanel::cPanel( cWindow* parent /*= nullptr*/, const signed int id /*= -1*/, con
/*virtual*/ cPanel::~cPanel()
{}
///Functions
/// Functions
/*virtual*/ void cPanel::Create(cWindow* parent /*= nullptr*/, const signed int id /*= -1*/, const GUIHelpers::eOrientation& orientation /*= sORIENTATION*/, const GUIHelpers::eAlign& align /*= sALIGN*/,
const GUIHelpers::eLayout& layout /*= sLAYOUT*/, const GUIHelpers::Position& pos /*= sPOSITION*/, const GUIHelpers::Size& size /*= sSIZE*/,
const GUIHelpers::Padding& padding /*= sPADDING*/, const cString& name /*= sNAME*/)
@@ -25,7 +25,7 @@ namespace GUIEngine {
const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME );
virtual ~cPanel();
///Functions
/// Functions
virtual void Create( cWindow* parent = nullptr, const signed int id = -1, const GUIHelpers::eOrientation& orientation = sORIENTATION, const GUIHelpers::eAlign& align = sALIGN,
const GUIHelpers::eLayout& layout = sLAYOUT, const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE,
const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME );
@@ -24,7 +24,7 @@ void cTextButton::Create(cWindow* parent, const signed int id, const cString& te
setText(text);
}
//Sets
/// Sets
void cTextButton::setText(const cString& text)
{
m_label.setText(text);
@@ -40,7 +40,7 @@ void cTextButton::setTextSize(const unsigned long int size)
m_label.setSize(size);
}
///Gets
/// Gets
const cString& cTextButton::getText() const
{
return m_label.getText();
@@ -33,17 +33,17 @@ namespace GUIEngine {
const GUIHelpers::Size& size = sSIZE, const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME);
virtual ~cTextButton();
///Functions
/// Functions
void Create(cWindow* parent, const signed int id, const cString& text, const GUIHelpers::eAlign& align = GUIHelpers::eAlign::CENTER,
const GUIHelpers::eLayout& layout = GUIHelpers::eLayout::FILL_PARENT, const GUIHelpers::Position& pos = sPOSITION,
const GUIHelpers::Size& size = sSIZE, const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME);
//Sets
/// Sets
void setText( const cString& text );
void setTextColour( const GUIHelpers::RGBA& colour );
void setTextSize( const unsigned long int size );
///Gets
/// Gets
const cString& getText() const;
const GUIHelpers::RGBA& getTextColour();
const unsigned long int getTextSize();
@@ -56,7 +56,7 @@ namespace GUIEngine {
void GenerateTexture();
private:
cLabel m_label;// = nullptr
cLabel m_label;/// = nullptr
};/// END CLASS DEFINITION cButton
}/// END NAMESPACE DEFINITION GUIEngine
#endif/// END IFNDEF _CBUTTON_HPP_
@@ -63,7 +63,7 @@ cWindow::cWindow( cWindow* parent /*= nullptr*/, const signed int id /*= -1*/, c
DebugDisplay();
}
///Functions
/// Functions
const bool cWindow::Inside( const MathEngine::iVector2& location ) const
{
bool rtn = false;
@@ -96,7 +96,7 @@ const bool cWindow::RemoveChild( cWindow* obj )
return rtn;
}
///Sets
/// Sets
/*static*/ void cWindow::PositionDefault( const GUIHelpers::Position& pos )
{
if (pos.x >= 0)
@@ -197,7 +197,7 @@ void cWindow::setParent( cWindow* parent )
mp_parent = parent;
}
///Gets
/// Gets
const GUIHelpers::Position cWindow::getCenter( const bool pad /*= true*/ ) const
{
GUIHelpers::Position rtn = { 0, 0 };
@@ -292,7 +292,7 @@ cWindow* cWindow::getParent()
return GUIHelpers::eType::CWINDOW;
}
///Protected
/// protected
/*virtual*/ void cWindow::Resize()
{
@@ -459,14 +459,14 @@ std::vector<cWindow*>& cWindow::getChildren()
return m_children;
}
//private
void cWindow::AddSize( int x, int y, GUIHelpers::Size& mySize ) const
/// private
void cWindow::AddSize( const int x, const int y, GUIHelpers::Size& mySize ) const
{
int& addFrom = x;
int& largestFrom = y;
int addFrom = x;
int largestFrom = y;
int& addTo = mySize.x;
int& largestTo = mySize.y;
int addTo = mySize.x;
int largestTo = mySize.y;
if (m_orientation == GUIHelpers::eOrientation::HORIZONTAL) {
addFrom = y;
@@ -45,7 +45,7 @@ namespace GUIEngine {
const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME );
public:
///Functions
/// Functions
virtual void Display();
const bool Inside( const MathEngine::iVector2& location ) const;
@@ -54,7 +54,7 @@ namespace GUIEngine {
const bool RemoveChild( cWindow* obj );
///Sets
/// Sets
static void PositionDefault( const GUIHelpers::Position& pos );
static void SizeDefault( const GUIHelpers::Size& size );
static void PaddingDefault( const GUIHelpers::Padding& pad );
@@ -73,7 +73,7 @@ namespace GUIEngine {
void setParent( cWindow* parent );
///Gets
/// Gets
const GUIHelpers::Position getCenter( const bool pad = true ) const;
const GUIHelpers::eOrientation& getOrientation() const;
@@ -105,22 +105,22 @@ namespace GUIEngine {
private:
void Rebuild( cWindow* const parent, const GUIHelpers::eLayout& layout );
void AddSize( int x, int y, GUIHelpers::Size& mySize ) const;
void AddSize( const int x, const int y, GUIHelpers::Size& mySize ) const;
void DebugDisplay() const;
private:
GUIHelpers::eOrientation m_orientation;// = GUIHelper::eOrientation::NONE;
GUIHelpers::eAlign m_align;// = GUIHelper::eAlign::CENTER;
GUIHelpers::eLayout m_layout;// = GUIHelper::eLayout::FILL_PARENT;
GUIHelpers::Position m_pos;// = POSITION;
GUIHelpers::Size m_size;// = SIZE;
GUIHelpers::Padding m_padding;// = PADDING;
GUIHelpers::Size m_content;// = m_size;
cString m_name;// = NAME;
GUIHelpers::eOrientation m_orientation;/// = GUIHelper::eOrientation::NONE;
GUIHelpers::eAlign m_align;/// = GUIHelper::eAlign::CENTER;
GUIHelpers::eLayout m_layout;/// = GUIHelper::eLayout::FILL_PARENT;
GUIHelpers::Position m_pos;/// = POSITION;
GUIHelpers::Size m_size;/// = SIZE;
GUIHelpers::Padding m_padding;/// = PADDING;
GUIHelpers::Size m_content;/// = m_size;
cString m_name;/// = sNAME;
std::vector<cWindow*> m_children;
cWindow* mp_parent;// = nullptr;
cWindow* mp_parent;/// = nullptr;
};/// END CLASS DEFINITION cBoxSizer
}/// END NAMESPACE DEFINITION GUIEngine
#endif/// END IFNDEF _CBOXSIZER_HPP_