]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/combobox.cpp
trying to speed up wxExecute(SYNC) -- by adding sleep to it (!) (patch 814478)
[wxWidgets.git] / src / msw / combobox.cpp
index a01a5d9d2496df15fbeecb325fcc4e49271d5a7f..e23e1fa66ee726f79da4f52a0764723c36b7bf3e 100644 (file)
@@ -311,6 +311,14 @@ bool wxComboBox::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
                 }
                 else // we're synthesizing text updated event from sel change
                 {
+                    // We need to retrieve the current selection because the user
+                    // may have changed it in the previous handler (for CBN_SELCHANGE
+                    // above).
+                    sel = GetSelection();
+                    if ( sel > -1 )
+                    {
+                        value = GetString(sel);
+                    }
                     // we need to do this because the user code expects
                     // wxComboBox::GetValue() to return the new value from
                     // "text updated" handler but it hadn't been updated yet
@@ -425,6 +433,20 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
     return TRUE;
 }
 
+bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
+                        const wxString& value,
+                        const wxPoint& pos,
+                        const wxSize& size,
+                        const wxArrayString& choices,
+                        long style,
+                        const wxValidator& validator,
+                        const wxString& name)
+{
+    wxCArrayString chs(choices);
+    return Create(parent, id, value, pos, size, chs.GetCount(),
+                  chs.GetStrings(), style, validator, name);
+}
+
 void wxComboBox::SetValue(const wxString& value)
 {
     if ( HasFlag(wxCB_READONLY) )