bool operator == (const wxDataViewItem &left, const wxDataViewItem &right);
+// ---------------------------------------------------------
+// wxDataViewModelNotifier
+// ---------------------------------------------------------
+
+class WXDLLIMPEXP_ADV wxDataViewModelNotifier
+{
+public:
+ wxDataViewModelNotifier() { }
+ virtual ~wxDataViewModelNotifier() { m_owner = NULL; }
+
+ virtual bool ItemAdded( const wxDataViewItem &parent, const wxDataViewItem &item ) = 0;
+ virtual bool ItemDeleted( const wxDataViewItem &parent, const wxDataViewItem &item ) = 0;
+ virtual bool ItemChanged( const wxDataViewItem &item ) = 0;
+ virtual bool ValueChanged( const wxDataViewItem &item, unsigned int col ) = 0;
+ virtual bool Cleared() = 0;
+
+ virtual void Resort() = 0;
+
+ void SetOwner( wxDataViewModel *owner ) { m_owner = owner; }
+ wxDataViewModel *GetOwner() { return m_owner; }
+
+private:
+ wxDataViewModel *m_owner;
+};
+
+
// ---------------------------------------------------------
// wxDataViewModel
// ---------------------------------------------------------
+WX_DECLARE_LIST(wxDataViewModelNotifier, wxDataViewModelNotifiers );
+
class WXDLLIMPEXP_ADV wxDataViewModel: public wxObjectRefData
{
public:
// delegated notifiers
virtual bool ItemAdded( const wxDataViewItem &parent, const wxDataViewItem &item );
- virtual bool ItemDeleted( const wxDataViewItem &item );
+ virtual bool ItemDeleted( const wxDataViewItem &parent, const wxDataViewItem &item );
virtual bool ItemChanged( const wxDataViewItem &item );
virtual bool ValueChanged( const wxDataViewItem &item, unsigned int col );
virtual bool Cleared();
// the user should not delete this class directly: he should use DecRef() instead!
virtual ~wxDataViewModel() { }
- wxList m_notifiers;
- unsigned int m_sortingColumn;
- bool m_ascending;
+ wxDataViewModelNotifiers m_notifiers;
+ unsigned int m_sortingColumn;
+ bool m_ascending;
};
// ---------------------------------------------------------
unsigned int m_lastIndex;
};
-// ---------------------------------------------------------
-// wxDataViewModelNotifier
-// ---------------------------------------------------------
-
-class WXDLLIMPEXP_ADV wxDataViewModelNotifier: public wxObject
-{
-public:
- wxDataViewModelNotifier() { }
- virtual ~wxDataViewModelNotifier() { m_owner = NULL; }
-
- virtual bool ItemAdded( const wxDataViewItem &parent, const wxDataViewItem &item ) = 0;
- virtual bool ItemDeleted( const wxDataViewItem &item ) = 0;
- virtual bool ItemChanged( const wxDataViewItem &item ) = 0;
- virtual bool ValueChanged( const wxDataViewItem &item, unsigned int col ) = 0;
- virtual bool Cleared() = 0;
-
- virtual void Resort() { };
-
- void SetOwner( wxDataViewModel *owner ) { m_owner = owner; }
- wxDataViewModel *GetOwner() { return m_owner; }
-
-private:
- wxDataViewModel *m_owner;
-};
-
-
//-----------------------------------------------------------------------------
// wxDataViewEditorCtrlEvtHandler
//-----------------------------------------------------------------------------
#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)
-#define EVT_DATAVIEW_MODEL_ITEM_ADDED(id, fn) wx__DECLARE_DATAVIEWEVT(MODEL_ITEM_APPENDED, id, fn)
+#define EVT_DATAVIEW_MODEL_ITEM_ADDED(id, fn) wx__DECLARE_DATAVIEWEVT(MODEL_ITEM_ADDED, id, fn)
#define EVT_DATAVIEW_MODEL_ITEM_DELETED(id, fn) wx__DECLARE_DATAVIEWEVT(MODEL_ITEM_DELETED, id, fn)
#define EVT_DATAVIEW_MODEL_ITEM_CHANGED(id, fn) wx__DECLARE_DATAVIEWEVT(MODEL_ITEM_CHANGED, id, fn)
#define EVT_DATAVIEW_MODEL_VALUE_CHANGED(id, fn) wx__DECLARE_DATAVIEWEVT(MODEL_VALUE_CHANGED, id, fn)