21#include <wx/dataview.h>
27 if( !prevItem.IsOk() )
29 prevItem = GetModel()->GetParent( aItem );
31 else if( IsExpanded( prevItem ) )
33 wxDataViewItemArray children;
34 GetModel()->GetChildren( prevItem, children );
37 prevItem = children[children.size() - 1];
46 wxDataViewItem nextItem;
47 wxDataViewItem invalid;
52 wxDataViewItemArray children;
53 GetModel()->GetChildren( aItem, children );
61 if( IsExpanded( aItem ) )
63 wxDataViewItemArray children;
64 GetModel()->GetChildren( aItem, children );
74 for( wxDataViewItem walk = aItem; walk.IsOk(); walk = GetModel()->GetParent( walk ) )
89 wxDataViewItemArray siblings;
90 wxDataViewItem invalid;
91 wxDataViewItem parent = GetModel()->GetParent( aItem );
93 GetModel()->GetChildren( parent, siblings );
95 for(
size_t i = 0; i < siblings.size(); ++i )
97 if( siblings[i] == aItem )
102 return siblings[i - 1];
112 wxDataViewItemArray siblings;
113 wxDataViewItem invalid;
114 wxDataViewItem parent = GetModel()->GetParent( aItem );
116 GetModel()->GetChildren( parent, siblings );
118 for(
size_t i = 0; i < siblings.size(); ++i )
120 if( siblings[i] == aItem )
122 if( i == siblings.size() - 1 )
125 return siblings[i + 1];
135 wxDataViewItemArray children;
137 aCtrl->GetModel()->GetChildren( aItem, children );
139 for(
size_t i = 0; i < children.size(); ++i )
145 aCtrl->Expand( aItem );
147 aCtrl->Collapse( aItem );
Extension of the wxDataViewCtrl to include some helper functions for working with items.
wxDataViewItem GetPrevSibling(wxDataViewItem const &aItem)
Get the previous sibling of an item.
wxDataViewItem GetNextSibling(wxDataViewItem const &aItem)
Get the next sibling of an item.
wxDataViewItem GetNextItem(wxDataViewItem const &aItem)
Get the next item in list order.
wxDataViewItem GetPrevItem(wxDataViewItem const &aItem)
Get the previous item in list order.
static void recursiveDescent(wxSizer *aSizer, std::map< int, wxString > &aLabels)
void recursiveDescent(WX_DATAVIEWCTRL *aCtrl, wxDataViewItem aItem, bool aExpand)