force update of MDI client window size after the MDI parent frame is iconized and restored, otherwise all kinds of bad things (changes in MDI children positions; possibility to move them above the toolbar and below the status bar; wrong repaining) happen

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35175 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2005-08-11 13:24:56 +00:00
parent 952f2aaa86
commit 6bbe97b71d
2 changed files with 30 additions and 7 deletions

View File

@@ -133,6 +133,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxMDIClientWindow, wxWindow)
BEGIN_EVENT_TABLE(wxMDIParentFrame, wxFrame)
EVT_SIZE(wxMDIParentFrame::OnSize)
EVT_ICONIZE(wxMDIParentFrame::OnIconized)
EVT_SYS_COLOUR_CHANGED(wxMDIParentFrame::OnSysColourChanged)
END_EVENT_TABLE()
@@ -323,7 +324,7 @@ void wxMDIParentFrame::DoMenuUpdates(wxMenu* menu)
}
}
void wxMDIParentFrame::OnSize(wxSizeEvent&)
void wxMDIParentFrame::UpdateClientSize()
{
if ( GetClientWindow() )
{
@@ -334,6 +335,23 @@ void wxMDIParentFrame::OnSize(wxSizeEvent&)
}
}
void wxMDIParentFrame::OnSize(wxSizeEvent& WXUNUSED(event))
{
UpdateClientSize();
// do not call event.Skip() here, it somehow messes up MDI client window
}
void wxMDIParentFrame::OnIconized(wxIconizeEvent& event)
{
event.Skip();
if ( !event.Iconized() )
{
UpdateClientSize();
}
}
// Returns the active MDI child window
wxMDIChildFrame *wxMDIParentFrame::GetActiveChild() const
{
@@ -852,8 +870,8 @@ void wxMDIChildFrame::InternalSetMenuBar()
void wxMDIChildFrame::DetachMenuBar()
{
RemoveWindowMenu(NULL, m_hMenu);
wxFrame::DetachMenuBar();
RemoveWindowMenu(NULL, m_hMenu);
wxFrame::DetachMenuBar();
}
WXHICON wxMDIChildFrame::GetDefaultIcon() const
@@ -1285,11 +1303,11 @@ void wxMDIClientWindow::DoSetSize(int x, int y, int width, int height, int sizeF
// (see OGL studio sample). So check if the position is changed and if so,
// redraw the MDI child frames.
wxPoint oldPos = GetPosition();
const wxPoint oldPos = GetPosition();
wxWindow::DoSetSize(x, y, width, height, sizeFlags);
wxWindow::DoSetSize(x, y, width, height, sizeFlags | wxSIZE_FORCE);
wxPoint newPos = GetPosition();
const wxPoint newPos = GetPosition();
if ((newPos.x != oldPos.x) || (newPos.y != oldPos.y))
{