Add wxDataViewCtrl::{Set,Get}CurrentItem().
Current item is the same as the selected item in single selection mode but in multiple selection mode there was no way to neither get this item nor change it before so add the new functions to allow doing this now. The new methods are implemented for the generic, GTK and OS X/Cocoa versions but only stubs are provided for OS X/Carbon. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65228 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -642,6 +642,12 @@ public:
|
||||
int GetIndent() const
|
||||
{ return m_indent; }
|
||||
|
||||
// Current item is the one used by the keyboard navigation, it is the same
|
||||
// as the (unique) selected item in single selection mode so these
|
||||
// functions are mostly useful for controls with wxDV_MULTIPLE style.
|
||||
wxDataViewItem GetCurrentItem() const;
|
||||
void SetCurrentItem(const wxDataViewItem& item);
|
||||
|
||||
virtual wxDataViewItem GetSelection() const = 0;
|
||||
virtual int GetSelections( wxDataViewItemArray & sel ) const = 0;
|
||||
virtual void SetSelections( const wxDataViewItemArray & sel ) = 0;
|
||||
@@ -688,6 +694,12 @@ protected:
|
||||
virtual void DoSetIndent() = 0;
|
||||
|
||||
private:
|
||||
// Implementation of the public Set/GetCurrentItem() methods which are only
|
||||
// called in multi selection case (for single selection controls their
|
||||
// implementation is trivial and is done in the base class itself).
|
||||
virtual wxDataViewItem DoGetCurrentItem() const = 0;
|
||||
virtual void DoSetCurrentItem(const wxDataViewItem& item) = 0;
|
||||
|
||||
wxDataViewModel *m_model;
|
||||
wxDataViewColumn *m_expander_column;
|
||||
int m_indent ;
|
||||
|
@@ -229,6 +229,9 @@ public: // utility functions not part of the API
|
||||
wxDataViewColumn *GetColumnAt(unsigned int pos) const;
|
||||
|
||||
private:
|
||||
virtual wxDataViewItem DoGetCurrentItem() const;
|
||||
virtual void DoSetCurrentItem(const wxDataViewItem& item);
|
||||
|
||||
wxDataViewColumnList m_cols;
|
||||
wxDataViewModelNotifier *m_notifier;
|
||||
wxDataViewMainWindow *m_clientArea;
|
||||
|
@@ -190,6 +190,9 @@ protected:
|
||||
private:
|
||||
void Init();
|
||||
|
||||
virtual wxDataViewItem DoGetCurrentItem() const;
|
||||
virtual void DoSetCurrentItem(const wxDataViewItem& item);
|
||||
|
||||
friend class wxDataViewCtrlDCImpl;
|
||||
friend class wxDataViewColumn;
|
||||
friend class wxGtkDataViewModelNotifier;
|
||||
|
@@ -403,6 +403,8 @@ public:
|
||||
//
|
||||
// selection related methods (inherited from wxDataViewWidgetImpl)
|
||||
//
|
||||
virtual wxDataViewItem GetCurrentItem() const;
|
||||
virtual void SetCurrentItem(const wxDataViewItem& item);
|
||||
virtual int GetSelections(wxDataViewItemArray& sel) const;
|
||||
virtual bool IsSelected (wxDataViewItem const& item) const;
|
||||
virtual void Select (wxDataViewItem const& item);
|
||||
|
@@ -471,6 +471,8 @@ public:
|
||||
//
|
||||
// selection related methods (inherited from wxDataViewWidgetImpl)
|
||||
//
|
||||
virtual wxDataViewItem GetCurrentItem() const;
|
||||
virtual void SetCurrentItem(const wxDataViewItem& item);
|
||||
virtual int GetSelections(wxDataViewItemArray& sel) const;
|
||||
virtual bool IsSelected(const wxDataViewItem& item) const;
|
||||
virtual void Select(const wxDataViewItem& item);
|
||||
|
@@ -85,6 +85,9 @@ public:
|
||||
//
|
||||
// selection related methods
|
||||
//
|
||||
virtual wxDataViewItem GetCurrentItem() const = 0;
|
||||
virtual void SetCurrentItem(const wxDataViewItem& item) = 0;
|
||||
|
||||
virtual int GetSelections(wxDataViewItemArray& sel) const = 0; // returns all selected items in the native control
|
||||
virtual bool IsSelected (wxDataViewItem const& item) const = 0; // checks if the passed item is selected in the native control
|
||||
virtual void Select (wxDataViewItem const& item) = 0; // selects the passed item in the native control
|
||||
|
@@ -174,7 +174,6 @@ public:
|
||||
virtual void Expand(const wxDataViewItem& item);
|
||||
virtual bool IsExpanded(const wxDataViewItem & item) const;
|
||||
|
||||
|
||||
virtual unsigned int GetCount() const;
|
||||
virtual wxRect GetItemRect(const wxDataViewItem& item, const wxDataViewColumn* columnPtr) const;
|
||||
virtual wxDataViewItem GetSelection() const;
|
||||
@@ -279,6 +278,9 @@ private:
|
||||
// initializing of local variables:
|
||||
void Init();
|
||||
|
||||
virtual wxDataViewItem DoGetCurrentItem() const;
|
||||
virtual void DoSetCurrentItem(const wxDataViewItem& item);
|
||||
|
||||
//
|
||||
// variables
|
||||
//
|
||||
|
Reference in New Issue
Block a user