X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c085e333984dc079a001cd3f581aeb1f51a1f227..16e93305f2bae16652b6750dffe3bcf05c20d839:/src/msw/listbox.cpp diff --git a/src/msw/listbox.cpp b/src/msw/listbox.cpp index 2dd43b3b64..c3a7f12755 100644 --- a/src/msw/listbox.cpp +++ b/src/msw/listbox.cpp @@ -149,7 +149,7 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id, const wxValidator& validator, const wxString& name) { - m_noItems = n; + m_noItems = 0; m_hWnd = 0; m_selected = 0; @@ -227,6 +227,7 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id, Append(choices[ui]); } + /* Not needed -- done in Append #if wxUSE_OWNER_DRAWN if ( m_windowStyle & wxLB_OWNERDRAW ) { for (ui = 0; ui < (size_t)n; ui++) { @@ -238,6 +239,7 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id, } } #endif +*/ if ( (m_windowStyle & wxLB_MULTIPLE) == 0 ) SendMessage(hwnd, LB_SETCURSEL, 0, 0); @@ -294,7 +296,7 @@ void wxListBox::Append(const wxString& item) #if wxUSE_OWNER_DRAWN if ( m_windowStyle & wxLB_OWNERDRAW ) { - wxOwnerDrawn *pNewItem = CreateItem(-1); // dummy argument + wxOwnerDrawn *pNewItem = CreateItem(index); // dummy argument pNewItem->SetName(item); m_aItems.Add(pNewItem); ListBox_SetItemData(hwnd, index, pNewItem);