X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2343d81ba29504d87971266f0ed819c252b6b1ee..268766dd1f2a2d4d593d1d65893f62b5753ff20b:/src/mgl/toplevel.cpp?ds=sidebyside diff --git a/src/mgl/toplevel.cpp b/src/mgl/toplevel.cpp index 49d9d10403..595b1a828b 100644 --- a/src/mgl/toplevel.cpp +++ b/src/mgl/toplevel.cpp @@ -82,8 +82,6 @@ bool wxTopLevelWindowMGL::Create(wxWindow *parent, wxTopLevelWindows.Append(this); m_title = title; - - // FIXME_MGL -- should activate itself when shown! return TRUE; } @@ -136,24 +134,34 @@ bool wxTopLevelWindowMGL::ShowFullScreen(bool show, long style) return TRUE; } +bool wxTopLevelWindowMGL::Show(bool show) +{ + bool ret = wxTopLevelWindowBase::Show(show); + if ( ret && show && AcceptsFocus() ) + SetFocus(); + // FIXME_MGL -- don't do this for popup windows? + return ret; +} + void wxTopLevelWindowMGL::Maximize(bool maximize) { if ( maximize && !m_isMaximized ) { int x, y, w, h; + m_isMaximized = TRUE; + GetPosition(&m_savedFrame.x, &m_savedFrame.y); GetSize(&m_savedFrame.width, &m_savedFrame.height); wxClientDisplayRect(&x, &y, &w, &h); SetSize(x, y, w, h); - m_isMaximized = TRUE; } else if ( !maximize && m_isMaximized ) { + m_isMaximized = FALSE; SetSize(m_savedFrame.x, m_savedFrame.y, m_savedFrame.width, m_savedFrame.height); - m_isMaximized = FALSE; } } @@ -164,11 +172,11 @@ bool wxTopLevelWindowMGL::IsMaximized() const void wxTopLevelWindowMGL::Restore() { - if ( m_isIconized ) + if ( IsIconized() ) { Iconize(FALSE); } - if ( m_isMaximized ) + if ( IsMaximized() ) { Maximize(FALSE); }