From 84c5c49bca1bbabce3e26f43e8a6db23c419c531 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Fri, 23 May 2008 11:02:32 +0000 Subject: [PATCH] Move event generation in multiple selectino mode to common code git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53717 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/listbox.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/msw/listbox.cpp b/src/msw/listbox.cpp index 5a93bc577c..aa082d4cdf 100644 --- a/src/msw/listbox.cpp +++ b/src/msw/listbox.cpp @@ -266,6 +266,8 @@ void wxListBox::DoDeleteOneItem(unsigned int n) m_noItems--; SetHorizontalExtent(wxEmptyString); + + UpdateOldSelections(); } int wxListBox::FindString(const wxString& s, bool bCase) const @@ -289,6 +291,8 @@ void wxListBox::DoClear() m_noItems = 0; SetHorizontalExtent(); + + UpdateOldSelections(); } void wxListBox::Free() @@ -314,6 +318,8 @@ void wxListBox::DoSetSelection(int N, bool select) { SendMessage(GetHwnd(), LB_SETCURSEL, select ? N : -1, 0); } + + UpdateOldSelections(); } bool wxListBox::IsSelected(int N) const @@ -464,6 +470,8 @@ int wxListBox::DoInsertItems(const wxArrayStringsAdapter & items, SetHorizontalExtent(); + UpdateOldSelections(); + return n; } @@ -626,6 +634,12 @@ wxSize wxListBox::DoGetBestSize() const bool wxListBox::MSWCommand(WXUINT param, WXWORD WXUNUSED(id)) { + if ((param == LBN_SELCHANGE) && HasMultipleSelection()) + { + CalcAndSendEvent(); + return true; + } + wxEventType evtType; if ( param == LBN_SELCHANGE ) { @@ -654,7 +668,10 @@ bool wxListBox::MSWCommand(WXUINT param, WXWORD WXUNUSED(id)) event.SetClientData( GetClientData(n) ); event.SetString(GetString(n)); - event.SetExtraLong( HasMultipleSelection() ? IsSelected(n) : true ); + } + else + { + return false; } event.SetInt(n); -- 2.45.2