Use wxVector for storing wxDataViewTreeStoreNodes

Replace the use of wxList macros with wxVector.

Also make wxDataViewTreeStore::Compare() slightly more efficient by
iterating over the children list only once instead of doing it twice.
This commit is contained in:
Vadim Zeitlin
2018-02-03 20:35:38 +01:00
parent 342388a456
commit f7e592b335
2 changed files with 74 additions and 29 deletions

View File

@@ -1212,8 +1212,7 @@ private:
wxClientData *m_data;
};
WX_DECLARE_LIST_WITH_DECL(wxDataViewTreeStoreNode, wxDataViewTreeStoreNodeList,
class WXDLLIMPEXP_ADV);
typedef wxVector<wxDataViewTreeStoreNode*> wxDataViewTreeStoreNodes;
class WXDLLIMPEXP_ADV wxDataViewTreeStoreContainerNode: public wxDataViewTreeStoreNode
{
@@ -1223,11 +1222,13 @@ public:
wxClientData *data = NULL );
virtual ~wxDataViewTreeStoreContainerNode();
const wxDataViewTreeStoreNodeList &GetChildren() const
const wxDataViewTreeStoreNodes &GetChildren() const
{ return m_children; }
wxDataViewTreeStoreNodeList &GetChildren()
wxDataViewTreeStoreNodes &GetChildren()
{ return m_children; }
wxDataViewTreeStoreNodes::iterator FindChild(wxDataViewTreeStoreNode* node);
void SetExpandedIcon( const wxIcon &icon )
{ m_iconExpanded = icon; }
const wxIcon &GetExpandedIcon() const
@@ -1241,8 +1242,10 @@ public:
virtual bool IsContainer() wxOVERRIDE
{ return true; }
void DestroyChildren();
private:
wxDataViewTreeStoreNodeList m_children;
wxDataViewTreeStoreNodes m_children;
wxIcon m_iconExpanded;
bool m_isExpanded;
};