m_children.Append( new wxSizerItem( width, height, option, flag, border ) );
}
+void wxSizer::Prepend( wxWindow *window, int option, int flag, int border )
+{
+ m_children.Insert( new wxSizerItem( window, option, flag, border ) );
+}
+
+void wxSizer::Prepend( wxSizer *sizer, int option, int flag, int border )
+{
+ m_children.Insert( new wxSizerItem( sizer, option, flag, border ) );
+}
+
+void wxSizer::Prepend( int width, int height, int option, int flag, int border )
+{
+ m_children.Insert( new wxSizerItem( width, height, option, flag, border ) );
+}
+
+bool wxSizer::Remove( wxWindow *window )
+{
+ wxASSERT( window );
+
+ wxNode *node = m_children.First();
+ while (node)
+ {
+ wxSizerItem *item = (wxSizerItem*)node->Data();
+ if (item->GetWindow() == window)
+ {
+ m_children.DeleteNode( node );
+ return TRUE;
+ }
+ node = node->Next();
+ }
+
+ return FALSE;
+}
+
+bool wxSizer::Remove( wxSizer *sizer )
+{
+ wxASSERT( sizer );
+
+ wxNode *node = m_children.First();
+ while (node)
+ {
+ wxSizerItem *item = (wxSizerItem*)node->Data();
+ if (item->GetSizer() == sizer)
+ {
+ m_children.DeleteNode( node );
+ return TRUE;
+ }
+ node = node->Next();
+ }
+
+ return FALSE;
+}
+
+bool wxSizer::Remove( int pos )
+{
+ wxNode *node = m_children.Nth( pos );
+ if (!node) return FALSE;
+
+ m_children.DeleteNode( node );
+
+ return TRUE;
+}
+
void wxSizer::Fit( wxWindow *window )
{
window->SetSize( GetMinWindowSize( window ) );
void wxSizer::Layout()
{
- m_size = CalcMin();
+ CalcMin();
RecalcSizes();
}
m_position.y = y;
m_size.x = width;
m_size.y = height;
+ CalcMin();
RecalcSizes();
}
void wxBoxSizer::RecalcSizes()
{
if (m_children.GetCount() == 0)
- {
- SetDimension( m_position.x, m_position.y, 2, 2 );
return;
- }
int delta = 0;
int extra = 0;