X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d11bb14faace68d2c69e9e94b2ba6824f43a2d59..6ba636000f13b4bf7d3e7dcfad429713085f6700:/src/generic/laywin.cpp diff --git a/src/generic/laywin.cpp b/src/generic/laywin.cpp index 2d0702f53c..b418869ad2 100644 --- a/src/generic/laywin.cpp +++ b/src/generic/laywin.cpp @@ -270,6 +270,7 @@ bool wxLayoutAlgorithm::LayoutWindow(wxWindow* parent, wxWindow* mainWindow) node = node->Next(); } + // Now do a dummy run to see if we have any space left for the final window (fail if not) node = parent->GetChildren().First(); while (node) { @@ -277,7 +278,31 @@ bool wxLayoutAlgorithm::LayoutWindow(wxWindow* parent, wxWindow* mainWindow) // If mainWindow is NULL and we're at the last window, // skip this, because we'll simply make it fit the remaining space. - if ((win != mainWindow) && (mainWindow != NULL || win != lastAwareWindow)) + if (win->IsShown() && (win != mainWindow) && (mainWindow != NULL || win != lastAwareWindow)) + { + event.SetId(win->GetId()); + event.SetEventObject(win); + event.SetFlags(wxLAYOUT_QUERY); + + win->GetEventHandler()->ProcessEvent(event); + } + + node = node->Next(); + } + + if (event.GetRect().GetWidth() < 0 || event.GetRect().GetHeight() < 0) + return FALSE; + + event.SetRect(rect); + + node = parent->GetChildren().First(); + while (node) + { + wxWindow* win = (wxWindow*) node->Data(); + + // If mainWindow is NULL and we're at the last window, + // skip this, because we'll simply make it fit the remaining space. + if (win->IsShown() && (win != mainWindow) && (mainWindow != NULL || win != lastAwareWindow)) { event.SetId(win->GetId()); event.SetEventObject(win);