Add name argument to wxDataViewCtrl ctor for consistency.

As all the other wxWidgets controls take the parameter in their ctor/Create()
it's unexpected that wxDataViewCtrl does not. Add the name parameter and pass
it to wxWindowBase::CreateBase() as usual.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65215 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2010-08-08 11:37:57 +00:00
parent 033a5ff5c7
commit 62e9285aba
6 changed files with 49 additions and 22 deletions

View File

@ -120,10 +120,11 @@ public:
wxDataViewCtrl( wxWindow *parent, wxWindowID id, wxDataViewCtrl( wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0, const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator ) const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxDataViewCtrlNameStr );
: wxScrollHelper(this) : wxScrollHelper(this)
{ {
Create(parent, id, pos, size, style, validator ); Create(parent, id, pos, size, style, validator, name);
} }
virtual ~wxDataViewCtrl(); virtual ~wxDataViewCtrl();
@ -133,7 +134,8 @@ public:
bool Create(wxWindow *parent, wxWindowID id, bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0, const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator ); const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxDataViewCtrlNameStr);
virtual bool AssociateModel( wxDataViewModel *model ); virtual bool AssociateModel( wxDataViewModel *model );

View File

@ -113,17 +113,19 @@ public:
wxDataViewCtrl( wxWindow *parent, wxWindowID id, wxDataViewCtrl( wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0, const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator ) const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxDataViewCtrlNameStr )
{ {
Init(); Init();
Create(parent, id, pos, size, style, validator ); Create(parent, id, pos, size, style, validator, name);
} }
bool Create(wxWindow *parent, wxWindowID id, bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0, const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator ); const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxDataViewCtrlNameStr);
virtual ~wxDataViewCtrl(); virtual ~wxDataViewCtrl();

View File

@ -129,18 +129,27 @@ public:
{ {
Init(); Init();
} }
wxDataViewCtrl(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, wxDataViewCtrl(wxWindow *parent,
const wxValidator& validator = wxDefaultValidator) wxWindowID winid,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxDataViewCtrlNameStr )
{ {
Init(); Init();
Create(parent, id, pos, size, style, validator ); Create(parent, winid, pos, size, style, validator, name);
} }
~wxDataViewCtrl(); ~wxDataViewCtrl();
// explicit control creation bool Create(wxWindow *parent,
bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos=wxDefaultPosition, const wxSize& size=wxDefaultSize, long style=0, wxWindowID winid,
const wxValidator& validator=wxDefaultValidator); const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxDataViewCtrlNameStr);
virtual wxControl* GetMainWindow() // not used for the native implementation virtual wxControl* GetMainWindow() // not used for the native implementation
{ {

View File

@ -3888,9 +3888,13 @@ void wxDataViewCtrl::Init()
m_headerArea = NULL; m_headerArea = NULL;
} }
bool wxDataViewCtrl::Create(wxWindow *parent, wxWindowID id, bool wxDataViewCtrl::Create(wxWindow *parent,
const wxPoint& pos, const wxSize& size, wxWindowID id,
long style, const wxValidator& validator ) const wxPoint& pos,
const wxSize& size,
long style,
const wxValidator& validator,
const wxString& name)
{ {
// if ( (style & wxBORDER_MASK) == 0) // if ( (style & wxBORDER_MASK) == 0)
// style |= wxBORDER_SUNKEN; // style |= wxBORDER_SUNKEN;
@ -3898,7 +3902,7 @@ bool wxDataViewCtrl::Create(wxWindow *parent, wxWindowID id,
Init(); Init();
if (!wxControl::Create( parent, id, pos, size, if (!wxControl::Create( parent, id, pos, size,
style | wxScrolledWindowStyle, validator)) style | wxScrolledWindowStyle, validator, name))
return false; return false;
SetInitialSize(size); SetInitialSize(size);

View File

@ -4256,12 +4256,16 @@ void wxDataViewCtrl::Init()
m_cols.DeleteContents( true ); m_cols.DeleteContents( true );
} }
bool wxDataViewCtrl::Create(wxWindow *parent, wxWindowID id, bool wxDataViewCtrl::Create(wxWindow *parent,
const wxPoint& pos, const wxSize& size, wxWindowID id,
long style, const wxValidator& validator ) const wxPoint& pos,
const wxSize& size,
long style,
const wxValidator& validator,
const wxString& name)
{ {
if (!PreCreation( parent, pos, size ) || if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, validator )) !CreateBase( parent, id, pos, size, style, validator, name ))
{ {
wxFAIL_MSG( wxT("wxDataViewCtrl creation failed") ); wxFAIL_MSG( wxT("wxDataViewCtrl creation failed") );
return false; return false;

View File

@ -333,9 +333,15 @@ void wxDataViewCtrl::Init()
m_cgContext = NULL; m_cgContext = NULL;
} }
bool wxDataViewCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator ) bool wxDataViewCtrl::Create(wxWindow *parent,
wxWindowID id,
const wxPoint& pos,
const wxSize& size,
long style,
const wxValidator& validator,
const wxString& name)
{ {
if (!(wxControl::Create(parent,id,pos,size,style & ~(wxHSCROLL | wxVSCROLL),validator))) if (!(wxControl::Create(parent,id,pos,size,style,validator,name)))
return false; return false;
m_peer = ::CreateDataView(this,parent,id,pos,size,style,GetExtraStyle()); m_peer = ::CreateDataView(this,parent,id,pos,size,style,GetExtraStyle());