+wxTextEntry *wxTextValidator::GetTextEntry()
+{
+#if wxUSE_TEXTCTRL
+ if (m_validatorWindow->IsKindOf(CLASSINFO(wxTextCtrl)))
+ {
+ return (wxTextCtrl*)m_validatorWindow;
+ }
+#endif
+
+#if wxUSE_COMBOBOX
+ if (m_validatorWindow->IsKindOf(CLASSINFO(wxComboBox)))
+ {
+ return (wxComboBox*)m_validatorWindow;
+ }
+#endif
+
+ wxFAIL_MSG(
+ _T("wxTextValidator can only be used with wxTextCtrl or wxComboBox")
+ );
+
+ return NULL;
+}
+