X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6de6ca4c7458b3db985a146f63725f820ef4c11c..1bcef6701be81d1f4473eb5a297bdf20fa292d98:/include/wx/treelist.h diff --git a/include/wx/treelist.h b/include/wx/treelist.h index bb27f9d8f9..081ecb09ca 100644 --- a/include/wx/treelist.h +++ b/include/wx/treelist.h @@ -453,9 +453,12 @@ private: // wxTreeListEvent: event generated by wxTreeListCtrl. // ---------------------------------------------------------------------------- -class wxTreeListEvent : public wxNotifyEvent +class WXDLLIMPEXP_ADV 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_NO_ASSIGN(wxTreeListEvent); }; // Event types and event table macros.