cWindows removed Ref from enum gets and sets

This commit is contained in:
2018-08-30 10:25:29 -04:00
parent 335166ea00
commit ba16cd4bd4
3 changed files with 30 additions and 30 deletions
@@ -20,8 +20,8 @@ using GUIEngine::cWindow;
/*static*/ GUIHelpers::eLayout cWindow::sLAYOUT = GUIHelpers::eLayout::FILL_PARENT; /*static*/ GUIHelpers::eLayout cWindow::sLAYOUT = GUIHelpers::eLayout::FILL_PARENT;
/*static*/ GUIHelpers::eOrientation cWindow::sORIENTATION = GUIHelpers::eOrientation::NONE; /*static*/ GUIHelpers::eOrientation cWindow::sORIENTATION = GUIHelpers::eOrientation::NONE;
cWindow::cWindow( cWindow* parent /*= nullptr*/, const signed int id /*= -1*/, const GUIHelpers::eOrientation& orientation /*= sORIENTATION*/, const GUIHelpers::eAlign& align /*= sALIGN*/, cWindow::cWindow( 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::eLayout layout /*= sLAYOUT*/, const GUIHelpers::Position& pos /*= sPOSITION*/, const GUIHelpers::Size& size /*= sSIZE*/,
const GUIHelpers::Padding& padding /*= sPADDING*/, const cString& name /*= sNAME*/ ) const GUIHelpers::Padding& padding /*= sPADDING*/, const cString& name /*= sNAME*/ )
: cObject(id) : cObject(id)
{ {
@@ -37,8 +37,8 @@ cWindow::cWindow( cWindow* parent /*= nullptr*/, const signed int id /*= -1*/, c
m_children.clear(); m_children.clear();
} }
/*virtual*/ void cWindow::Create( cWindow* parent /*= nullptr*/, const signed int id /*= -1*/, const GUIHelpers::eOrientation& orientation /*= sORIENTATION*/, const GUIHelpers::eAlign& align /*= sALIGN*/, /*virtual*/ void cWindow::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::eLayout layout /*= sLAYOUT*/, const GUIHelpers::Position& pos /*= sPOSITION*/, const GUIHelpers::Size& size /*= sSIZE*/,
const GUIHelpers::Padding& padding /*= sPADDING*/, const cString& name /*= sNAME*/ ) const GUIHelpers::Padding& padding /*= sPADDING*/, const cString& name /*= sNAME*/ )
{ {
mp_parent = parent; mp_parent = parent;
@@ -119,25 +119,25 @@ const bool cWindow::RemoveChild( cWindow* obj )
sPADDING = pad; sPADDING = pad;
} }
/*static*/ void cWindow::AlignDefault( const GUIHelpers::eAlign& align ) /*static*/ void cWindow::AlignDefault( const GUIHelpers::eAlign align )
{ {
if (align != GUIHelpers::eAlign::DEFAULT_ALIGN) if (align != GUIHelpers::eAlign::DEFAULT_ALIGN)
sALIGN = align; sALIGN = align;
} }
/*static*/ void cWindow::LayoutDefault( const GUIHelpers::eLayout& layout ) /*static*/ void cWindow::LayoutDefault( const GUIHelpers::eLayout layout )
{ {
if (layout != GUIHelpers::eLayout::DEFAULT_LAYOUT) if (layout != GUIHelpers::eLayout::DEFAULT_LAYOUT)
sLAYOUT = layout; sLAYOUT = layout;
} }
/*static*/ void cWindow::OrientationDefault( const GUIHelpers::eOrientation& orientation ) /*static*/ void cWindow::OrientationDefault( const GUIHelpers::eOrientation orientation )
{ {
if (orientation != GUIHelpers::eOrientation::DEFAULT_ORIENTATION) if (orientation != GUIHelpers::eOrientation::DEFAULT_ORIENTATION)
sORIENTATION = orientation; sORIENTATION = orientation;
} }
void cWindow::setOrientation( const GUIHelpers::eOrientation& orientation /*= sORIENTATION*/ ) void cWindow::setOrientation( const GUIHelpers::eOrientation orientation /*= sORIENTATION*/ )
{ {
if (orientation == GUIHelpers::eOrientation::DEFAULT_ORIENTATION) if (orientation == GUIHelpers::eOrientation::DEFAULT_ORIENTATION)
m_orientation = cWindow::sORIENTATION; m_orientation = cWindow::sORIENTATION;
@@ -145,7 +145,7 @@ void cWindow::setOrientation( const GUIHelpers::eOrientation& orientation /*= sO
m_orientation = orientation; m_orientation = orientation;
} }
void cWindow::setAlign( const GUIHelpers::eAlign& align /*= sALIGN*/ ) void cWindow::setAlign( const GUIHelpers::eAlign align /*= sALIGN*/ )
{ {
if (align == GUIHelpers::eAlign::DEFAULT_ALIGN) if (align == GUIHelpers::eAlign::DEFAULT_ALIGN)
m_align = cWindow::sALIGN; m_align = cWindow::sALIGN;
@@ -154,7 +154,7 @@ void cWindow::setAlign( const GUIHelpers::eAlign& align /*= sALIGN*/ )
RebuildPos(); RebuildPos();
} }
void cWindow::setLayout( const GUIHelpers::eLayout& layout /*= sLAYOUT*/ ) void cWindow::setLayout( const GUIHelpers::eLayout layout /*= sLAYOUT*/ )
{ {
if (layout == GUIHelpers::eLayout::DEFAULT_LAYOUT) if (layout == GUIHelpers::eLayout::DEFAULT_LAYOUT)
m_layout = cWindow::sLAYOUT; m_layout = cWindow::sLAYOUT;
@@ -214,17 +214,17 @@ const GUIHelpers::Position cWindow::getCenter( const bool pad /*= true*/ ) const
return rtn; return rtn;
} }
const GUIHelpers::eOrientation& cWindow::getOrientation() const const GUIHelpers::eOrientation cWindow::getOrientation() const
{ {
return m_orientation; return m_orientation;
} }
const GUIHelpers::eAlign& cWindow::getAlign() const const GUIHelpers::eAlign cWindow::getAlign() const
{ {
return m_align; return m_align;
} }
const GUIHelpers::eLayout& cWindow::getLayout() const const GUIHelpers::eLayout cWindow::getLayout() const
{ {
if (m_layout == GUIHelpers::eLayout::MATCH_PARENT) { if (m_layout == GUIHelpers::eLayout::MATCH_PARENT) {
if (mp_parent != nullptr) if (mp_parent != nullptr)
@@ -343,7 +343,7 @@ const unsigned long int cWindow::getFillParentSize()
RePos(); RePos();
} }
/*virtual*/ void cWindow::RebuildLayout( const GUIHelpers::eLayout& layout ) /*virtual*/ void cWindow::RebuildLayout( const GUIHelpers::eLayout layout )
{ {
GUIHelpers::Size mySize = { 0, 0 }; GUIHelpers::Size mySize = { 0, 0 };
std::vector<cWindow*>::iterator it; std::vector<cWindow*>::iterator it;
@@ -510,7 +510,7 @@ std::vector<cWindow*>& cWindow::getChildren()
} }
/// private /// private
void cWindow::Rebuild(cWindow * const parent, const GUIHelpers::eLayout & layout) void cWindow::Rebuild(cWindow * const parent, const GUIHelpers::eLayout layout)
{ {
} }
@@ -32,16 +32,16 @@ namespace GUIEngine {
static GUIHelpers::eOrientation sORIENTATION; /*= GUIHelpers::eOrientation::NONE;*/ static GUIHelpers::eOrientation sORIENTATION; /*= GUIHelpers::eOrientation::NONE;*/
protected: protected:
cWindow( cWindow* parent = nullptr, const signed int id = -1, const GUIHelpers::eOrientation& orientation = sORIENTATION, const GUIHelpers::eAlign& align = sALIGN, cWindow( 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::eLayout layout = sLAYOUT, const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE,
const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME ); const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME );
public: public:
virtual ~cWindow(); virtual ~cWindow();
protected: protected:
virtual void Create( cWindow* parent = nullptr, const signed int id = -1, const GUIHelpers::eOrientation& orientation = sORIENTATION, const GUIHelpers::eAlign& align = sALIGN, 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::eLayout layout = sLAYOUT, const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE,
const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME ); const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME );
public: public:
@@ -58,13 +58,13 @@ namespace GUIEngine {
static void PositionDefault( const GUIHelpers::Position& pos ); static void PositionDefault( const GUIHelpers::Position& pos );
static void SizeDefault( const GUIHelpers::Size& size ); static void SizeDefault( const GUIHelpers::Size& size );
static void PaddingDefault( const GUIHelpers::Padding& pad ); static void PaddingDefault( const GUIHelpers::Padding& pad );
static void AlignDefault( const GUIHelpers::eAlign& align ); static void AlignDefault( const GUIHelpers::eAlign align );
static void LayoutDefault( const GUIHelpers::eLayout& layout ); static void LayoutDefault( const GUIHelpers::eLayout layout );
static void OrientationDefault( const GUIHelpers::eOrientation& orientation ); static void OrientationDefault( const GUIHelpers::eOrientation orientation );
void setOrientation( const GUIHelpers::eOrientation& orientation = sORIENTATION ); void setOrientation( const GUIHelpers::eOrientation orientation = sORIENTATION );
void setAlign( const GUIHelpers::eAlign& align = sALIGN ); void setAlign( const GUIHelpers::eAlign align = sALIGN );
void setLayout( const GUIHelpers::eLayout& layout = sLAYOUT ); void setLayout( const GUIHelpers::eLayout layout = sLAYOUT );
void setPosition( const GUIHelpers::Position& pos = sPOSITION ); void setPosition( const GUIHelpers::Position& pos = sPOSITION );
void setSize( const GUIHelpers::Size& size = sSIZE ); void setSize( const GUIHelpers::Size& size = sSIZE );
void setPadding( const GUIHelpers::Padding& padding = sPADDING ); void setPadding( const GUIHelpers::Padding& padding = sPADDING );
@@ -76,9 +76,9 @@ namespace GUIEngine {
/// Gets /// Gets
const GUIHelpers::Position getCenter( const bool pad = true ) const; const GUIHelpers::Position getCenter( const bool pad = true ) const;
const GUIHelpers::eOrientation& getOrientation() const; const GUIHelpers::eOrientation getOrientation() const;
const GUIHelpers::eAlign& getAlign() const; const GUIHelpers::eAlign getAlign() const;
const GUIHelpers::eLayout& getLayout() const; const GUIHelpers::eLayout getLayout() const;
const GUIHelpers::Position getPosition( const bool pad = true ) const; const GUIHelpers::Position getPosition( const bool pad = true ) const;
const GUIHelpers::Size getSize( const bool pad = true ) const; const GUIHelpers::Size getSize( const bool pad = true ) const;
const GUIHelpers::Padding& getPadding() const; const GUIHelpers::Padding& getPadding() const;
@@ -94,7 +94,7 @@ namespace GUIEngine {
virtual const GUIHelpers::eType getType() const; virtual const GUIHelpers::eType getType() const;
virtual void Resize(); virtual void Resize();
virtual void RebuildLayout( const GUIHelpers::eLayout& layout ); virtual void RebuildLayout( const GUIHelpers::eLayout layout );
virtual void RePos(); virtual void RePos();
virtual void RebuildPos(); virtual void RebuildPos();
@@ -105,7 +105,7 @@ namespace GUIEngine {
std::vector<cWindow*>& getChildren(); std::vector<cWindow*>& getChildren();
private: private:
void Rebuild( cWindow* const parent, const GUIHelpers::eLayout& layout ); void Rebuild( cWindow* const parent, const GUIHelpers::eLayout layout );
void AddSize( const int x, const int y, GUIHelpers::Size& mySize ) const; void AddSize( const int x, const int y, GUIHelpers::Size& mySize ) const;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 60 KiB