+ virtual bool RowAppended();
+ virtual bool RowPrepended();
+ virtual bool RowInserted( unsigned int before );
+ virtual bool RowDeleted( unsigned int row );
+ virtual bool RowChanged( unsigned int row );
+ virtual bool ValueChanged( unsigned int col, unsigned int row );
+ virtual bool RowsReordered( unsigned int *new_order );
+ virtual bool Cleared();
+
+ // Used internally
+ void AddViewingColumn( wxDataViewColumn *view_column, unsigned int model_column );
+ void RemoveViewingColumn( wxDataViewColumn *column );
+
+ void AddNotifier( wxDataViewListModelNotifier *notifier );
+ void RemoveNotifier( wxDataViewListModelNotifier *notifier );
+
+ wxList m_notifiers;
+ wxList m_viewingColumns;
+
+protected:
+ DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewListModel)
+};
+
+// ---------------------------------------------------------
+// wxDataViewSortedListModel
+// ---------------------------------------------------------
+
+typedef int (wxCALLBACK *wxDataViewListModelCompare)
+ (unsigned int row1, unsigned int row2, unsigned int col, wxDataViewListModel* model );
+
+WX_DEFINE_SORTED_USER_EXPORTED_ARRAY_SIZE_T(unsigned int, wxDataViewSortedIndexArray, WXDLLIMPEXP_ADV);
+
+class WXDLLIMPEXP_ADV wxDataViewSortedListModel: public wxDataViewListModel
+{
+public:
+ wxDataViewSortedListModel( wxDataViewListModel *child );
+ virtual ~wxDataViewSortedListModel();
+
+ void SetAscending( bool ascending ) { m_ascending = ascending; }
+ bool GetAscending() { return m_ascending; }
+
+ virtual unsigned int GetNumberOfRows();
+ virtual unsigned int GetNumberOfCols();
+ // return type as reported by wxVariant
+ virtual wxString GetColType( unsigned int col );
+ // get value into a wxVariant
+ virtual void GetValue( wxVariant &variant, unsigned int col, unsigned int row );
+ // set value, call ValueChanged() afterwards!
+ virtual bool SetValue( wxVariant &variant, unsigned int col, unsigned int row );
+
+ // called from user
+ virtual bool RowAppended();
+ virtual bool RowPrepended();
+ virtual bool RowInserted( unsigned int before );
+ virtual bool RowDeleted( unsigned int row );
+ virtual bool RowChanged( unsigned int row );
+ virtual bool ValueChanged( unsigned int col, unsigned int row );
+ virtual bool RowsReordered( unsigned int *new_order );
+ virtual bool Cleared();
+
+ // called if child's notifiers are called
+ bool ChildRowAppended();
+ bool ChildRowPrepended();
+ bool ChildRowInserted( unsigned int before );
+ bool ChildRowDeleted( unsigned int row );
+ bool ChildRowChanged( unsigned int row );
+ bool ChildValueChanged( unsigned int col, unsigned int row );
+ bool ChildRowsReordered( unsigned int *new_order );
+ bool ChildCleared();
+
+ virtual void Resort();
+
+private:
+ bool m_ascending;
+ wxDataViewListModel *m_child;
+ wxDataViewSortedIndexArray m_array;
+ wxDataViewListModelNotifier *m_notifierOnChild;
+
+ void InitStatics(); // BAD
+
+protected:
+ DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewSortedListModel)
+};
+
+// ---------------------------------------------------------
+// wxDataViewRendererBase
+// ---------------------------------------------------------
+
+enum wxDataViewCellMode
+{
+ wxDATAVIEW_CELL_INERT,
+ wxDATAVIEW_CELL_ACTIVATABLE,
+ wxDATAVIEW_CELL_EDITABLE
+};
+
+enum wxDataViewCellRenderState
+{
+ wxDATAVIEW_CELL_SELECTED = 1,
+ wxDATAVIEW_CELL_PRELIT = 2,
+ wxDATAVIEW_CELL_INSENSITIVE = 4,
+ wxDATAVIEW_CELL_FOCUSED = 8
+};
+
+class WXDLLIMPEXP_ADV wxDataViewRendererBase: public wxObject
+{
+public:
+ wxDataViewRendererBase( const wxString &varianttype, wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT );
+
+ virtual bool SetValue( const wxVariant& WXUNUSED(value) ) { return true; }
+ virtual bool GetValue( wxVariant& WXUNUSED(value) ) { return true; }
+ virtual bool Validate( wxVariant& WXUNUSED(value) ) { return true; }
+
+ wxString GetVariantType() { return m_variantType; }
+ wxDataViewCellMode GetMode() { return m_mode; }
+
+ void SetOwner( wxDataViewColumn *owner ) { m_owner = owner; }
+ wxDataViewColumn* GetOwner() { return m_owner; }
+
+protected:
+ wxDataViewCellMode m_mode;
+ wxString m_variantType;
+ wxDataViewColumn *m_owner;
+
+protected:
+ DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewRendererBase)
+};
+
+// ---------------------------------------------------------
+// wxDataViewColumnBase
+// ---------------------------------------------------------
+
+enum wxDataViewColumnFlags
+{
+ wxDATAVIEW_COL_RESIZABLE = 1,
+ wxDATAVIEW_COL_SORTABLE = 2,
+ wxDATAVIEW_COL_HIDDEN = 4
+};
+
+class WXDLLIMPEXP_ADV wxDataViewColumnBase: public wxObject
+{
+public:
+ wxDataViewColumnBase( const wxString &title, wxDataViewRenderer *renderer, unsigned int model_column,
+ int width = 80, int flags = wxDATAVIEW_COL_RESIZABLE );
+ wxDataViewColumnBase( const wxBitmap &bitmap, wxDataViewRenderer *renderer, unsigned int model_column,
+ int width = 80, int flags = wxDATAVIEW_COL_RESIZABLE );
+ virtual ~wxDataViewColumnBase();
+
+ virtual void SetTitle( const wxString &title );
+ virtual wxString GetTitle();
+
+ virtual void SetBitmap( const wxBitmap &bitmap );
+ virtual const wxBitmap &GetBitmap();