]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/choice.cpp
make sure all wxDefault* and all wxNull* global instances are documented
[wxWidgets.git] / src / msw / choice.cpp
index 9eec9c2332422433a5166bbbd315c221a5af77cb..7b73e6f6f1d0106c0ce347d08d08db42fcba6c0e 100644 (file)
@@ -158,6 +158,21 @@ bool wxChoice::CreateAndInit(wxWindow *parent,
     return true;
 }
 
+void wxChoice::SetLabel(const wxString& label)
+{
+    if ( FindString(label) == wxNOT_FOUND )
+    {
+        // unless we explicitly do this here, CB_GETCURSEL will continue to
+        // return the index of the previously selected item which will result
+        // in wrongly replacing the value being set now with the previously
+        // value if the user simply opens and closes (without selecting
+        // anything) the combobox popup
+        SetSelection(-1);
+    }
+
+    wxChoiceBase::SetLabel(label);
+}
+
 bool wxChoice::Create(wxWindow *parent,
                       wxWindowID id,
                       const wxPoint& pos,