, m_show( true )
, m_userData( userData )
{
- // aspect ratio calculated from initial size
- SetRatio( m_minSize );
-
if (flag & wxFIXED_MINSIZE)
window->SetMinSize(window->GetSize());
m_minSize = window->GetSize();
+ // aspect ratio calculated from initial size
+ SetRatio( m_minSize );
+
// m_size is calculated later
}
wxSize wxSizerItem::CalcMin()
{
- wxSize ret;
-
if (IsSizer())
{
m_minSize = m_sizer->GetMinSize();
// if we have to preserve aspect ratio _AND_ this is
// the first-time calculation, consider ret to be initial size
if ((m_flag & wxSHAPED) && !m_ratio)
- SetRatio(ret);
+ SetRatio(m_minSize);
}
else if ( IsWindow() )
{
void wxGridSizer::SetItemBounds( wxSizerItem *item, int x, int y, int w, int h )
{
wxPoint pt( x,y );
- wxSize sz( item->CalcMin() );
+ wxSize sz( item->GetMinSizeWithBorder() );
int flag = item->GetFlag();
if ((flag & wxEXPAND) || (flag & wxSHAPED))
{
if (flag & wxALIGN_CENTER_HORIZONTAL)
{
- pt.x = x + (w - sz.x - m_hgap) / 2;
+ pt.x = x + (w - sz.x) / 2;
}
else if (flag & wxALIGN_RIGHT)
{
- pt.x = x + (w - sz.x - m_hgap);
+ pt.x = x + (w - sz.x);
}
if (flag & wxALIGN_CENTER_VERTICAL)
{
- pt.y = y + (h - sz.y - m_vgap) / 2;
+ pt.y = y + (h - sz.y) / 2;
}
else if (flag & wxALIGN_BOTTOM)
{
- pt.y = y + (h - sz.y - m_vgap);
+ pt.y = y + (h - sz.y);
}
}