, 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() )
{
item->GetWindow()->SetContainingSizer( this );
}
+void wxSizer::AddSpacer(int size)
+{
+ Add(size, size);
+}
+
+void wxSizer::AddStretchSpacer(int prop)
+{
+ Add(0, 0, prop);
+}
+
void wxSizer::Prepend( wxWindow *window, int proportion, int flag, int border, wxObject* userData )
{
m_children.Insert( new wxSizerItem( window, proportion, flag, border, userData ) );
item->GetWindow()->SetContainingSizer( this );
}
+void wxSizer::PrependSpacer(int size)
+{
+ Prepend(size, size);
+}
+
+void wxSizer::PrependStretchSpacer(int prop)
+{
+ Prepend(0, 0, prop);
+}
+
void wxSizer::Insert( size_t index,
wxWindow *window,
int proportion,
item->GetWindow()->SetContainingSizer( this );
}
+void wxSizer::InsertSpacer(size_t index, int size)
+{
+ Insert(index, size, size);
+}
+
+void wxSizer::InsertStretchSpacer(size_t index, int prop)
+{
+ Insert(index, 0, 0, prop);
+}
+
bool wxSizer::Remove( wxWindow *window )
{
return Detach( window );