Files
Seele/src/Engine/UI/Elements/Element.h
T

43 lines
1015 B
C++
Raw Normal View History

2021-09-23 10:10:39 +02:00
#pragma once
#include "MinimalEngine.h"
namespace Seele
{
namespace UI
{
//Element defines any part of the UI
DECLARE_REF(Element)
class Element
{
public:
Element();
virtual ~Element();
void setParent(PElement element);
PElement getParent() const;
void addChild(PElement element);
const Array<PElement> getChildren();
void clear();
void remove(PElement element);
void setEnabled(bool newEnabled);
bool isEnabled() const;
// maybe not the healthiest inteface
// non-const version
Rect& getBoundingBox();
// The bounding box describes the relative size of any Element
// relative to the total view, meaning a bounding box of (0,0), (1,1)
// would take up the entire view
const Rect getBoundingBox() const;
protected:
Rect boundingBox;
2021-09-29 22:12:56 +02:00
bool dirty;
2021-09-23 10:10:39 +02:00
bool enabled;
PElement parent;
Array<PElement> children;
friend class Layout;
friend class RenderElement;
};
DEFINE_REF(Element)
} // namespace UI
} // namespace Seele