X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7bdc18790e34d17edfc02f3e25edcb3425b38a8a..fa7cdd7f481dd9b08cdde2a7f991b69d79dfc58c:/src/mgl/cursor.cpp diff --git a/src/mgl/cursor.cpp b/src/mgl/cursor.cpp index 1e4867ae70..f1ce135b33 100644 --- a/src/mgl/cursor.cpp +++ b/src/mgl/cursor.cpp @@ -24,7 +24,7 @@ #include "wx/log.h" #include "wx/intl.h" -#include +#include "wx/mgl/private.h" //----------------------------------------------------------------------------- @@ -98,8 +98,6 @@ wxCursor::wxCursor(int cursorId) case wxCURSOR_BLANK: cursorname = "blank.cur"; break; case wxCURSOR_NONE: - // FIXME_MGL - make sure wxWindow uses cursor with - // GetMGLCursor() == NULL correctly, i.e. calls MS_hide() *this = wxNullCursor; return; break; @@ -199,13 +197,19 @@ MGLCursor *wxCursor::GetMGLCursor() const // Global cursor setting // ---------------------------------------------------------------------------- +static wxCursor gs_globalCursor = wxNullCursor; void wxSetCursor(const wxCursor& cursor) { if ( cursor.Ok() ) { - //MGL_setGlobalCursor(cursor.GetMGLCursor()); - // FIXME_MGL -- needs MGL WM first + MGL_wmSetGlobalCursor(g_winMng, *cursor.GetMGLCursor()); + gs_globalCursor = cursor; + } + else + { + MGL_wmSetGlobalCursor(g_winMng, NULL); + gs_globalCursor = wxNullCursor; } } @@ -215,10 +219,7 @@ void wxSetCursor(const wxCursor& cursor) // busy cursor routines //----------------------------------------------------------------------------- -// FIXME_MGL -- do we need this? It may be better to incorporate -// support for it into MGL (a stack of global cursors?) -static wxCursor gs_savedCursor; -static wxCursor g_globalCursor; +static wxCursor gs_savedCursor = wxNullCursor; static int gs_busyCount = 0; const wxCursor &wxBusyCursor::GetStoredCursor() @@ -228,7 +229,7 @@ const wxCursor &wxBusyCursor::GetStoredCursor() const wxCursor wxBusyCursor::GetBusyCursor() { - return wxCursor(wxCURSOR_WAIT); + return gs_globalCursor; } void wxEndBusyCursor() @@ -237,19 +238,20 @@ void wxEndBusyCursor() wxSetCursor(gs_savedCursor); gs_savedCursor = wxNullCursor; - //wxYield(); FIXME_MGL - needed? } -void wxBeginBusyCursor(wxCursor *WXUNUSED(cursor)) +void wxBeginBusyCursor(wxCursor *cursor) { if ( gs_busyCount++ > 0 ) return; wxASSERT_MSG( !gs_savedCursor.Ok(), wxT("forgot to call wxEndBusyCursor, will leak memory") ); - gs_savedCursor = g_globalCursor; - wxSetCursor(wxCursor(wxCURSOR_WAIT)); - //wxYield(); FIXME_MGL - needed? + gs_savedCursor = gs_globalCursor; + if ( cursor->Ok() ) + wxSetCursor(*cursor); + else + wxSetCursor(wxCursor(wxCURSOR_WAIT)); } bool wxIsBusy()