diff --git a/include/wx/dataview.h b/include/wx/dataview.h index bdbc2f4bc0..b1229375ad 100644 --- a/include/wx/dataview.h +++ b/include/wx/dataview.h @@ -955,6 +955,15 @@ public: wxDataViewItem RowToItem(int row) const { return row == wxNOT_FOUND ? wxDataViewItem() : GetStore()->GetItem(row); } + int GetSelectedRow() const + { return ItemToRow(GetSelection()); } + void SelectRow(unsigned row) + { Select(RowToItem(row)); } + void UnselectRow(unsigned row) + { Unselect(RowToItem(row)); } + bool IsRowSelected(unsigned row) const + { return IsSelected(RowToItem(row)); } + bool AppendColumn( wxDataViewColumn *column, const wxString &varianttype ); bool PrependColumn( wxDataViewColumn *column, const wxString &varianttype ); bool InsertColumn( unsigned int pos, wxDataViewColumn *column, const wxString &varianttype ); diff --git a/interface/wx/dataview.h b/interface/wx/dataview.h index a5e2096cac..1bcdf86eb0 100644 --- a/interface/wx/dataview.h +++ b/interface/wx/dataview.h @@ -1769,6 +1769,49 @@ public: */ wxDataViewItem RowToItem(int row) const; + //@{ + /** + @name Selection handling functions + */ + + /** + Returns index of the selected row or wxNOT_FOUND. + + @see wxDataViewCtrl::GetSelection() + + @since 2.9.2 + */ + int GetSelectedRow() const; + + /** + Selects given row. + + @see wxDataViewCtrl::Select() + + @since 2.9.2 + */ + void SelectRow(unsigned row); + + /** + Unselects given row. + + @see wxDataViewCtrl::Unselect() + + @since 2.9.2 + */ + void UnselectRow(unsigned row); + + /** + Returns true if @a row is selected. + + @see wxDataViewCtrl::IsSelected() + + @since 2.9.2 + */ + bool IsRowSelected(unsigned row) const; + + //@} + /** @name Column management functions */