]> git.saurik.com Git - wxWidgets.git/commitdiff
Added selection API.
authorRobert Roebling <robert@roebling.de>
Tue, 3 Oct 2006 11:39:08 +0000 (11:39 +0000)
committerRobert Roebling <robert@roebling.de>
Tue, 3 Oct 2006 11:39:08 +0000 (11:39 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41585 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/dataview.h
include/wx/generic/dataview.h
include/wx/gtk/dataview.h
src/generic/datavgen.cpp
src/gtk/dataview.cpp

index 6fe87b4033a19e19308405c36f8f0f9c3c2c4a32..6d54285c5f76345a4411b294bf17513620d9b5b5 100644 (file)
@@ -24,7 +24,7 @@
 
 #if defined(__WXGTK20__)
     // for testing
-    #define wxUSE_GENERICDATAVIEWCTRL 1
+    // #define wxUSE_GENERICDATAVIEWCTRL 1
 #elif defined(__WXMAC__)
     #define wxUSE_GENERICDATAVIEWCTRL 1
 #else
@@ -102,7 +102,7 @@ public:
     }
 
     wxDataViewColumn   *m_viewColumn;
-    unsigned int              m_modelColumn;
+    unsigned int        m_modelColumn;
 };
 
 class WXDLLIMPEXP_ADV wxDataViewListModel: public wxDataViewModel
@@ -310,6 +310,15 @@ public:
     virtual bool ClearColumns();
     virtual wxDataViewColumn* GetColumn( unsigned int pos );
 
+    virtual void SetSelection( int row ) = 0; // -1 for unselect
+    inline void ClearSelection() { SetSelection( -1 ); }
+    virtual void SetSelectionRange( unsigned int from, unsigned int to ) = 0;
+    virtual void SetSelections( const wxArrayInt& aSelections) = 0;
+    
+    virtual bool IsSelected( unsigned int row ) const = 0;
+    virtual int GetSelection() const = 0;
+    virtual int GetSelections(wxArrayInt& aSelections) const = 0;
+
 private:
     wxDataViewListModel    *m_model;
     wxList                  m_cols;
index 7263c8d5fa6de74b482197b56d49835d28e27028..d300b95f1daaab9ba3e41c10b30850593ef0c999 100644 (file)
@@ -264,6 +264,14 @@ public:
     virtual bool AssociateModel( wxDataViewListModel *model );
     virtual bool AppendColumn( wxDataViewColumn *col );
 
+    virtual void SetSelection( int row ); // -1 for unselect
+    virtual void SetSelectionRange( unsigned int from, unsigned int to );
+    virtual void SetSelections( const wxArrayInt& aSelections);
+    
+    virtual bool IsSelected( unsigned int row ) const;
+    virtual int GetSelection() const;
+    virtual int GetSelections(wxArrayInt& aSelections) const;
+
 private:
     friend class wxDataViewMainWindow;
     friend class wxDataViewHeaderWindow;
index f945e880122d62bf4b1471a86cfc86085f0a5d6b..6e5eaf29fabd5be4633803b8f9222baf4db9acc1 100644 (file)
@@ -242,6 +242,15 @@ public:
     virtual bool AssociateModel( wxDataViewListModel *model );
     virtual bool AppendColumn( wxDataViewColumn *col );
     
+    virtual void SetSelection( int row ); // -1 for unselect
+    virtual void SetSelectionRange( unsigned int from, unsigned int to );
+    virtual void SetSelections( const wxArrayInt& aSelections);
+    
+    virtual bool IsSelected( unsigned int row ) const;
+    virtual int GetSelection() const;
+    virtual int GetSelections(wxArrayInt& aSelections) const;
+    
+    
 private:
     friend class wxDataViewCtrlDC;
     friend class wxGtkDataViewListModelNotifier;
index 8075b8b5cc5e1d5702ee36081272f4dd7db41acf..d7a1dde330a822fa0ce672a8ff1d3349a8ed115f 100644 (file)
@@ -1797,6 +1797,33 @@ bool wxDataViewCtrl::AppendColumn( wxDataViewColumn *col )
     return true;
 }
 
+void wxDataViewCtrl::SetSelection( int row )
+{
+}
+
+void wxDataViewCtrl::SetSelectionRange( unsigned int from, unsigned int to )
+{
+}
+
+void wxDataViewCtrl::SetSelections( const wxArrayInt& aSelections)
+{
+}
+    
+bool wxDataViewCtrl::IsSelected( unsigned int row ) const
+{
+    return false;
+}
+
+int wxDataViewCtrl::GetSelection() const
+{
+    return -1;
+}
+
+int wxDataViewCtrl::GetSelections(wxArrayInt& aSelections) const
+{
+    return 0;
+}
+
 #endif
     // !wxUSE_GENERICDATAVIEWCTRL
 
index f04b10d0dc0d22576dbab04844e074ae8565eee1..d20293d7389ee3bfc0bf8f1d8c1496f01fc83d1b 100644 (file)
@@ -1564,6 +1564,34 @@ bool wxDataViewCtrl::AppendColumn( wxDataViewColumn *col )
     return true;
 }
 
+void wxDataViewCtrl::SetSelection( int row )
+{
+}
+
+void wxDataViewCtrl::SetSelectionRange( unsigned int from, unsigned int to )
+{
+}
+
+void wxDataViewCtrl::SetSelections( const wxArrayInt& aSelections)
+{
+}
+    
+bool wxDataViewCtrl::IsSelected( unsigned int row ) const
+{
+    return false;
+}
+
+int wxDataViewCtrl::GetSelection() const
+{
+    return -1;
+}
+
+int wxDataViewCtrl::GetSelections(wxArrayInt& aSelections) const
+{
+    return 0;
+}
+
+
 #endif
     // !wxUSE_GENERICDATAVIEWCTRL