Merged trunk 47585:

Implement wxWindow::SetCursor to invalidate Cocoa's cursor rects.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@47586 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Elliott
2007-07-20 05:47:19 +00:00
parent 7afe960213
commit eb6e94c125
2 changed files with 11 additions and 0 deletions

View File

@@ -141,6 +141,8 @@ public:
virtual void SetFocus(); virtual void SetFocus();
// Warp the pointer the given position // Warp the pointer the given position
virtual void WarpPointer(int x_pos, int y_pos) ; 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 // Send the window a refresh event
virtual void Refresh(bool eraseBack = true, const wxRect *rect = NULL); virtual void Refresh(bool eraseBack = true, const wxRect *rect = NULL);
// Set/get the window's font // Set/get the window's font

View File

@@ -595,6 +595,15 @@ void wxWindowCocoa::Cocoa_FrameChanged(void)
GetEventHandler()->ProcessEvent(event); GetEventHandler()->ProcessEvent(event);
} }
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_resetCursorRects() bool wxWindowCocoa::Cocoa_resetCursorRects()
{ {
if(!m_cursor.GetNSCursor()) if(!m_cursor.GetNSCursor())