From: Włodzimierz Skiba Date: Sun, 6 Nov 2005 18:47:25 +0000 (+0000) Subject: Speedup for adding array of items. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/792f83f038067323c1c28900dcb1a03557295dff Speedup for adding array of items. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36096 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/wince/checklst.cpp b/src/msw/wince/checklst.cpp index 8cfaca6972..5f5bf98304 100644 --- a/src/msw/wince/checklst.cpp +++ b/src/msw/wince/checklst.cpp @@ -107,6 +107,8 @@ bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id, wxZeroMemory(col); ListView_InsertColumn(GetHwnd(), 0, &col ); + ListView_SetItemCount( GetHwnd(), n ); + // initialize the contents for ( int i = 0; i < n; i++ ) { @@ -303,6 +305,8 @@ void wxCheckListBox::DoSetItemClientObject(int n, wxClientData* clientData) void wxCheckListBox::DoSetItems(const wxArrayString& items, void **clientData) { + ListView_SetItemCount( GetHwnd(), GetCount() + items.GetCount() ); + for( size_t i = 0; i < items.GetCount(); i++ ) { int pos = Append(items[i]);