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:
parent
e6c46ffefb
commit
670048b2f0
@ -184,6 +184,10 @@ public:
|
|||||||
virtual bool Enable(bool enable = true);
|
virtual bool Enable(bool enable = true);
|
||||||
virtual bool Show(bool show = true);
|
virtual bool Show(bool show = true);
|
||||||
virtual bool SetFont(const wxFont& font);
|
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
|
// wxTextCtrl methods - for readonly combo they should return
|
||||||
// without errors.
|
// without errors.
|
||||||
|
@ -1149,6 +1149,26 @@ void wxComboCtrlBase::DoSetToolTip(wxToolTip *tooltip)
|
|||||||
}
|
}
|
||||||
#endif // wxUSE_TOOLTIPS
|
#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
|
// painting
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user