]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mgl/window.cpp
added an explicit accessor to query the default key value
[wxWidgets.git] / src / mgl / window.cpp
index 346c33f826b60b550786d07ef1a336eaec7817dd..64bef3e090f7e1a0af0cab0ab4cf0151e573ae20 100644 (file)
@@ -118,7 +118,7 @@ static void CaptureScreenshot()
 // MGL_WM hooks:
 // ---------------------------------------------------------------------------
 
-static void wxWindowPainter(window_t *wnd, MGLDC *dc)
+static void MGLAPI wxWindowPainter(window_t *wnd, MGLDC *dc)
 {
     wxWindowMGL *w = (wxWindow*) wnd->userData;
     
@@ -129,7 +129,7 @@ static void wxWindowPainter(window_t *wnd, MGLDC *dc)
     }
 }
 
-static ibool wxWindowMouseHandler(window_t *wnd, event_t *e)
+static ibool MGLAPI wxWindowMouseHandler(window_t *wnd, event_t *e)
 {
     wxWindowMGL *win = (wxWindowMGL*)MGL_wmGetWindowUserData(wnd);
     wxPoint orig(win->GetClientAreaOrigin());
@@ -374,7 +374,7 @@ static long wxAsciiToKeyCode(event_t *event)
     return (long)EVT_asciiCode(event->message);
 }
 
-static ibool wxWindowKeybHandler(window_t *wnd, event_t *e)
+static ibool MGLAPI wxWindowKeybHandler(window_t *wnd, event_t *e)
 {
     wxWindowMGL *win = (wxWindowMGL*)MGL_wmGetWindowUserData(wnd);
 
@@ -469,12 +469,17 @@ END_EVENT_TABLE()
 // constructors and such
 // ----------------------------------------------------------------------------
 
+extern wxDisplayModeInfo wxGetDefaultDisplayMode();
+
 void wxWindowMGL::Init()
 {
     // First of all, make sure window manager is up and running. If it is
     // not the case, initialize it in default display mode
     if ( !g_winMng )
-        wxTheApp->SetDisplayMode(wxDisplayModeInfo(640, 480, 16));
+    {
+        if ( !wxTheApp->SetDisplayMode(wxGetDefaultDisplayMode()) )
+            wxFatalError(_("Cannot initialize display."));
+    }
 
     // generic:
     InitBase();
@@ -704,7 +709,7 @@ void wxWindowMGL::Lower()
     MGL_wmLowerWindow(m_wnd);
 }
 
-void wxWindowMGL::CaptureMouse()
+void wxWindowMGL::DoCaptureMouse()
 {
     if ( gs_mouseCapture )
         MGL_wmUncaptureEvents(gs_mouseCapture->m_wnd, wxMGL_CAPTURE_MOUSE);
@@ -713,7 +718,7 @@ void wxWindowMGL::CaptureMouse()
     MGL_wmCaptureEvents(m_wnd, EVT_MOUSEEVT, wxMGL_CAPTURE_MOUSE);
 }
 
-void wxWindowMGL::ReleaseMouse()
+void wxWindowMGL::DoReleaseMouse()
 {
     wxASSERT_MSG( gs_mouseCapture == this, wxT("attempt to release mouse, but this window hasn't captured it") )