Add wxDataViewCtrl::ExpandChildren()

This convenient method allows to expand all children of the item
recursively.

This is directly supported by both native implementations, so it makes
sense to have this in wxDataViewCtrl itself, even if it could be also
(less efficiently) implemented in the user code.
This commit is contained in:
Vadim Zeitlin
2020-12-05 14:41:09 +01:00
parent faffc5fe0a
commit d47fa718cd
15 changed files with 87 additions and 20 deletions

View File

@@ -740,6 +740,7 @@ public:
virtual void UnselectAll() = 0;
void Expand( const wxDataViewItem & item );
void ExpandChildren( const wxDataViewItem & item );
void ExpandAncestors( const wxDataViewItem & item );
virtual void Collapse( const wxDataViewItem & item ) = 0;
virtual bool IsExpanded( const wxDataViewItem & item ) const = 0;
@@ -793,7 +794,9 @@ protected:
// 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;
//
// If expandChildren is true, also expand all its children recursively.
virtual void DoExpand(const wxDataViewItem & item, bool expandChildren) = 0;
private:
// Implementation of the public Set/GetCurrentItem() methods which are only