]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/valtext.cpp
Generate text events in generic wxSpinCtrl itself.
[wxWidgets.git] / src / common / valtext.cpp
index 795df492d61539104a94a4daa09b7d7821140e0d..dced8ecb83ce609a426792a873548cb2b9118b0a 100644 (file)
@@ -33,6 +33,8 @@
 #include <string.h>
 #include <stdlib.h>
 
+#include "wx/combo.h"
+
 // ----------------------------------------------------------------------------
 // global helpers
 // ----------------------------------------------------------------------------
@@ -112,21 +114,29 @@ bool wxTextValidator::Copy(const wxTextValidator& val)
 wxTextEntry *wxTextValidator::GetTextEntry()
 {
 #if wxUSE_TEXTCTRL
-    if (m_validatorWindow->IsKindOf(CLASSINFO(wxTextCtrl)))
+    if (wxDynamicCast(m_validatorWindow, wxTextCtrl))
     {
         return (wxTextCtrl*)m_validatorWindow;
     }
 #endif
 
 #if wxUSE_COMBOBOX
-    if (m_validatorWindow->IsKindOf(CLASSINFO(wxComboBox)))
+    if (wxDynamicCast(m_validatorWindow, wxComboBox))
     {
         return (wxComboBox*)m_validatorWindow;
     }
 #endif
 
+#if wxUSE_COMBOCTRL
+    if (wxDynamicCast(m_validatorWindow, wxComboCtrl))
+    {
+        return (wxComboCtrl*)m_validatorWindow;
+    }
+#endif
+
     wxFAIL_MSG(
-        wxT("wxTextValidator can only be used with wxTextCtrl or wxComboBox")
+        "wxTextValidator can only be used with wxTextCtrl, wxComboBox, "
+        "or wxComboCtrl"
     );
 
     return NULL;