]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/choice.cpp
adapting char event handling to msw / gtk, see #13415, see #14197
[wxWidgets.git] / src / msw / choice.cpp
index 650dff48ce37d229f95351b0822be43396b8ee7d..0c0dbc10c7bb9e2423707ac252348ceff525d0c0 100644 (file)
@@ -646,6 +646,19 @@ void wxChoice::MSWDoPopupOrDismiss(bool show)
     ::SendMessage(GetHwnd(), CB_SHOWDROPDOWN, show, 0);
 }
 
+bool wxChoice::Show(bool show)
+{
+    if ( !wxChoiceBase::Show(show) )
+        return false;
+
+    // When hiding the combobox, we also need to hide its popup part as it
+    // doesn't happen automatically.
+    if ( !show && ::SendMessage(GetHwnd(), CB_GETDROPPEDSTATE, 0, 0) )
+        MSWDoPopupOrDismiss(false);
+
+    return true;
+}
+
 // ----------------------------------------------------------------------------
 // MSW message handlers
 // ----------------------------------------------------------------------------