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:
parent
d968078adb
commit
ddcbe73271
@ -123,8 +123,8 @@ bool wxContextHelp::BeginContextHelp(wxWindow* win)
|
||||
wxCursor oldCursor = win->GetCursor();
|
||||
win->SetCursor(cursor);
|
||||
|
||||
#ifdef __WXMSW__
|
||||
// wxSetCursor(cursor);
|
||||
#ifdef __WXMAC__
|
||||
wxSetCursor(cursor);
|
||||
#endif
|
||||
|
||||
m_status = false;
|
||||
@ -149,6 +149,10 @@ bool wxContextHelp::BeginContextHelp(wxWindow* win)
|
||||
|
||||
win->SetCursor(oldCursor);
|
||||
|
||||
#ifdef __WXMAC__
|
||||
wxSetCursor(wxNullCursor);
|
||||
#endif
|
||||
|
||||
if (m_status)
|
||||
{
|
||||
wxPoint pt;
|
||||
|
@ -689,7 +689,9 @@ wxCursor::~wxCursor()
|
||||
}
|
||||
|
||||
// Global cursor setting
|
||||
wxCursor gGlobalCursor;
|
||||
void wxSetCursor(const wxCursor& cursor)
|
||||
{
|
||||
cursor.MacInstall() ;
|
||||
gGlobalCursor = cursor;
|
||||
}
|
||||
|
@ -563,11 +563,16 @@ wxMacTopLevelMouseEventHandler(EventHandlerCallRef WXUNUSED(handler),
|
||||
wxWindow* cursorTarget = currentMouseWindow ;
|
||||
wxPoint cursorPoint( wxevent.m_x , wxevent.m_y ) ;
|
||||
|
||||
while ( cursorTarget && !cursorTarget->MacSetupCursor( cursorPoint ) )
|
||||
extern wxCursor gGlobalCursor;
|
||||
|
||||
if (!gGlobalCursor.IsOk())
|
||||
{
|
||||
cursorTarget = cursorTarget->GetParent() ;
|
||||
if ( cursorTarget )
|
||||
cursorPoint += cursorTarget->GetPosition();
|
||||
while ( cursorTarget && !cursorTarget->MacSetupCursor( cursorPoint ) )
|
||||
{
|
||||
cursorTarget = cursorTarget->GetParent() ;
|
||||
if ( cursorTarget )
|
||||
cursorPoint += cursorTarget->GetPosition();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -126,6 +126,8 @@ void wxBeginBusyCursor(const wxCursor *cursor)
|
||||
{
|
||||
gMacStoredActiveCursor = gMacCurrentCursor;
|
||||
cursor->MacInstall();
|
||||
|
||||
wxSetCursor(*cursor);
|
||||
}
|
||||
//else: nothing to do, already set
|
||||
}
|
||||
@ -140,6 +142,8 @@ void wxEndBusyCursor()
|
||||
{
|
||||
gMacStoredActiveCursor.MacInstall();
|
||||
gMacStoredActiveCursor = wxNullCursor;
|
||||
|
||||
wxSetCursor(wxNullCursor);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user