Extract member fields initialization in Init() method instead of duplicating
it in default ctor and Create().
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64497
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
{
public:
// ctors and such
{
public:
// ctors and such
+ wxListBox() { Init(); }
wxListBox(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
wxListBox(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr)
{
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr)
{
Create(parent, id, pos, size, n, choices, style, validator, name);
}
wxListBox(wxWindow *parent, wxWindowID id,
Create(parent, id, pos, size, n, choices, style, validator, name);
}
wxListBox(wxWindow *parent, wxWindowID id,
+ // common part of all ctors
+ void Init();
+
// call this when items are added to or deleted from the listbox or an
// items text changes
void MSWOnItemsChanged();
// call this when items are added to or deleted from the listbox or an
// items text changes
void MSWOnItemsChanged();
// creation
// ----------------------------------------------------------------------------
// creation
// ----------------------------------------------------------------------------
-// Listbox item
-wxListBox::wxListBox()
{
m_noItems = 0;
m_updateHorizontalExtent = false;
{
m_noItems = 0;
m_updateHorizontalExtent = false;
const wxValidator& validator,
const wxString& name)
{
const wxValidator& validator,
const wxString& name)
{
- m_noItems = 0;
- m_updateHorizontalExtent = false;
-
// initialize base class fields
if ( !CreateControl(parent, id, pos, size, style, validator, name) )
return false;
// initialize base class fields
if ( !CreateControl(parent, id, pos, size, style, validator, name) )
return false;