This commit is contained in:
2018-07-31 10:50:06 -04:00
parent c040135305
commit 58fa6f0503
45 changed files with 504 additions and 295 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();
@@ -39,9 +39,7 @@ namespace GUIHelpers {
static const RGBA ROSE = { 255, 0, 128, 255 };
const RGBA StringtoRGBA(const cString& colour);
const RGBA& StringtoRGBA(const cString& colour);
}/// END NAMESPACE DEFINITION GUIHelpers
#endif/// END IFNDEF _GUIUTILITY_HPP_
@@ -83,9 +83,9 @@ 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() + ">");
@@ -211,18 +211,17 @@ 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
{
cString rtn = GetAttribute(element, "dir");
return rtn;
return GetAttribute(element, "dir");
}
const cString cXMLoader::getFileName(const tinyxml2::XMLElement& element) const
const cString& cXMLoader::getFileName(const tinyxml2::XMLElement& element) const
{
cString rtn = GetAttribute(element, "filename");
return rtn;
return GetAttribute(element, "filename");
}
const unsigned long int cXMLoader::getDebug( const tinyxml2::XMLElement& element ) const
{
unsigned long int rtn = 99;
@@ -316,7 +315,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 };
@@ -338,7 +337,7 @@ const GUIHelpers::Position cXMLoader::getPosition( const tinyxml2::XMLElement& e
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 };
@@ -360,7 +359,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 };
@@ -386,12 +385,12 @@ const GUIHelpers::Padding cXMLoader::getPadding( const tinyxml2::XMLElement& ele
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,20 +43,20 @@ 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;
@@ -34,7 +34,7 @@ void cBoxSizer::Create( cWindow* parent, const signed int id, const GUIHelpers::
return GUIHelpers::eType::CBOXSIZER;
}
/*virtual*/ const GUIHelpers::RGBA cBoxSizer::getDebugColour() const
/*virtual*/ const GUIHelpers::RGBA& cBoxSizer::getDebugColour() const
{
return GUIHelpers::CYAN;
}
@@ -37,7 +37,7 @@ namespace GUIEngine {
const cString& name = sNAME );
virtual const GUIHelpers::eType getType() const;
virtual const GUIHelpers::RGBA getDebugColour() const;
virtual const GUIHelpers::RGBA& getDebugColour() const;
private:
private:
};/// END CLASS DEFINITION cBoxSizer
@@ -102,7 +102,7 @@ const cString& cLabel::getText() const
return GUIHelpers::eType::CLABEL;
}
/*virtual*/ const GUIHelpers::RGBA cLabel::getDebugColour() const
/*virtual*/ const GUIHelpers::RGBA& cLabel::getDebugColour() const
{
return GUIHelpers::GREEN;
}
@@ -45,7 +45,7 @@ namespace GUIEngine {
const TextTypeEngine::cFont* getFont() const;
const cString& getText() const;
virtual const GUIHelpers::eType getType() const;
virtual const GUIHelpers::RGBA getDebugColour() const;
virtual const GUIHelpers::RGBA& getDebugColour() const;
//virtual void Resize();
@@ -43,7 +43,7 @@ cLayout::cLayout(cWindow* parent, const signed int id, const GUIHelpers::eOrient
return GUIHelpers::eType::CLAYOUT;
}
/*virtual*/ const GUIHelpers::RGBA cLayout::getDebugColour() const
/*virtual*/ const GUIHelpers::RGBA& cLayout::getDebugColour() const
{
return GUIHelpers::BLUE;
}
@@ -40,10 +40,9 @@ namespace GUIEngine {
///Set
///Get
virtual const GUIHelpers::eType getType() const;
virtual const GUIHelpers::RGBA getDebugColour() const;
virtual const GUIHelpers::RGBA& getDebugColour() const;
private:
GUIHelpers::eOrientation m_orientation;
@@ -34,7 +34,7 @@ cPanel::cPanel( cWindow* parent /*= nullptr*/, const signed int id /*= -1*/, con
return GUIHelpers::eType::CPANEL;
}
/*virtual*/ const GUIHelpers::RGBA cPanel::getDebugColour() const
/*virtual*/ const GUIHelpers::RGBA& cPanel::getDebugColour() const
{
return GUIHelpers::RED;
}
@@ -34,7 +34,7 @@ namespace GUIEngine {
virtual const GUIHelpers::eType getType() const;
virtual const GUIHelpers::RGBA getDebugColour() const;
virtual const GUIHelpers::RGBA& getDebugColour() const;
private:
};/// END CLASS DEFINITION cPanel
@@ -41,12 +41,12 @@ void cTextButton::setTextSize(const unsigned long int size)
}
///Gets
const cString cTextButton::getText() const
const cString& cTextButton::getText() const
{
return m_label.getText();
}
const GUIHelpers::RGBA cTextButton::getTextColour()
const GUIHelpers::RGBA& cTextButton::getTextColour()
{
return m_label.getFontColour();
}
@@ -61,6 +61,7 @@ const unsigned long int cTextButton::getTextSize()
return GUIHelpers::eType::CTEXTBUTTON;
}
/// Private
void CreateLabel()
{}
@@ -44,8 +44,8 @@ namespace GUIEngine {
void setTextSize( const unsigned long int size );
///Gets
const cString getText() const;
const GUIHelpers::RGBA getTextColour();
const cString& getText() const;
const GUIHelpers::RGBA& getTextColour();
const unsigned long int getTextSize();
virtual const GUIHelpers::eType getType() const;
@@ -449,7 +449,7 @@ cWindow* cWindow::getParent()
}
}
/*virtual*/ const GUIHelpers::RGBA cWindow::getDebugColour() const
/*virtual*/ const GUIHelpers::RGBA& cWindow::getDebugColour() const
{
return GUIHelpers::WHITE;
}
@@ -97,7 +97,7 @@ namespace GUIEngine {
virtual void RePos();
virtual void RebuildPos();
virtual const GUIHelpers::RGBA getDebugColour() const;
virtual const GUIHelpers::RGBA& getDebugColour() const;
/*protected:*/
std::vector<cWindow*>& getChildren();