diff options
author | crupest <crupest@outlook.com> | 2020-03-03 00:39:10 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-03-03 00:39:10 +0800 |
commit | b0946c0e6dc163fe981f230302a1976449150907 (patch) | |
tree | 3786417609ec00e42c0e9a102c39238135dfc9b5 /src/ui/controls/text_box.cpp | |
parent | ebb8f7beba71fc0d3cd81f60559e4005e05e48d5 (diff) | |
download | cru-b0946c0e6dc163fe981f230302a1976449150907.tar.gz cru-b0946c0e6dc163fe981f230302a1976449150907.tar.bz2 cru-b0946c0e6dc163fe981f230302a1976449150907.zip |
...
Diffstat (limited to 'src/ui/controls/text_box.cpp')
-rw-r--r-- | src/ui/controls/text_box.cpp | 28 |
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 |