]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/combobox.cpp
invalidate best window size when its label changes
[wxWidgets.git] / src / msw / combobox.cpp
index ca40d744fc56cea493733b7e4658ce687a1ae27c..bc36474d1a465a594df5e43df7e4370c8e74ed15 100644 (file)
 #include "wx/wupdlock.h"
 #include "wx/msw/private.h"
 
+#if wxUSE_UXTHEME
+    #include "wx/msw/uxtheme.h"
+#endif
+
 #if wxUSE_TOOLTIPS
     #include "wx/tooltip.h"
 #endif // wxUSE_TOOLTIPS
@@ -338,8 +342,19 @@ bool wxComboBox::MSWCommand(WXUINT param, WXWORD id)
                 // down is cancelled (see #8474)
                 m_lastAcceptedSelection = wxID_NONE;
             }
+            {
+                wxCommandEvent event(wxEVT_COMMAND_COMBOBOX_DROPDOWN, GetId());
+                event.SetEventObject(this);
+                ProcessCommand(event);
+            }
+            break;
+        case CBN_CLOSEUP:
+            {
+                wxCommandEvent event(wxEVT_COMMAND_COMBOBOX_CLOSEUP, GetId());
+                event.SetEventObject(this);
+                ProcessCommand(event);
+            }
             break;
-
         case CBN_SELENDOK:
 #ifndef __SMARTPHONE__
             // we need to reset this to prevent the selection from being undone
@@ -445,6 +460,14 @@ WXHWND wxComboBox::GetEditHWND() const
     return hWndEdit;
 }
 
+wxWindow *wxComboBox::GetEditableWindow()
+{
+    wxASSERT_MSG( !HasFlag(wxCB_READONLY),
+                  _T("read-only combobox doesn't have any edit control") );
+
+    return this;
+}
+
 // ----------------------------------------------------------------------------
 // wxComboBox creation
 // ----------------------------------------------------------------------------
@@ -665,4 +688,22 @@ void wxComboBox::DoSetToolTip(wxToolTip *tip)
 
 #endif // wxUSE_TOOLTIPS
 
+#if wxUSE_UXTHEME
+
+bool wxComboBox::SetHint(const wxString& hintOrig)
+{
+    wxString hint(hintOrig);
+    if ( wxUxThemeEngine::GetIfActive() )
+    {
+        // under XP (but not Vista) there is a bug in cue banners
+        // implementation for combobox edit control: the first character is
+        // partially chopped off, so prepend a space to make it fully visible
+        hint.insert(0, " ");
+    }
+
+    return wxTextEntry::SetHint(hint);
+}
+
+#endif // wxUSE_UXTHEME
+
 #endif // wxUSE_COMBOBOX