// Purpose:
// Author: Vaclav Slavik
// Id: $Id$
-// Copyright: (c) 2001 Vaclav Slavik
+// Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#include "wx/log.h"
#include "wx/intl.h"
-#include <mgraph.hpp>
+#include "wx/mgl/private.h"
//-----------------------------------------------------------------------------
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;
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;
// 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;
}
}
// 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()
const wxCursor wxBusyCursor::GetBusyCursor()
{
- return wxCursor(wxCURSOR_WAIT);
+ return gs_globalCursor;
}
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()