]> git.saurik.com Git - wxWidgets.git/commitdiff
Ensire that m_value is updated when SetSelection is called
authorRobin Dunn <robin@alldunn.com>
Wed, 27 Oct 2004 00:56:50 +0000 (00:56 +0000)
committerRobin Dunn <robin@alldunn.com>
Wed, 27 Oct 2004 00:56:50 +0000 (00:56 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30104 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/combobox.cpp

index 5cd1e71bed94facc7bc128298967beb30d321eb8..49344341f1f34d46388c273097e4c83c4aa54686 100644 (file)
@@ -254,6 +254,15 @@ WXLRESULT wxComboBox::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lPara
             UnpackCtlColor(wParam, lParam, &nCtlColor, &hdc, &hwnd);
 
             return (WXLRESULT)OnCtlColor(hdc, hwnd, nCtlColor, nMsg, wParam, lParam);
+            
+        case CB_SETCURSEL:
+            // Selection was set with SetSelection.  Update the value too.
+            if (wParam < 0 || wParam > GetCount())
+                m_value = wxEmptyString;
+            else
+                m_value = GetString(wParam);
+            break;
+            
     }
 
     return wxChoice::MSWWindowProc(nMsg, wParam, lParam);