Instead of having wxComboCtrl mimic wxTextEntry interface, make it actually inherit from the class and implement functions to redirect to the embedded wxTextCtrl. This allows us to simplify the code and get rid of the dirty trick of directing wxComboCtrl's validator to the embedded wxTextCtrl. Also see #12779, which issue 1 is fixed by this change.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66385 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -191,12 +191,12 @@ bool wxGenericComboCtrl::Create(wxWindow *parent,
|
||||
pos,
|
||||
size,
|
||||
style | wxFULL_REPAINT_ON_RESIZE,
|
||||
wxDefaultValidator,
|
||||
validator,
|
||||
name) )
|
||||
return false;
|
||||
|
||||
// Create textctrl, if necessary
|
||||
CreateTextCtrl( tcBorder, validator );
|
||||
CreateTextCtrl( tcBorder );
|
||||
|
||||
// Add keyboard input handlers for main control and textctrl
|
||||
InstallInputHandlers();
|
||||
@@ -408,19 +408,7 @@ void wxGenericComboCtrl::SetCustomPaintWidth( int width )
|
||||
tc->RemoveEventHandler(m_textEvtHandler);
|
||||
delete m_textEvtHandler;
|
||||
|
||||
#if wxUSE_VALIDATORS
|
||||
wxValidator* pValidator = tc->GetValidator();
|
||||
if ( pValidator )
|
||||
{
|
||||
pValidator = (wxValidator*) pValidator->Clone();
|
||||
CreateTextCtrl( tcCreateStyle, *pValidator );
|
||||
delete pValidator;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
CreateTextCtrl( tcCreateStyle, wxDefaultValidator );
|
||||
}
|
||||
CreateTextCtrl( tcCreateStyle );
|
||||
|
||||
InstallInputHandlers();
|
||||
}
|
||||
|
Reference in New Issue
Block a user