Make wxDataViewCtrl::Expand() expand ancestors in native ports too
Expand() called ExpandAncestors() in the generic wxDataViewCtrl implementation but not in the native ones, resulting in observable difference in the behaviour: for example, the wxDataViewTreeCtrl in the dataview sample appeared initially expanded under MSW, using the generic version, but collapsed under GTK and OSX. Harmonize this among all ports. This also has a nice side effect of making Expand() less horribly inefficient as it is not recursively called by ExpandAncestors() which it itself used to call: now ExpandAncestors() only calls DoExpand() which is a simple function that only expands the item passed to it and does nothing else. Closes #14803.
This commit is contained in:
@@ -705,7 +705,7 @@ public:
|
||||
virtual void SelectAll() = 0;
|
||||
virtual void UnselectAll() = 0;
|
||||
|
||||
virtual void Expand( const wxDataViewItem & item ) = 0;
|
||||
void Expand( const wxDataViewItem & item );
|
||||
void ExpandAncestors( const wxDataViewItem & item );
|
||||
virtual void Collapse( const wxDataViewItem & item ) = 0;
|
||||
virtual bool IsExpanded( const wxDataViewItem & item ) const = 0;
|
||||
@@ -747,6 +747,10 @@ protected:
|
||||
virtual void DoSetExpanderColumn() = 0 ;
|
||||
virtual void DoSetIndent() = 0;
|
||||
|
||||
// Just expand this item assuming it is already shown, i.e. its parent has
|
||||
// been already expanded using ExpandAncestors().
|
||||
virtual void DoExpand(const wxDataViewItem & item) = 0;
|
||||
|
||||
private:
|
||||
// Implementation of the public Set/GetCurrentItem() methods which are only
|
||||
// called in multi selection case (for single selection controls their
|
||||
|
Reference in New Issue
Block a user