X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/da2e758f83f62cf9ff3bed69aecb8fc00f2583df..7344108e8a129a3f9b4df5ab0f98a1713db03b89:/include/wx/treelist.h?ds=sidebyside diff --git a/include/wx/treelist.h b/include/wx/treelist.h index 1b33b5abcc..081ecb09ca 100644 --- a/include/wx/treelist.h +++ b/include/wx/treelist.h @@ -26,7 +26,7 @@ class WXDLLIMPEXP_FWD_ADV wxDataViewCtrl; class WXDLLIMPEXP_FWD_ADV wxDataViewEvent; -extern WXDLLIMPEXP_DATA_CORE(const char) wxTreeListCtrlNameStr[]; +extern WXDLLIMPEXP_DATA_ADV(const char) wxTreeListCtrlNameStr[]; class wxTreeListCtrl; class wxTreeListModel; @@ -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.