- virtual void SetSelection( int row ); // -1 for unselect
- virtual void SetSelectionRange( unsigned int from, unsigned int to );
- virtual void SetSelections( const wxArrayInt& aSelections);
- virtual void Unselect( unsigned int row );
-
- virtual bool IsSelected( unsigned int row ) const;
- virtual int GetSelection() const;
- virtual int GetSelections(wxArrayInt& aSelections) const;
+ virtual void Expand( const wxDataViewItem & item );
+ virtual void Collapse( const wxDataViewItem & item );
+ virtual bool IsExpanded( const wxDataViewItem & item ) const;
+
+ virtual void SetFocus();
+
+#if wxUSE_DRAG_AND_DROP
+ virtual bool EnableDragSource( const wxDataFormat &format );
+ virtual bool EnableDropTarget( const wxDataFormat &format );
+#endif // wxUSE_DRAG_AND_DROP
+
+ virtual wxBorder GetDefaultBorder() const;
+
+ void StartEditor( const wxDataViewItem & item, unsigned int column );
+
+protected:
+ virtual int GetSelections( wxArrayInt & sel ) const;
+ virtual void SetSelections( const wxArrayInt & sel );
+ virtual void Select( int row );
+ virtual void Unselect( int row );
+ virtual bool IsSelected( int row ) const;
+ virtual void SelectRange( int from, int to );
+ virtual void UnselectRange( int from, int to );
+
+ virtual void EnsureVisible( int row, int column );
+
+ virtual wxDataViewItem GetItemByRow( unsigned int row ) const;
+ virtual int GetRowByItem( const wxDataViewItem & item ) const;
+
+ int GetSortingColumnIndex() const { return m_sortingColumnIdx; }
+ void SetSortingColumnIndex(int idx) { m_sortingColumnIdx = idx; }
+
+public: // utility functions not part of the API
+
+ // returns the "best" width for the idx-th column
+ unsigned int GetBestColumnWidth(int WXUNUSED(idx)) const
+ {
+ return GetClientSize().GetWidth() / GetColumnCount();
+ }
+
+ // called by header window after reorder
+ void ColumnMoved( wxDataViewColumn* col, unsigned int new_pos );
+
+ // update the display after a change to an individual column
+ void OnColumnChange(unsigned int idx);
+
+ // update after a change to the number of columns
+ void OnColumnsCountChanged();
+
+ wxWindow *GetMainWindow() { return (wxWindow*) m_clientArea; }
+
+ // return the index of the given column in m_cols
+ int GetColumnIndex(const wxDataViewColumn *column) const;
+
+ // return the column displayed at the given position in the control
+ wxDataViewColumn *GetColumnAt(unsigned int pos) const;