2021-08-21 18:02:53 +02:00
|
|
|
#include "Element.h"
|
2021-11-14 20:36:53 +01:00
|
|
|
#include "UI/System.h"
|
2021-08-21 18:02:53 +02:00
|
|
|
|
|
|
|
|
using namespace Seele;
|
|
|
|
|
using namespace Seele::UI;
|
|
|
|
|
|
|
|
|
|
Element::Element()
|
2022-01-12 14:40:26 +01:00
|
|
|
: dirty(false)
|
|
|
|
|
, enabled(false)
|
2021-08-21 18:02:53 +02:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Element::~Element()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2021-10-15 23:12:29 +02:00
|
|
|
PElement Element::getParent() const
|
|
|
|
|
{
|
|
|
|
|
return parent;
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-23 10:10:39 +02:00
|
|
|
void Element::addChild(PElement element)
|
2021-08-21 18:02:53 +02:00
|
|
|
{
|
2021-09-23 10:10:39 +02:00
|
|
|
children.add(element);
|
2021-08-21 18:02:53 +02:00
|
|
|
}
|
|
|
|
|
|
2021-09-23 10:10:39 +02:00
|
|
|
const Array<PElement> Element::getChildren()
|
2021-08-21 18:02:53 +02:00
|
|
|
{
|
|
|
|
|
return children;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Element::clear()
|
|
|
|
|
{
|
|
|
|
|
children.clear();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Element::remove(PElement element)
|
|
|
|
|
{
|
|
|
|
|
children.remove(children.find(element));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Element::setEnabled(bool newEnabled)
|
|
|
|
|
{
|
|
|
|
|
enabled = newEnabled;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool Element::isEnabled() const
|
|
|
|
|
{
|
|
|
|
|
return enabled;
|
2021-09-23 10:10:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Rect& Element::getBoundingBox()
|
|
|
|
|
{
|
|
|
|
|
return boundingBox;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const Rect Element::getBoundingBox() const
|
|
|
|
|
{
|
|
|
|
|
return boundingBox;
|
2021-08-21 18:02:53 +02:00
|
|
|
}
|