// should use the current minimal size. If there is a MinSize,
// use it, otherwise use the BestSize.
wxSize min = m_window->GetMinSize();
- wxSize best = m_window->GetBestSize();
- if (min.x == -1) min.x = best.x;
- if (min.y == -1) min.y = best.y;
+ if (min.x == -1 || min.y == -1)
+ {
+ wxSize best = m_window->GetBestSize();
+ if (min.x == -1) min.x = best.x;
+ if (min.y == -1) min.y = best.y;
+ }
m_minSize = min;
}
{
if (flag & wxALIGN_CENTER_HORIZONTAL)
{
- pt.x = x + (w - sz.x) / 2;
+ pt.x = x + (w - sz.x - m_hgap) / 2;
}
else if (flag & wxALIGN_RIGHT)
{
- pt.x = x + (w - sz.x);
+ pt.x = x + (w - sz.x - m_hgap);
}
if (flag & wxALIGN_CENTER_VERTICAL)
{
- pt.y = y + (h - sz.y) / 2;
+ pt.y = y + (h - sz.y - m_vgap) / 2;
}
else if (flag & wxALIGN_BOTTOM)
{
- pt.y = y + (h - sz.y);
+ pt.y = y + (h - sz.y - m_vgap);
}
}