X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/90497db95b7e8ddbc6e0d1b66ce9d76283bd5ebf..64ea838d8f4d1853b7d850db93ee565e901d099a:/src/common/valtext.cpp diff --git a/src/common/valtext.cpp b/src/common/valtext.cpp index 795df492d6..dced8ecb83 100644 --- a/src/common/valtext.cpp +++ b/src/common/valtext.cpp @@ -33,6 +33,8 @@ #include #include +#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;