X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6de6ca4c7458b3db985a146f63725f820ef4c11c..b6b171522b1aa2241447e187e422c892ded76053:/include/wx/treelist.h diff --git a/include/wx/treelist.h b/include/wx/treelist.h index bb27f9d8f9..6684a26bb3 100644 --- a/include/wx/treelist.h +++ b/include/wx/treelist.h @@ -456,6 +456,9 @@ private: class wxTreeListEvent : public wxNotifyEvent { public: + // Default ctor is provided for wxRTTI needs only but should never be used. + wxTreeListEvent() { Init(); } + // The item affected by the event. Valid for all events except // column-specific ones such as COLUMN_SORTED. wxTreeListItem GetItem() const { return m_item; } @@ -470,6 +473,14 @@ public: virtual wxEvent* Clone() const { return new wxTreeListEvent(*this); } private: + // Common part of all ctors. + void Init() + { + m_column = static_cast(-1); + + m_oldCheckedState = wxCHK_UNDETERMINED; + } + // Ctor is private, only wxTreeListCtrl can create events of this type. wxTreeListEvent(wxEventType evtType, wxTreeListCtrl* treelist, @@ -479,9 +490,7 @@ private: { SetEventObject(treelist); - m_column = static_cast(-1); - - m_oldCheckedState = wxCHK_UNDETERMINED; + Init(); } // Set the checkbox state before this event for ITEM_CHECKED events. @@ -505,7 +514,7 @@ private: friend class wxTreeListCtrl; - wxDECLARE_ABSTRACT_CLASS(wxTreeListEvent); + wxDECLARE_DYNAMIC_CLASS(wxTreeListEvent); }; // Event types and event table macros.