Pre-resize fillparent
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user