]> git.saurik.com Git - wxWidgets.git/commitdiff
Implement wxWindow::SetCursor to invalidate Cocoa's cursor rects.
authorDavid Elliott <dfe@tgwbd.org>
Fri, 20 Jul 2007 05:40:54 +0000 (05:40 +0000)
committerDavid Elliott <dfe@tgwbd.org>
Fri, 20 Jul 2007 05:40:54 +0000 (05:40 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47585 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/cocoa/window.h
src/cocoa/window.mm

index b30b23ac1d947e95ae112814f992b48c17ce28a9..730790e5637f99940873cf53d4cb6b49991f81f2 100644 (file)
@@ -142,6 +142,8 @@ public:
     virtual void SetFocus();
     // Warp the pointer the given position
     virtual void WarpPointer(int x_pos, int y_pos) ;
+    // Change the window's cursor
+    virtual bool SetCursor( const wxCursor &cursor );
     // Send the window a refresh event
     virtual void Refresh(bool eraseBack = true, const wxRect *rect = NULL);
     // Set/get the window's font
index 69689cbf725b957454230852e58c8af9267318f4..23fee50c2aceb67e27a6786d0badf57845bbe2ed 100644 (file)
@@ -669,6 +669,15 @@ bool wxWindowCocoa::Cocoa_resetCursorRects()
     return true;
 }
 
+bool wxWindowCocoa::SetCursor(const wxCursor &cursor)
+{
+    if(!wxWindowBase::SetCursor(cursor))
+        return false;
+    // Invalidate the cursor rects so the cursor will change
+    [[GetNSView() window] invalidateCursorRectsForView:GetNSView()];
+    return true;
+}
+
 bool wxWindowCocoa::Cocoa_viewDidMoveToWindow()
 {
     wxLogTrace(wxTRACE_COCOA,wxT("wxWindow=%p::viewDidMoveToWindow"),this);