set/get validator for wxTextCtrl part of wxComboCtrl and not the combo itself (patch 1599214, closes bug 1598600)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43521 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2006-11-19 14:44:30 +00:00
parent e6c46ffefb
commit 670048b2f0
2 changed files with 24 additions and 0 deletions

View File

@ -184,6 +184,10 @@ public:
virtual bool Enable(bool enable = true);
virtual bool Show(bool show = true);
virtual bool SetFont(const wxFont& font);
#if wxUSE_VALIDATORS
virtual void SetValidator(const wxValidator &validator);
virtual wxValidator *GetValidator();
#endif // wxUSE_VALIDATORS
// wxTextCtrl methods - for readonly combo they should return
// without errors.

View File

@ -1149,6 +1149,26 @@ void wxComboCtrlBase::DoSetToolTip(wxToolTip *tooltip)
}
#endif // wxUSE_TOOLTIPS
#if wxUSE_VALIDATORS
void wxComboCtrlBase::SetValidator(const wxValidator& validator)
{
wxTextCtrl* textCtrl = GetTextCtrl();
if ( textCtrl )
textCtrl->SetValidator( validator );
}
wxValidator* wxComboCtrlBase::GetValidator()
{
wxTextCtrl* textCtrl = GetTextCtrl();
if ( textCtrl )
return textCtrl->GetValidator();
return wxControl::GetValidator();
}
#endif // wxUSE_VALIDATORS
// ----------------------------------------------------------------------------
// painting
// ----------------------------------------------------------------------------