From 252519effe30881825dd02e26dc41bd9cde34782 Mon Sep 17 00:00:00 2001 From: crupest Date: Mon, 5 Nov 2018 15:38:46 +0800 Subject: ... --- src/ui/control.cpp | 10 ++++++++++ src/ui/control.h | 19 +++++++++++++++---- 2 files changed, 25 insertions(+), 4 deletions(-) (limited to 'src/ui') diff --git a/src/ui/control.cpp b/src/ui/control.cpp index 3aa8c7e2..838747bc 100644 --- a/src/ui/control.cpp +++ b/src/ui/control.cpp @@ -350,6 +350,16 @@ namespace cru { } } + void Control::SetCursor(const Cursor::Ptr& cursor) + { + + } + + Cursor::Ptr Control::GetCursorInherit() + { + + } + void Control::OnAddChild(Control* child) { if (auto window = GetWindow()) diff --git a/src/ui/control.h b/src/ui/control.h index 666d7f69..e88228d0 100644 --- a/src/ui/control.h +++ b/src/ui/control.h @@ -12,6 +12,7 @@ #include "layout_base.h" #include "events/ui_event.h" #include "border_property.h" +#include "cursor.h" namespace cru { @@ -231,6 +232,18 @@ namespace cru additional_properties_[key] = std::make_any(std::move(value)); } + + //*************** region: cursor *************** + Cursor::Ptr GetCursor() const + { + return cursor_; + } + + void SetCursor(const Cursor::Ptr& cursor); + + Cursor::Ptr GetCursorInherit(); + + //*************** region: events *************** //Raised when mouse enter the control. events::MouseEvent mouse_enter_event; @@ -346,10 +359,6 @@ namespace cru virtual Size OnMeasureContent(const Size& available_size); virtual void OnLayoutContent(const Rect& rect); - - //*************** region: cursor *************** - //TODO! - private: // Only for layout manager to use. // Check if the old position is updated to current position. @@ -408,6 +417,8 @@ namespace cru Microsoft::WRL::ComPtr margin_geometry_; Microsoft::WRL::ComPtr padding_geometry_; #endif + + Cursor::Ptr cursor_{}; }; // Find the lowest common ancestor. -- cgit v1.2.3