X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5d1d2d465d9a6ce219df35fd97c02a37aba40d03..75d684d9f772126b02aaea7eedadc79cd24aaf32:/src/msw/frame.cpp diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp index f3123bd1d4..54215fde43 100644 --- a/src/msw/frame.cpp +++ b/src/msw/frame.cpp @@ -154,6 +154,9 @@ wxFrame::~wxFrame() // For some reason, wxWindows can activate another task altogether // when a frame is destroyed after a modal dialog has been invoked. // Try to bring the parent to the top. + // MT:Only do this if this frame is currently the active window, else weird + // things start to happen + if ( wxGetActiveWindow() == this ) if (GetParent() && GetParent()->GetHWND()) ::BringWindowToTop((HWND) GetParent()->GetHWND()); } @@ -175,8 +178,10 @@ void wxFrame::DoGetClientSize(int *x, int *y) const rect.bottom -= pt.y; rect.right -= pt.x; - *x = rect.right; - *y = rect.bottom; + if ( x ) + *x = rect.right; + if ( y ) + *y = rect.bottom; } // Set the client size (i.e. leave the calculation of borders etc. @@ -239,15 +244,6 @@ void wxFrame::DoGetPosition(int *x, int *y) const *y = point.y; } -void wxFrame::DoSetSize(int x, int y, int width, int height, int sizeFlags) -{ - wxWindow::DoSetSize(x, y, width, height, sizeFlags); - - wxSizeEvent event(wxSize(width, height), m_windowId); - event.SetEventObject( this ); - GetEventHandler()->ProcessEvent(event); -} - bool wxFrame::Show(bool show) { int cshow; @@ -416,11 +412,20 @@ void wxFrame::PositionStatusBar() } #endif // wxUSE_STATUSBAR +void wxFrame::DetachMenuBar() +{ + if (m_frameMenuBar) + { + m_frameMenuBar->Detach(); + m_frameMenuBar = NULL; + } +} + void wxFrame::SetMenuBar(wxMenuBar *menu_bar) { if (!menu_bar) { - m_frameMenuBar = NULL; + DetachMenuBar(); return; } @@ -666,10 +671,8 @@ bool wxFrame::ProcessCommand(int id) return FALSE; wxMenuItem *item = bar->FindItemForId(id); - if ( !item ) - return FALSE; - if ( item->IsCheckable() ) + if ( item && item->IsCheckable() ) { bar->Check(id, !bar->IsChecked(id)) ; }