diff options
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/control.cpp | 10 | ||||
-rw-r--r-- | src/ui/control.h | 19 |
2 files changed, 25 insertions, 4 deletions
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<T>(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<ID2D1Geometry> margin_geometry_; Microsoft::WRL::ComPtr<ID2D1Geometry> padding_geometry_; #endif + + Cursor::Ptr cursor_{}; }; // Find the lowest common ancestor. |