From ce56ab59a6d68c220fcc47c6977c618eaa43de7a Mon Sep 17 00:00:00 2001 From: crupest Date: Sun, 5 Jul 2020 18:13:10 +0800 Subject: ... --- include/cru/ui/UiEvent.hpp | 4 +++- include/cru/ui/controls/TextBlock.hpp | 3 ++- include/cru/ui/controls/TextBox.hpp | 4 +++- include/cru/ui/render/Base.hpp | 1 + 4 files changed, 9 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/cru/ui/UiEvent.hpp b/include/cru/ui/UiEvent.hpp index 29292d75..79d0f7e3 100644 --- a/include/cru/ui/UiEvent.hpp +++ b/include/cru/ui/UiEvent.hpp @@ -52,7 +52,9 @@ class RoutedEvent { static_assert(!std::is_reference_v, "TEventArgs must not be reference."); - using EventArgs = TEventArgs; + using RawEventArgs = TEventArgs; + using IEventType = IEvent; + using EventArgs = typename IEventType::EventArgs; RoutedEvent() = default; RoutedEvent(const RoutedEvent& other) = delete; diff --git a/include/cru/ui/controls/TextBlock.hpp b/include/cru/ui/controls/TextBlock.hpp index dd8b40b4..1b1b4a5c 100644 --- a/include/cru/ui/controls/TextBlock.hpp +++ b/include/cru/ui/controls/TextBlock.hpp @@ -28,7 +28,8 @@ class TextBlock : public NoChildControl { std::string GetText() const; void SetText(std::string text); - render::TextRenderObject* GetTextRenderObject(); + gsl::not_null GetTextRenderObject(); + render::ScrollRenderObject* GetScrollRenderObject() { return nullptr; } private: std::unique_ptr text_render_object_; diff --git a/include/cru/ui/controls/TextBox.hpp b/include/cru/ui/controls/TextBox.hpp index 2f7a12b6..3d4de7c0 100644 --- a/include/cru/ui/controls/TextBox.hpp +++ b/include/cru/ui/controls/TextBox.hpp @@ -27,7 +27,8 @@ class TextBox : public NoChildControl { render::RenderObject* GetRenderObject() const override; - render::TextRenderObject* GetTextRenderObject(); + gsl::not_null GetTextRenderObject(); + render::ScrollRenderObject* GetScrollRenderObject(); const TextBoxBorderStyle& GetBorderStyle(); void SetBorderStyle(TextBoxBorderStyle border_style); @@ -40,6 +41,7 @@ class TextBox : public NoChildControl { private: std::unique_ptr border_render_object_; + std::unique_ptr scroll_render_object_; std::unique_ptr text_render_object_; TextBoxBorderStyle border_style_; diff --git a/include/cru/ui/render/Base.hpp b/include/cru/ui/render/Base.hpp index c2af5e99..801d58bd 100644 --- a/include/cru/ui/render/Base.hpp +++ b/include/cru/ui/render/Base.hpp @@ -6,6 +6,7 @@ class RenderObject; class BorderRenderObject; class CanvasRenderObject; class FlexLayoutRenderObject; +class ScrollRenderObject; class StackLayoutRenderObject; class TextRenderObject; class WindowRenderObject; -- cgit v1.2.3