blob: 7ce40dfe08f67a68b15bd783ce87a8fccf05887f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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
|