]> git.saurik.com Git - wxWidgets.git/commitdiff
Move event generation in multiple selectino mode to common code
authorRobert Roebling <robert@roebling.de>
Fri, 23 May 2008 11:02:32 +0000 (11:02 +0000)
committerRobert Roebling <robert@roebling.de>
Fri, 23 May 2008 11:02:32 +0000 (11:02 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53717 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/listbox.cpp

index 5a93bc577c3e8e022510a5acafd1469151cec212..aa082d4cdfbe799c638f43dad5d897b45c3580cd 100644 (file)
@@ -266,6 +266,8 @@ void wxListBox::DoDeleteOneItem(unsigned int n)
     m_noItems--;
 
     SetHorizontalExtent(wxEmptyString);
     m_noItems--;
 
     SetHorizontalExtent(wxEmptyString);
+
+    UpdateOldSelections();
 }
 
 int wxListBox::FindString(const wxString& s, bool bCase) const
 }
 
 int wxListBox::FindString(const wxString& s, bool bCase) const
@@ -289,6 +291,8 @@ void wxListBox::DoClear()
 
     m_noItems = 0;
     SetHorizontalExtent();
 
     m_noItems = 0;
     SetHorizontalExtent();
+
+    UpdateOldSelections();
 }
 
 void wxListBox::Free()
 }
 
 void wxListBox::Free()
@@ -314,6 +318,8 @@ void wxListBox::DoSetSelection(int N, bool select)
     {
         SendMessage(GetHwnd(), LB_SETCURSEL, select ? N : -1, 0);
     }
     {
         SendMessage(GetHwnd(), LB_SETCURSEL, select ? N : -1, 0);
     }
+
+    UpdateOldSelections();
 }
 
 bool wxListBox::IsSelected(int N) const
 }
 
 bool wxListBox::IsSelected(int N) const
@@ -464,6 +470,8 @@ int wxListBox::DoInsertItems(const wxArrayStringsAdapter & items,
 
     SetHorizontalExtent();
 
 
     SetHorizontalExtent();
 
+    UpdateOldSelections();
+
     return n;
 }
 
     return n;
 }
 
@@ -626,6 +634,12 @@ wxSize wxListBox::DoGetBestSize() const
 
 bool wxListBox::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
 {
 
 bool wxListBox::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
 {
+    if ((param == LBN_SELCHANGE) && HasMultipleSelection())
+    {
+        CalcAndSendEvent();
+        return true;
+    }
+
     wxEventType evtType;
     if ( param == LBN_SELCHANGE )
     {
     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.SetClientData( GetClientData(n) );
 
         event.SetString(GetString(n));
-        event.SetExtraLong( HasMultipleSelection() ? IsSelected(n) : true );
+    }
+    else
+    {
+        return false;
     }
 
     event.SetInt(n);
     }
 
     event.SetInt(n);