Use wxSelectionStore in wxDataViewCtrl generic implementation.

This makes the code (slightly) shorter and more clear and is more efficient as
selecting all items in wxDataViewCtrl is now a O(1) operation instead of being
O(N), where N is the number of items -- and the latter could take quite a long
time (and consume non-negligible amount of memory) for large N.

Increase the size of the virtual list control from 1000 to 10000000 in the
sample to show this.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77905 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-09-27 20:46:25 +00:00
parent adf8f9d0cd
commit 36a5983f64
3 changed files with 99 additions and 173 deletions

View File

@@ -327,7 +327,7 @@ static int my_sort( int *v1, int *v2 )
return *v1-*v2;
}
#define INITIAL_NUMBER_OF_ITEMS 10000
#define INITIAL_NUMBER_OF_ITEMS 10000000
MyListModel::MyListModel() :
wxDataViewVirtualListModel( INITIAL_NUMBER_OF_ITEMS )