Fixed global cursor setting on Mac, which fixes busy cursor and context help cursor

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51438 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart 2008-01-29 11:02:47 +00:00
parent d968078adb
commit ddcbe73271
4 changed files with 21 additions and 6 deletions

View File

@ -123,8 +123,8 @@ bool wxContextHelp::BeginContextHelp(wxWindow* win)
wxCursor oldCursor = win->GetCursor(); wxCursor oldCursor = win->GetCursor();
win->SetCursor(cursor); win->SetCursor(cursor);
#ifdef __WXMSW__ #ifdef __WXMAC__
// wxSetCursor(cursor); wxSetCursor(cursor);
#endif #endif
m_status = false; m_status = false;
@ -149,6 +149,10 @@ bool wxContextHelp::BeginContextHelp(wxWindow* win)
win->SetCursor(oldCursor); win->SetCursor(oldCursor);
#ifdef __WXMAC__
wxSetCursor(wxNullCursor);
#endif
if (m_status) if (m_status)
{ {
wxPoint pt; wxPoint pt;

View File

@ -689,7 +689,9 @@ wxCursor::~wxCursor()
} }
// Global cursor setting // Global cursor setting
wxCursor gGlobalCursor;
void wxSetCursor(const wxCursor& cursor) void wxSetCursor(const wxCursor& cursor)
{ {
cursor.MacInstall() ; cursor.MacInstall() ;
gGlobalCursor = cursor;
} }

View File

@ -563,11 +563,16 @@ wxMacTopLevelMouseEventHandler(EventHandlerCallRef WXUNUSED(handler),
wxWindow* cursorTarget = currentMouseWindow ; wxWindow* cursorTarget = currentMouseWindow ;
wxPoint cursorPoint( wxevent.m_x , wxevent.m_y ) ; wxPoint cursorPoint( wxevent.m_x , wxevent.m_y ) ;
while ( cursorTarget && !cursorTarget->MacSetupCursor( cursorPoint ) ) extern wxCursor gGlobalCursor;
if (!gGlobalCursor.IsOk())
{ {
cursorTarget = cursorTarget->GetParent() ; while ( cursorTarget && !cursorTarget->MacSetupCursor( cursorPoint ) )
if ( cursorTarget ) {
cursorPoint += cursorTarget->GetPosition(); cursorTarget = cursorTarget->GetParent() ;
if ( cursorTarget )
cursorPoint += cursorTarget->GetPosition();
}
} }
} }

View File

@ -126,6 +126,8 @@ void wxBeginBusyCursor(const wxCursor *cursor)
{ {
gMacStoredActiveCursor = gMacCurrentCursor; gMacStoredActiveCursor = gMacCurrentCursor;
cursor->MacInstall(); cursor->MacInstall();
wxSetCursor(*cursor);
} }
//else: nothing to do, already set //else: nothing to do, already set
} }
@ -140,6 +142,8 @@ void wxEndBusyCursor()
{ {
gMacStoredActiveCursor.MacInstall(); gMacStoredActiveCursor.MacInstall();
gMacStoredActiveCursor = wxNullCursor; gMacStoredActiveCursor = wxNullCursor;
wxSetCursor(wxNullCursor);
} }
} }