X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8f7b34a878bbcb2f71a0c7694e2a3bec51460218..89fcec9514fd890de58da83118363570e2482bc9:/src/mgl/cursor.cpp diff --git a/src/mgl/cursor.cpp b/src/mgl/cursor.cpp index 0764b93519..eb959e8ff8 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" //----------------------------------------------------------------------------- @@ -68,6 +68,9 @@ wxCursor::wxCursor(int cursorId) switch (cursorId) { + // FIXME_MGL -- what about storing these default cursors in executable + // as XPMs so that wxMGL binary wouldn't depend on + // tons of files in $MGL_ROOT/cursors? I don't know yet... case wxCURSOR_ARROW: cursorname = "arrow.cur"; break; case wxCURSOR_BULLSEYE: cursorname = "bullseye.cur"; break; case wxCURSOR_CHAR: cursorname = "char.cur"; break; @@ -95,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; @@ -196,13 +197,14 @@ MGLCursor *wxCursor::GetMGLCursor() const // Global cursor setting // ---------------------------------------------------------------------------- +static wxCursor g_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()); + g_globalCursor = cursor; } } @@ -212,10 +214,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() @@ -234,10 +233,9 @@ 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; @@ -245,8 +243,10 @@ void wxBeginBusyCursor(wxCursor *WXUNUSED(cursor)) wxT("forgot to call wxEndBusyCursor, will leak memory") ); gs_savedCursor = g_globalCursor; - wxSetCursor(wxCursor(wxCURSOR_WAIT)); - //wxYield(); FIXME_MGL - needed? + if ( cursor->Ok() ) + wxSetCursor(*cursor); + else + wxSetCursor(wxCursor(wxCURSOR_WAIT)); } bool wxIsBusy()