40 lines
1.3 KiB
C++
40 lines
1.3 KiB
C++
#include "cSizer.hpp"
|
|
|
|
using GUIEngine::cSizer;
|
|
|
|
/*static*/ const cString cSizer::sNAME = "sizer";
|
|
/*static*/ GUIHelpers::Size cSizer::sSIZE = { 5, 5 };
|
|
|
|
cSizer::cSizer( 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*/ cSizer::~cSizer()
|
|
{}
|
|
|
|
/// Functions
|
|
void cSizer::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 cSizer::getType() const
|
|
{
|
|
return GUIHelpers::eType::CSIZER;
|
|
}
|
|
|
|
/*virtual*/ const GUIHelpers::RGBA& cSizer::getDebugColour() const
|
|
{
|
|
return GUIHelpers::CYAN;
|
|
} |