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:
@@ -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 )
|
||||
|
Reference in New Issue
Block a user