aboutsummaryrefslogtreecommitdiff
path: root/src/ui/controls/text_box.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/controls/text_box.cpp')
-rw-r--r--src/ui/controls/text_box.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/ui/controls/text_box.cpp b/src/ui/controls/text_box.cpp
index 7fde06d9..07b70b94 100644
--- a/src/ui/controls/text_box.cpp
+++ b/src/ui/controls/text_box.cpp
@@ -1 +1,29 @@
#include "cru/ui/controls/text_box.hpp"
+
+#include "cru/ui/render/border_render_object.hpp"
+#include "cru/ui/render/canvas_render_object.hpp"
+#include "cru/ui/render/text_render_object.hpp"
+#include "cru/ui/ui_manager.hpp"
+
+namespace cru::ui::controls {
+using render::BorderRenderObject;
+using render::CanvasRenderObject;
+using render::TextRenderObject;
+
+TextBox::TextBox()
+ : border_render_object_(new BorderRenderObject()),
+ text_render_object_(),
+ caret_render_object_(new CanvasRenderObject()) {
+ const auto theme_resources = UiManager::GetInstance()->GetThemeResources();
+
+ text_render_object_ = std::make_unique<TextRenderObject>(
+ theme_resources->text_brush, theme_resources->default_font,
+ theme_resources->text_selection_brush);
+
+ border_render_object_->SetAttachedControl(this);
+ text_render_object_->SetAttachedControl(this);
+ caret_render_object_->SetAttachedControl(this);
+}
+
+TextBox::~TextBox() {}
+} // namespace cru::ui::controls