From 9110574bb51e9e2959842a7641f598d34c3cd847 Mon Sep 17 00:00:00 2001 From: crupest Date: Fri, 13 Dec 2019 01:02:47 +0800 Subject: ... --- src/ui/control.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src/ui/control.cpp') diff --git a/src/ui/control.cpp b/src/ui/control.cpp index 8e8819de..5f760939 100644 --- a/src/ui/control.cpp +++ b/src/ui/control.cpp @@ -2,10 +2,9 @@ #include "cru/platform/native/basic_types.hpp" #include "cru/platform/native/cursor.hpp" -#include "cru/platform/native/native_window.hpp" #include "cru/platform/native/ui_application.hpp" +#include "cru/platform/native/window.hpp" #include "cru/ui/base.hpp" -#include "cru/ui/event/ui_event.hpp" #include "cru/ui/window.hpp" #include "routed_event_dispatch.hpp" @@ -13,9 +12,9 @@ #include namespace cru::ui { -using platform::native::Cursor; -using platform::native::SystemCursor; -using platform::native::UiApplication; +using platform::native::ICursor; +using platform::native::IUiApplication; +using platform::native::SystemCursorType; Control::Control() { MouseEnterEvent()->Direct()->AddHandler( @@ -85,20 +84,20 @@ bool Control::IsMouseCaptured() { return GetWindow()->GetMouseCaptureControl() == this; } -std::shared_ptr Control::GetCursor() { return cursor_; } +std::shared_ptr Control::GetCursor() { return cursor_; } -std::shared_ptr Control::GetInheritedCursor() { +std::shared_ptr Control::GetInheritedCursor() { Control* control = this; while (control != nullptr) { const auto cursor = control->GetCursor(); if (cursor != nullptr) return cursor; control = control->GetParent(); } - return UiApplication::GetInstance()->GetCursorManager()->GetSystemCursor( - SystemCursor::Arrow); + return IUiApplication::GetInstance()->GetCursorManager()->GetSystemCursor( + SystemCursorType::Arrow); } -void Control::SetCursor(std::shared_ptr cursor) { +void Control::SetCursor(std::shared_ptr cursor) { cursor_ = std::move(cursor); const auto window = GetWindow(); if (window != nullptr) { -- cgit v1.2.3