Added Prepend() and Remove() methods to wxSizer,

Corrected a stupid bug in it,
  Freshed up wxPropertyXXX to make use of the icons
  in the dialogs.
  Made wxBmpButton inherit from wxButton. Grumble.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3394 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
1999-08-16 20:17:48 +00:00
parent 0b129e1a85
commit 42b4e99e9a
17 changed files with 263 additions and 279 deletions

View File

@@ -197,6 +197,69 @@ void wxSizer::Add( int width, int height, int option, int flag, int border )
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 ) );
@@ -204,7 +267,7 @@ void wxSizer::Fit( wxWindow *window )
void wxSizer::Layout()
{
m_size = CalcMin();
CalcMin();
RecalcSizes();
}
@@ -229,6 +292,7 @@ void wxSizer::SetDimension( int x, int y, int width, int height )
m_position.y = y;
m_size.x = width;
m_size.y = height;
CalcMin();
RecalcSizes();
}
@@ -244,10 +308,7 @@ wxBoxSizer::wxBoxSizer( int orient )
void wxBoxSizer::RecalcSizes()
{
if (m_children.GetCount() == 0)
{
SetDimension( m_position.x, m_position.y, 2, 2 );
return;
}
int delta = 0;
int extra = 0;