diff options
Diffstat (limited to 'include/cru/ui/controls/TextBox.h')
-rw-r--r-- | include/cru/ui/controls/TextBox.h | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/include/cru/ui/controls/TextBox.h b/include/cru/ui/controls/TextBox.h index 3e041880..c3d8fc4d 100644 --- a/include/cru/ui/controls/TextBox.h +++ b/include/cru/ui/controls/TextBox.h @@ -4,14 +4,19 @@ #include "../render/BorderRenderObject.h" #include "../render/TextRenderObject.h" #include "IBorderControl.h" +#include "IContentBrushControl.h" +#include "IFontControl.h" #include "TextHostControlService.h" +#include "cru/platform/graphics/Brush.h" #include <memory> namespace cru::ui::controls { class CRU_UI_API TextBox : public NoChildControl, public virtual IBorderControl, - public virtual ITextHostControl { + public virtual ITextHostControl, + public virtual IContentBrushControl, + public virtual IFontControl { public: static constexpr StringView control_type = u"TextBox"; @@ -40,6 +45,29 @@ class CRU_UI_API TextBox : public NoChildControl, return service_->TextChangeEvent(); } + std::shared_ptr<platform::graphics::IFont> GetFont() const override { + return text_render_object_->GetFont(); + } + void SetFont(std::shared_ptr<platform::graphics::IFont> font) override { + text_render_object_->SetFont(std::move(font)); + } + + std::shared_ptr<platform::graphics::IBrush> GetTextBrush() const { + return text_render_object_->GetBrush(); + } + void SetTextBrush(std::shared_ptr<platform::graphics::IBrush> brush) { + text_render_object_->SetBrush(std::move(brush)); + } + + std::shared_ptr<platform::graphics::IBrush> GetContentBrush() const override { + return GetTextBrush(); + } + + void SetContentBrush( + std::shared_ptr<platform::graphics::IBrush> brush) override { + SetTextBrush(std::move(brush)); + } + private: std::unique_ptr<render::BorderRenderObject> border_render_object_; std::unique_ptr<render::ScrollRenderObject> scroll_render_object_; |