aboutsummaryrefslogtreecommitdiff
path: root/src/ui/controls/Window.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/controls/Window.cpp')
-rw-r--r--src/ui/controls/Window.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/ui/controls/Window.cpp b/src/ui/controls/Window.cpp
new file mode 100644
index 00000000..7ce40dfe
--- /dev/null
+++ b/src/ui/controls/Window.cpp
@@ -0,0 +1,32 @@
+#include "cru/ui/controls/Window.hpp"
+
+#include "cru/common/Base.hpp"
+#include "cru/ui/host/WindowHost.hpp"
+#include "cru/ui/render/Base.hpp"
+#include "cru/ui/render/StackLayoutRenderObject.hpp"
+
+namespace cru::ui::controls {
+Window* Window::CreateOverlapped() { return new Window(); }
+
+Window::Window() : render_object_(new render::StackLayoutRenderObject()) {
+ render_object_->SetAttachedControl(this);
+ window_host_ = std::make_unique<host::WindowHost>(this);
+}
+
+Window::~Window() {}
+
+std::u16string_view Window::GetControlType() const { return control_type; }
+
+render::RenderObject* Window::GetRenderObject() const {
+ return render_object_.get();
+}
+
+void Window::OnAddChild(Control* child, Index position) {
+ render_object_->AddChild(child->GetRenderObject(), position);
+}
+
+void Window::OnRemoveChild(Control* child, Index position) {
+ CRU_UNUSED(child);
+ render_object_->RemoveChild(position);
+}
+} // namespace cru::ui::controls