Files
SDLPongCPP/TrooperEngineDLL/TrooperEngine/GUIEngine/cBoxSizer.cpp
T
2018-07-31 10:50:06 -04:00

40 lines
1.4 KiB
C++

#include "cBoxSizer.hpp"
using GUIEngine::cBoxSizer;
/*static*/ const cString cBoxSizer::sNAME = "boxsizer";
/*static*/ GUIHelpers::Size cBoxSizer::sSIZE = { 5, 5 };
cBoxSizer::cBoxSizer( 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*/ )
{
Create(parent, id, align, layout, pos, size, padding, name);
}
/*virtual*/ cBoxSizer::~cBoxSizer()
{}
///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*/ )
{
GUIHelpers::Size sz = size;
if (size.x < 0)
sz = sSIZE;
cWindow::Create(parent, id, sORIENTATION, align, layout, pos, sz, padding, name);
if (this->getParent() != nullptr) {
this->getParent()->AddChild(this);
}
}
/*virtual*/ const GUIHelpers::eType cBoxSizer::getType() const
{
return GUIHelpers::eType::CBOXSIZER;
}
/*virtual*/ const GUIHelpers::RGBA& cBoxSizer::getDebugColour() const
{
return GUIHelpers::CYAN;
}