X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d8331a013b9cd0109a3a6d3c4e7b60b0b524eb06..3ac1094bead05e30462122d00e4859725d2ea59f:/include/wx/dataview.h diff --git a/include/wx/dataview.h b/include/wx/dataview.h index 1c5f4d0b97..ec832adb83 100644 --- a/include/wx/dataview.h +++ b/include/wx/dataview.h @@ -81,10 +81,38 @@ private: 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: @@ -111,7 +139,7 @@ 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(); @@ -135,9 +163,9 @@ protected: // 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; }; // --------------------------------------------------------- @@ -193,32 +221,6 @@ private: 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 //-----------------------------------------------------------------------------