// wxDataViewCtrl globals
// ----------------------------------------------------------------------------
+class WXDLLIMPEXP_CORE wxDataViewModel;
+class WXDLLIMPEXP_CORE wxDataViewListModel;
class WXDLLIMPEXP_CORE wxDataViewCtrl;
class WXDLLIMPEXP_CORE wxDataViewColumn;
class WXDLLIMPEXP_CORE wxDataViewCell;
// wxDataViewListModelNotifier
// ---------------------------------------------------------
-class wxDataViewListModelNotifier
+
+class wxDataViewListModelNotifier: public wxObject
{
public:
wxDataViewListModelNotifier() { }
virtual bool RowDeleted( size_t row ) = 0;
virtual bool RowChanged( size_t row ) = 0;
virtual bool ValueChanged( size_t col, size_t row ) = 0;
+ virtual bool RowsReordered( size_t *new_order ) = 0;
virtual bool Cleared() = 0;
- virtual bool ValueChanged( wxDataViewColumn *view_column, size_t model_column, size_t row ) = 0;
+
+ void SetOwner( wxDataViewListModel *owner ) { m_owner = owner; }
+ wxDataViewListModel *GetOwner() { return m_owner; }
+
+private:
+ wxDataViewListModel *m_owner;
};
// ---------------------------------------------------------
// wxDataViewListModel
// ---------------------------------------------------------
+class wxDataViewViewingColumn: public wxObject
+{
+public:
+ wxDataViewViewingColumn( wxDataViewColumn *view_column, size_t model_column )
+ {
+ m_viewColumn = view_column;
+ m_modelColumn = model_column;
+ }
+
+ wxDataViewColumn *m_viewColumn;
+ size_t m_modelColumn;
+};
+
class wxDataViewListModel: public wxDataViewModel
{
public:
// return type as reported by wxVariant
virtual wxString GetColType( size_t col ) = 0;
// get value into a wxVariant
- virtual wxVariant GetValue( size_t col, size_t row ) = 0;
+ virtual void GetValue( wxVariant &variant, size_t col, size_t row ) = 0;
// set value, call ValueChanged() afterwards!
virtual bool SetValue( wxVariant &variant, size_t col, size_t row ) = 0;
virtual bool RowDeleted( size_t row );
virtual bool RowChanged( size_t row );
virtual bool ValueChanged( size_t col, size_t row );
+ virtual bool RowsReordered( size_t *new_order );
virtual bool Cleared();
// Used internally
virtual void AddViewingColumn( wxDataViewColumn *view_column, size_t model_column );
virtual void RemoveViewingColumn( wxDataViewColumn *column );
- // Used internally
- virtual void SetNotifier( wxDataViewListModelNotifier *notifier );
- virtual wxDataViewListModelNotifier* GetNotifier();
+ virtual void AddNotifier( wxDataViewListModelNotifier *notifier );
+ virtual void RemoveNotifier( wxDataViewListModelNotifier *notifier );
-private:
- wxDataViewListModelNotifier *m_notifier;
- wxList m_viewingColumns;
+ wxList m_notifiers;
+ wxList m_viewingColumns;
protected:
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewListModel)
// return type as reported by wxVariant
virtual wxString GetColType( size_t col );
// get value into a wxVariant
- virtual wxVariant GetValue( size_t col, size_t row );
+ virtual void GetValue( wxVariant &variant, size_t col, size_t row );
// set value, call ValueChanged() afterwards!
virtual bool SetValue( wxVariant &variant, size_t col, size_t row );
virtual bool RowDeleted( size_t row );
virtual bool RowChanged( size_t row );
virtual bool ValueChanged( size_t col, size_t row );
+ virtual bool RowsReordered( size_t *new_order );
virtual bool Cleared();
- // Used internally
- void SetNotifier( wxDataViewListModelNotifier *notifier );
- wxDataViewListModelNotifier* GetNotifier();
-
+ bool ChildValueChanged( size_t col, size_t row );
+
+ virtual void Resort();
+
private:
wxDataViewListModel *m_child;
wxDataViewSortedIndexArray m_array;
+ wxDataViewListModelNotifier *m_notifierOnChild;
protected:
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewSortedListModel)