xNew += posParent.x;
yNew += posParent.y;
- // move the centre of this window to this position
- Move(xNew, yNew);
+ // move the window to this position (keeping the old size but using
+ // SetSize() and not Move() to allow xNew and/or yNew to be -1)
+ SetSize(xNew, yNew, width, height, wxSIZE_ALLOW_MINUS_ONE);
}
// fits the window around the children
{
if ( GetChildren().GetCount() > 0 )
{
- SetClientSize(DoGetBestSize());
+ wxSize size = DoGetBestSize();
+
+ // for compatibility with the old versions and because it really looks
+ // slightly more pretty like this, add a pad
+ size.x += 7;
+ size.y += 14;
+
+ SetClientSize(size);
}
//else: do nothing if we have no children
}
node = node->GetNext() )
{
wxWindow *win = node->GetData();
- if ( win->IsTopLevel() || wxDynamicCast(win, wxStatusBar) )
+ if ( win->IsTopLevel() || wxDynamicCast(win, wxStatusBar) || !win->IsShown())
{
// dialogs and frames lie in different top level windows -
// don't deal with them here; as for the status bars, they
maxY = wy + wh;
}
- // leave a margin
- return wxSize(maxX + 7, maxY + 14);
+ return wxSize(maxX, maxY);
}
else
{