forward all wxSizer::Add/Prepend/Insert() to a virtual Insert(wxSizerItem) function, all the others made non virtual

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29171 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2004-09-17 13:25:20 +00:00
parent 4dddb8a2dd
commit 436ae7cf35
2 changed files with 73 additions and 85 deletions

View File

@ -180,73 +180,73 @@ public:
wxSizer();
~wxSizer();
/* These should be called Append() really. */
virtual void Add( wxWindow *window,
int proportion = 0,
int flag = 0,
int border = 0,
wxObject* userData = NULL );
virtual void Add( wxSizer *sizer,
int proportion = 0,
int flag = 0,
int border = 0,
wxObject* userData = NULL );
virtual void Add( int width,
int height,
int proportion = 0,
int flag = 0,
int border = 0,
wxObject* userData = NULL );
virtual void Add( wxSizerItem *item );
// methods for adding elements to the sizer: there are Add/Insert/Prepend
// overloads for each of window/sizer/spacer/wxSizerItem
void Add( wxWindow *window,
int proportion = 0,
int flag = 0,
int border = 0,
wxObject* userData = NULL );
void Add( wxSizer *sizer,
int proportion = 0,
int flag = 0,
int border = 0,
wxObject* userData = NULL );
void Add( int width,
int height,
int proportion = 0,
int flag = 0,
int border = 0,
wxObject* userData = NULL );
void Add( wxSizerItem *item );
virtual void AddSpacer(int size);
virtual void AddStretchSpacer(int prop = 1);
void AddSpacer(int size);
void AddStretchSpacer(int prop = 1);
virtual void Insert( size_t index,
wxWindow *window,
int proportion = 0,
int flag = 0,
int border = 0,
wxObject* userData = NULL );
virtual void Insert( size_t index,
wxSizer *sizer,
int proportion = 0,
int flag = 0,
int border = 0,
wxObject* userData = NULL );
virtual void Insert( size_t index,
int width,
int height,
int proportion = 0,
int flag = 0,
int border = 0,
wxObject* userData = NULL );
virtual void Insert( size_t index,
wxSizerItem *item );
void Insert( size_t index,
wxWindow *window,
int proportion = 0,
int flag = 0,
int border = 0,
wxObject* userData = NULL );
void Insert( size_t index,
wxSizer *sizer,
int proportion = 0,
int flag = 0,
int border = 0,
wxObject* userData = NULL );
void Insert( size_t index,
int width,
int height,
int proportion = 0,
int flag = 0,
int border = 0,
wxObject* userData = NULL );
virtual void Insert( size_t index, wxSizerItem *item );
virtual void InsertSpacer(size_t index, int size);
virtual void InsertStretchSpacer(size_t index, int prop = 1);
void InsertSpacer(size_t index, int size);
void InsertStretchSpacer(size_t index, int prop = 1);
virtual void Prepend( wxWindow *window,
int proportion = 0,
int flag = 0,
int border = 0,
wxObject* userData = NULL );
virtual void Prepend( wxSizer *sizer,
int proportion = 0,
int flag = 0,
int border = 0,
wxObject* userData = NULL );
virtual void Prepend( int width,
int height,
int proportion = 0,
int flag = 0,
int border = 0,
wxObject* userData = NULL );
virtual void Prepend( wxSizerItem *item );
void Prepend( wxWindow *window,
int proportion = 0,
int flag = 0,
int border = 0,
wxObject* userData = NULL );
void Prepend( wxSizer *sizer,
int proportion = 0,
int flag = 0,
int border = 0,
wxObject* userData = NULL );
void Prepend( int width,
int height,
int proportion = 0,
int flag = 0,
int border = 0,
wxObject* userData = NULL );
void Prepend( wxSizerItem *item );
virtual void PrependSpacer(int size);
virtual void PrependStretchSpacer(int prop = 1);
void PrependSpacer(int size);
void PrependStretchSpacer(int prop = 1);
// Deprecated in 2.6 since historically it does not delete the window,
// use Detach instead.

View File

@ -344,26 +344,22 @@ wxSizer::~wxSizer()
void wxSizer::Add( wxWindow *window, int proportion, int flag, int border, wxObject* userData )
{
m_children.Append( new wxSizerItem( window, proportion, flag, border, userData ) );
window->SetContainingSizer( this );
Add( new wxSizerItem( window, proportion, flag, border, userData ) );
}
void wxSizer::Add( wxSizer *sizer, int proportion, int flag, int border, wxObject* userData )
{
m_children.Append( new wxSizerItem( sizer, proportion, flag, border, userData ) );
Add( new wxSizerItem( sizer, proportion, flag, border, userData ) );
}
void wxSizer::Add( int width, int height, int proportion, int flag, int border, wxObject* userData )
{
m_children.Append( new wxSizerItem( width, height, proportion, flag, border, userData ) );
Add( new wxSizerItem( width, height, proportion, flag, border, userData ) );
}
void wxSizer::Add( wxSizerItem *item )
{
m_children.Append( item );
if( item->GetWindow() )
item->GetWindow()->SetContainingSizer( this );
Insert( m_children.GetCount(), item );
}
void wxSizer::AddSpacer(int size)
@ -378,26 +374,22 @@ void wxSizer::AddStretchSpacer(int prop)
void wxSizer::Prepend( wxWindow *window, int proportion, int flag, int border, wxObject* userData )
{
m_children.Insert( new wxSizerItem( window, proportion, flag, border, userData ) );
window->SetContainingSizer( this );
Prepend( new wxSizerItem( window, proportion, flag, border, userData ) );
}
void wxSizer::Prepend( wxSizer *sizer, int proportion, int flag, int border, wxObject* userData )
{
m_children.Insert( new wxSizerItem( sizer, proportion, flag, border, userData ) );
Prepend( new wxSizerItem( sizer, proportion, flag, border, userData ) );
}
void wxSizer::Prepend( int width, int height, int proportion, int flag, int border, wxObject* userData )
{
m_children.Insert( new wxSizerItem( width, height, proportion, flag, border, userData ) );
Prepend( new wxSizerItem( width, height, proportion, flag, border, userData ) );
}
void wxSizer::Prepend( wxSizerItem *item )
{
m_children.Insert( item );
if( item->GetWindow() )
item->GetWindow()->SetContainingSizer( this );
Insert( 0, item );
}
void wxSizer::PrependSpacer(int size)
@ -417,9 +409,7 @@ void wxSizer::Insert( size_t index,
int border,
wxObject* userData )
{
m_children.Insert( index,
new wxSizerItem( window, proportion, flag, border, userData ) );
window->SetContainingSizer( this );
Insert( index, new wxSizerItem( window, proportion, flag, border, userData ) );
}
void wxSizer::Insert( size_t index,
@ -429,8 +419,7 @@ void wxSizer::Insert( size_t index,
int border,
wxObject* userData )
{
m_children.Insert( index,
new wxSizerItem( sizer, proportion, flag, border, userData ) );
Insert( index, new wxSizerItem( sizer, proportion, flag, border, userData ) );
}
void wxSizer::Insert( size_t index,
@ -441,8 +430,7 @@ void wxSizer::Insert( size_t index,
int border,
wxObject* userData )
{
m_children.Insert( index,
new wxSizerItem( width, height, proportion, flag, border, userData ) );
Insert( index, new wxSizerItem( width, height, proportion, flag, border, userData ) );
}
void wxSizer::Insert( size_t index, wxSizerItem *item )