]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/combobox.cpp
Added initial support for GNOME printing.
[wxWidgets.git] / src / msw / combobox.cpp
index 0967e6e57442e254735f2e320b5c0ca9d03af605..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);
@@ -341,7 +350,7 @@ bool wxComboBox::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
                 // want the new one)
                 if ( sel == -1 )
                 {
-                    m_value = GetValue();
+                    m_value = wxGetWindowText(GetHwnd());
                 }
                 else // we're synthesizing text updated event from sel change
                 {
@@ -481,6 +490,7 @@ void wxComboBox::SetValue(const wxString& value)
     else
         SetWindowText(GetHwnd(), value.c_str());
 
+    m_value = value;
     m_selectionOld = GetSelection();
 }