+// ----------------------------------------------------------------------------
+// wxDataViewEvent - the event class for the wxDataViewCtrl notifications
+// ----------------------------------------------------------------------------
+
+class WXDLLIMPEXP_ADV wxDataViewEvent : public wxNotifyEvent
+{
+public:
+ wxDataViewEvent(wxEventType commandType = wxEVT_NULL, int winid = 0)
+ : wxNotifyEvent(commandType, winid),
+ m_item(0),
+ m_col(-1),
+ m_model(NULL),
+ m_value(wxNullVariant),
+ m_column(NULL)
+ { }
+
+ wxDataViewEvent(const wxDataViewEvent& event)
+ : wxNotifyEvent(event),
+ m_item(event.m_item),
+ m_col(event.m_col),
+ m_model(event.m_model),
+ m_value(event.m_value),
+ m_column(event.m_column)
+ { }
+
+ wxDataViewItem GetItem() const { return m_item; }
+ void SetItem( const wxDataViewItem &item ) { m_item = item; }
+
+ int GetColumn() const { return m_col; }
+ void SetColumn( int col ) { m_col = col; }
+
+ wxDataViewModel* GetModel() const { return m_model; }
+ void SetModel( wxDataViewModel *model ) { m_model = model; }
+
+ const wxVariant &GetValue() const { return m_value; }
+ void SetValue( const wxVariant &value ) { m_value = value; }
+
+ // for wxEVT_DATAVIEW_COLUMN_HEADER_CLICKED only
+ void SetDataViewColumn( wxDataViewColumn *col ) { m_column = col; }
+ wxDataViewColumn *GetDataViewColumn() const { return m_column; }
+
+ virtual wxEvent *Clone() const { return new wxDataViewEvent(*this); }
+
+protected:
+ wxDataViewItem m_item;
+ int m_col;
+ wxDataViewModel *m_model;
+ wxVariant m_value;
+ wxDataViewColumn *m_column;
+
+private:
+ DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxDataViewEvent)
+};
+
+BEGIN_DECLARE_EVENT_TYPES()
+ DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, -1)
+
+ DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED, -1)
+ DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSED, -1)
+ DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDED, -1)
+ DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSING, -1)
+ DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDING, -1)
+ DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_STARTED, -1)
+ DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_DONE, -1)
+ DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED, -1)
+
+ DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_CLICK, -1)
+ DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK, -1)
+ DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED, -1)
+END_DECLARE_EVENT_TYPES()
+
+typedef void (wxEvtHandler::*wxDataViewEventFunction)(wxDataViewEvent&);
+
+#define wxDataViewEventHandler(func) \
+ (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxDataViewEventFunction, &func)
+
+#define wx__DECLARE_DATAVIEWEVT(evt, id, fn) \
+ wx__DECLARE_EVT1(wxEVT_COMMAND_DATAVIEW_ ## evt, id, wxDataViewEventHandler(fn))
+
+#define EVT_DATAVIEW_SELECTION_CHANGED(id, fn) wx__DECLARE_DATAVIEWEVT(SELECTION_CHANGED, id, fn)
+
+#define EVT_DATAVIEW_ITEM_ACTIVATED(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_ACTIVATED, id, fn)
+#define EVT_DATAVIEW_ITEM_COLLAPSING(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_COLLAPSING, id, fn)
+#define EVT_DATAVIEW_ITEM_COLLAPSED(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_COLLAPSED, id, fn)
+#define EVT_DATAVIEW_ITEM_EXPANDING(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_EXPANDING, id, fn)
+#define EVT_DATAVIEW_ITEM_EXPANDED(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_EXPANDED, id, fn)
+#define EVT_DATAVIEW_ITEM_EDITING_STARTED(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_EDITING_STARTED, id, fn)
+#define EVT_DATAVIEW_ITEM_EDITING_DONE(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_EDITING_DONE, id, fn)
+#define EVT_DATAVIEW_ITEM_VALUE_CHANGED(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_VALUE_CHANGED, id, fn)
+
+#define EVT_DATAVIEW_COLUMN_HEADER_CLICK(id, fn) wx__DECLARE_DATAVIEWEVT(COLUMN_HEADER_CLICK, id, fn)
+#define EVT_DATAVIEW_COLUMN_HEADER_RIGHT_CLICKED(id, fn) wx__DECLARE_DATAVIEWEVT(COLUMN_HEADER_RIGHT_CLICK, id, fn)
+#define EVT_DATAVIEW_COLUMN_SORTED(id, fn) wx__DECLARE_DATAVIEWEVT(COLUMN_SORTED, id, fn)
+