X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d46330c586354cf72527347d7b684ac633b059c1..268766dd1f2a2d4d593d1d65893f62b5753ff20b:/src/mgl/window.cpp?ds=sidebyside diff --git a/src/mgl/window.cpp b/src/mgl/window.cpp index 00bc22aae5..09f69f1dd7 100644 --- a/src/mgl/window.cpp +++ b/src/mgl/window.cpp @@ -117,6 +117,7 @@ bool wxCreateMGL_WM() #if wxUSE_SYSTEM_OPTIONS // FIXME_MGL -- so what is The Proper Way? + width=800, height=600; if ( wxSystemOptions::HasOption(wxT("mgl.screen-width") ) width = wxSystemOptions::GetOptionInt(wxT("mgl.screen-width")); if ( wxSystemOptions::HasOption(wxT("mgl.screen-height") ) @@ -180,6 +181,7 @@ static wxWindowMGL* wxGetTopLevelParent(wxWindowMGL *win) static void wxWindowPainter(window_t *wnd, MGLDC *dc) { wxWindowMGL *w = (wxWindow*) wnd->userData; + if ( w && !(w->GetWindowStyle() & wxTRANSPARENT_WINDOW) ) { MGLDevCtx ctx(dc); @@ -535,13 +537,13 @@ wxWindowMGL::~wxWindowMGL() if (gs_activeFrame == this) { + gs_activeFrame = NULL; // activate next frame in Z-order: if ( m_wnd->prev ) { wxWindowMGL *win = (wxWindowMGL*)m_wnd->prev->userData; win->SetFocus(); } - gs_activeFrame = NULL; } if ( gs_focusedWindow == this ) @@ -639,7 +641,7 @@ void wxWindowMGL::SetFocus() #endif // wxUSE_CARET wxWindowMGL *active = wxGetTopLevelParent(this); - if ( active != gs_activeFrame ) + if ( !(m_windowStyle & wxPOPUP_WINDOW) && active != gs_activeFrame ) { if ( gs_activeFrame ) { @@ -656,7 +658,7 @@ void wxWindowMGL::SetFocus() wxFocusEvent event(wxEVT_SET_FOCUS, GetId()); event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); + AddPendingEvent(event); } void wxWindowMGL::KillFocus() @@ -675,17 +677,9 @@ void wxWindowMGL::KillFocus() caret->OnKillFocus(); #endif // wxUSE_CARET - if ( IsTopLevel() ) - { - // FIXME_MGL - this is wrong, see wxGTK! - wxActivateEvent event(wxEVT_ACTIVATE, FALSE, GetId()); - event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); - } - wxFocusEvent event(wxEVT_KILL_FOCUS, GetId()); event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); + AddPendingEvent(event); } // ---------------------------------------------------------------------------- @@ -703,6 +697,17 @@ bool wxWindowMGL::Show(bool show) return FALSE; MGL_wmShowWindow(m_wnd, show); + + if (!show && gs_activeFrame == this) + { + // activate next frame in Z-order: + if ( m_wnd->prev ) + { + wxWindowMGL *win = (wxWindowMGL*)m_wnd->prev->userData; + win->SetFocus(); + } + } + return TRUE; } @@ -1044,6 +1049,7 @@ void wxWindowMGL::Clear() dc.Clear(); } +#include "wx/menu.h" void wxWindowMGL::Refresh(bool eraseBack, const wxRect *rect) { if ( m_eraseBackground == -1 )