Make wxTreeListEvent dynamically creatable.
This is unfortunately required by wxEvent::Clone() support unit test so provide the default ctor in this class even though it doesn't make any sense in normal use. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69619 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -456,6 +456,9 @@ private:
|
|||||||
class wxTreeListEvent : public wxNotifyEvent
|
class wxTreeListEvent : public wxNotifyEvent
|
||||||
{
|
{
|
||||||
public:
|
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
|
// The item affected by the event. Valid for all events except
|
||||||
// column-specific ones such as COLUMN_SORTED.
|
// column-specific ones such as COLUMN_SORTED.
|
||||||
wxTreeListItem GetItem() const { return m_item; }
|
wxTreeListItem GetItem() const { return m_item; }
|
||||||
@@ -470,6 +473,14 @@ public:
|
|||||||
virtual wxEvent* Clone() const { return new wxTreeListEvent(*this); }
|
virtual wxEvent* Clone() const { return new wxTreeListEvent(*this); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
// Common part of all ctors.
|
||||||
|
void Init()
|
||||||
|
{
|
||||||
|
m_column = static_cast<unsigned>(-1);
|
||||||
|
|
||||||
|
m_oldCheckedState = wxCHK_UNDETERMINED;
|
||||||
|
}
|
||||||
|
|
||||||
// Ctor is private, only wxTreeListCtrl can create events of this type.
|
// Ctor is private, only wxTreeListCtrl can create events of this type.
|
||||||
wxTreeListEvent(wxEventType evtType,
|
wxTreeListEvent(wxEventType evtType,
|
||||||
wxTreeListCtrl* treelist,
|
wxTreeListCtrl* treelist,
|
||||||
@@ -479,9 +490,7 @@ private:
|
|||||||
{
|
{
|
||||||
SetEventObject(treelist);
|
SetEventObject(treelist);
|
||||||
|
|
||||||
m_column = static_cast<unsigned>(-1);
|
Init();
|
||||||
|
|
||||||
m_oldCheckedState = wxCHK_UNDETERMINED;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the checkbox state before this event for ITEM_CHECKED events.
|
// Set the checkbox state before this event for ITEM_CHECKED events.
|
||||||
@@ -505,7 +514,7 @@ private:
|
|||||||
|
|
||||||
friend class wxTreeListCtrl;
|
friend class wxTreeListCtrl;
|
||||||
|
|
||||||
wxDECLARE_ABSTRACT_CLASS(wxTreeListEvent);
|
wxDECLARE_DYNAMIC_CLASS(wxTreeListEvent);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Event types and event table macros.
|
// Event types and event table macros.
|
||||||
|
@@ -1654,7 +1654,7 @@ wxWindow* wxTreeListCtrl::GetView() const
|
|||||||
// wxTreeListEvent implementation
|
// wxTreeListEvent implementation
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
wxIMPLEMENT_ABSTRACT_CLASS(wxTreeListEvent, wxNotifyEvent)
|
wxIMPLEMENT_DYNAMIC_CLASS(wxTreeListEvent, wxNotifyEvent)
|
||||||
|
|
||||||
#define wxDEFINE_TREELIST_EVENT(name) \
|
#define wxDEFINE_TREELIST_EVENT(name) \
|
||||||
wxDEFINE_EVENT(wxEVT_COMMAND_TREELIST_##name, wxTreeListEvent)
|
wxDEFINE_EVENT(wxEVT_COMMAND_TREELIST_##name, wxTreeListEvent)
|
||||||
|
Reference in New Issue
Block a user