Files
ReJUI/include/JUI/Base/LayoutContainer.hpp

35 lines
1.2 KiB
C++

/// Josh's User Interface Library
/// A C++20 Library for creating, styling, and rendering of a UI/UX widgets.
/// Developed and Maintained by Josh O'Leary @ Redacted Software.
/// Special Thanks to William Tomasine II and Maxine Hayes.
/// (c) 2024 Redacted Software
/// This work is dedicated to the public domain.
/// @file LayoutContainer.hpp
/// @desc Base class for container objects. Container objects lay out widgets in a certain order.
/// @edit 2024-08-02
#pragma once
#include <JUI/Base/Widget.hpp>
namespace JUI
{
/// A base Layout Container widget.
/// Objects parented to this widget will be listed in some type of row-layout relative to the Grandparent widget.
/// i.e. Rect -> ListLayout -> Children in a list.
class LayoutContainer : public Widget
{
public:
LayoutContainer();
LayoutContainer(Widget* parent);
~LayoutContainer() override {}
void Update(float delta) override;
void Draw() override;
virtual void ApplyLayout() = 0;
Vector2 GetAbsoluteSize() const override { return parent->GetAbsoluteSize(); }
Vector2 GetAbsolutePosition() const override { return parent->GetAbsolutePosition(); }
protected:
};
}