From: Vadim Zeitlin Date: Sun, 8 Aug 2010 11:37:57 +0000 (+0000) Subject: Add name argument to wxDataViewCtrl ctor for consistency. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/62e9285abaaf4f5d1261434b20b390a4c0486585 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 --- diff --git a/include/wx/generic/dataview.h b/include/wx/generic/dataview.h index a2d944ab93..aee0e0e968 100644 --- a/include/wx/generic/dataview.h +++ b/include/wx/generic/dataview.h @@ -120,10 +120,11 @@ public: wxDataViewCtrl( wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator ) + const wxValidator& validator = wxDefaultValidator, + const wxString& name = wxDataViewCtrlNameStr ); : wxScrollHelper(this) { - Create(parent, id, pos, size, style, validator ); + Create(parent, id, pos, size, style, validator, name); } virtual ~wxDataViewCtrl(); @@ -133,7 +134,8 @@ public: bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator ); + const wxValidator& validator = wxDefaultValidator, + const wxString& name = wxDataViewCtrlNameStr); virtual bool AssociateModel( wxDataViewModel *model ); diff --git a/include/wx/gtk/dataview.h b/include/wx/gtk/dataview.h index b8064ad50d..2c22beb144 100644 --- a/include/wx/gtk/dataview.h +++ b/include/wx/gtk/dataview.h @@ -113,17 +113,19 @@ public: wxDataViewCtrl( wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator ) + const wxValidator& validator = wxDefaultValidator, + const wxString& name = wxDataViewCtrlNameStr ) { Init(); - Create(parent, id, pos, size, style, validator ); + Create(parent, id, pos, size, style, validator, name); } bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator ); + const wxValidator& validator = wxDefaultValidator, + const wxString& name = wxDataViewCtrlNameStr); virtual ~wxDataViewCtrl(); diff --git a/include/wx/osx/dataview.h b/include/wx/osx/dataview.h index fcb57dead1..cd97cd038c 100644 --- a/include/wx/osx/dataview.h +++ b/include/wx/osx/dataview.h @@ -129,18 +129,27 @@ public: { Init(); } - wxDataViewCtrl(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator) + wxDataViewCtrl(wxWindow *parent, + wxWindowID winid, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = 0, + const wxValidator& validator = wxDefaultValidator, + const wxString& name = wxDataViewCtrlNameStr ) { Init(); - Create(parent, id, pos, size, style, validator ); + Create(parent, winid, pos, size, style, validator, name); } ~wxDataViewCtrl(); - // explicit control creation - bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos=wxDefaultPosition, const wxSize& size=wxDefaultSize, long style=0, - const wxValidator& validator=wxDefaultValidator); + bool Create(wxWindow *parent, + wxWindowID winid, + 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 { diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index c43f842d5f..b80eeaf622 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -3888,9 +3888,13 @@ void wxDataViewCtrl::Init() m_headerArea = 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 ( (style & wxBORDER_MASK) == 0) // style |= wxBORDER_SUNKEN; @@ -3898,7 +3902,7 @@ bool wxDataViewCtrl::Create(wxWindow *parent, wxWindowID id, Init(); if (!wxControl::Create( parent, id, pos, size, - style | wxScrolledWindowStyle, validator)) + style | wxScrolledWindowStyle, validator, name)) return false; SetInitialSize(size); diff --git a/src/gtk/dataview.cpp b/src/gtk/dataview.cpp index 586eefa182..1763e1881e 100644 --- a/src/gtk/dataview.cpp +++ b/src/gtk/dataview.cpp @@ -4256,12 +4256,16 @@ void wxDataViewCtrl::Init() m_cols.DeleteContents( true ); } -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 (!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") ); return false; diff --git a/src/osx/dataview_osx.cpp b/src/osx/dataview_osx.cpp index 91c22b7e43..41d7ca3260 100644 --- a/src/osx/dataview_osx.cpp +++ b/src/osx/dataview_osx.cpp @@ -333,9 +333,15 @@ void wxDataViewCtrl::Init() m_cgContext = NULL; } -bool wxDataViewCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator ) -{ - if (!(wxControl::Create(parent,id,pos,size,style & ~(wxHSCROLL | wxVSCROLL),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,validator,name))) return false; m_peer = ::CreateDataView(this,parent,id,pos,size,style,GetExtraStyle());