static void wxCaptureScreenshot(bool activeWindowOnly)
{
#ifdef __DOS__
- #define SCREENSHOT_FILENAME _T("sshot%03i.png")
+ #define SCREENSHOT_FILENAME wxT("sshot%03i.png")
#else
- #define SCREENSHOT_FILENAME _T("screenshot-%03i.png")
+ #define SCREENSHOT_FILENAME wxT("screenshot-%03i.png")
#endif
static int screenshot_num = 0;
wxString screenshot;
g_displayDC->savePNGFromDC(screenshot.mb_str(),
r.x, r. y, r.x+r.width, r.y+r.height);
- wxMessageBox(wxString::Format(_T("Screenshot captured: %s"),
+ wxMessageBox(wxString::Format(wxT("Screenshot captured: %s"),
screenshot.c_str()));
}
#ifdef __WXDEBUG__
#define KEY(mgl_key,wx_key) \
case mgl_key: \
- wxLogTrace(_T("keyevents"), \
- _T("key " #mgl_key ", mapped to " #wx_key)); \
+ wxLogTrace(wxT("keyevents"), \
+ wxT("key " #mgl_key ", mapped to " #wx_key)); \
key = wx_key; \
break;
#else
event.SetEventObject(win);
event.SetTimestamp(e->when);
event.m_keyCode = wxScanToKeyCode(e, true);
- event.m_scanCode = 0; // not used by wx at all
event.m_x = where.x;
event.m_y = where.y;
event.m_shiftDown = ( e->modifiers & EVT_SHIFTKEY ) != 0;
if ( !g_winMng )
{
if ( !wxTheApp->SetDisplayMode(wxGetDefaultDisplayMode()) )
+ {
wxLogFatalError(_("Cannot initialize display."));
+ }
}
// mgl specific:
m_wnd = NULL;
m_isShown = true;
- m_frozen = false;
m_paintMGLDC = NULL;
m_eraseBackground = -1;
}
{
SendDestroyEvent();
- m_isBeingDeleted = true;
-
if ( gs_mouseCapture == this )
ReleaseMouse();
MGL_wmPushWindowEventHandler(m_wnd, wxWindowMouseHandler, EVT_MOUSEEVT, 0);
MGL_wmPushWindowEventHandler(m_wnd, wxWindowKeybHandler, EVT_KEYEVT, 0);
- if ( m_cursor.Ok() )
+ if ( m_cursor.IsOk() )
MGL_wmSetWindowCursor(m_wnd, *m_cursor.GetMGLCursor());
else
MGL_wmSetWindowCursor(m_wnd, *wxSTANDARD_CURSOR->GetMGLCursor());
return false;
}
- if ( m_cursor.Ok() )
+ if ( m_cursor.IsOk() )
MGL_wmSetWindowCursor(m_wnd, *m_cursor.GetMGLCursor());
else
MGL_wmSetWindowCursor(m_wnd, *wxSTANDARD_CURSOR->GetMGLCursor());
return dc.GetCharWidth();
}
-void wxWindowMGL::GetTextExtent(const wxString& string,
- int *x, int *y,
- int *descent, int *externalLeading,
- const wxFont *theFont) const
+void wxWindowMGL::DoGetTextExtent(const wxString& string,
+ int *x, int *y,
+ int *descent,
+ int *externalLeading,
+ const wxFont *theFont) const
{
wxScreenDC dc;
if (!theFont)
void wxWindowMGL::Update()
{
- if ( !m_frozen )
+ if ( !IsFrozen() )
MGL_wmUpdateDC(g_winMng);
}
-void wxWindowMGL::Freeze()
+void wxWindowMGL::DoFreeze()
{
- m_frozen = true;
m_refreshAfterThaw = false;
}
-void wxWindowMGL::Thaw()
+void wxWindowMGL::DoThaw()
{
- m_frozen = false;
if ( m_refreshAfterThaw )
Refresh();
}
void wxWindowMGL::HandlePaint(MGLDevCtx *dc)
{
- if ( m_frozen )
+ if ( IsFrozen() )
{
// Don't paint anything if the window is frozen.
m_refreshAfterThaw = true;
return;
}
-#ifdef __WXDEBUG__
+#if wxDEBUG_LEVEL >= 2
// FIXME_MGL -- debugging stuff, to be removed!
static int debugPaintEvents = -1;
if ( debugPaintEvents == -1 )
dc->fillRect(-1000,-1000,2000,2000);
wxMilliSleep(50);
}
-#endif
+#endif // wxDEBUG_LEVEL >= 2
MGLRegion clip;
dc->getClipRegion(clip);
window_t *wnd = MGL_wmGetWindowAtPosition(g_winMng, pt.x, pt.y);
return (wxWindow*)wnd->userData;
}
-
-
-// ---------------------------------------------------------------------------
-// idle events processing
-// ---------------------------------------------------------------------------
-
-void wxWindowMGL::OnInternalIdle()
-{
- if (wxUpdateUIEvent::CanUpdate(this) && IsShown())
- UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
-}