X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/90497db95b7e8ddbc6e0d1b66ce9d76283bd5ebf..0d60cffa2e8a2b769ae1ea6099de53afde156086:/src/common/valtext.cpp diff --git a/src/common/valtext.cpp b/src/common/valtext.cpp index 795df492d6..e0621d050a 100644 --- a/src/common/valtext.cpp +++ b/src/common/valtext.cpp @@ -4,7 +4,6 @@ // Author: Julian Smart // Modified by: Francesco Montorsi // Created: 04/01/98 -// RCS-ID: $Id$ // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -33,6 +32,8 @@ #include #include +#include "wx/combo.h" + // ---------------------------------------------------------------------------- // global helpers // ---------------------------------------------------------------------------- @@ -112,21 +113,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;