From 96a177da3d860d587b5910e78f560b0a0659ea1c Mon Sep 17 00:00:00 2001 From: Marek Roszko Date: Mon, 5 Jul 2021 23:47:16 -0400 Subject: [PATCH] Add more input controls to IsInputControlEditable O god this is going to eventual cause performance issues....but this fixes keyboard based form input in some places like pl_editor with its dropdowns --- common/widgets/ui_common.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/common/widgets/ui_common.cpp b/common/widgets/ui_common.cpp index ca4f38c693..305ec4d8e5 100644 --- a/common/widgets/ui_common.cpp +++ b/common/widgets/ui_common.cpp @@ -18,8 +18,13 @@ */ #include +#include +#include #include #include +#include +#include +#include #include #include #include @@ -184,6 +189,12 @@ bool KIUI::IsInputControlFocused( wxWindow* aFocus ) wxStyledTextCtrl* styledText = dynamic_cast( aFocus ); wxListBox* listBox = dynamic_cast( aFocus ); wxSearchCtrl* searchCtrl = dynamic_cast( aFocus ); + wxCheckBox* checkboxCtrl = dynamic_cast( aFocus ); + wxChoice* choiceCtrl = dynamic_cast( aFocus ); + wxRadioButton* radioBtn = dynamic_cast( aFocus ); + wxSpinCtrl* spinCtrl = dynamic_cast( aFocus ); + wxSpinCtrlDouble* spinDblCtrl = dynamic_cast( aFocus ); + wxSlider* sliderCtl = dynamic_cast( aFocus ); // Data view control is annoying, the focus is on a "wxDataViewCtrlMainWindow" // class that is not formerly exported via the header. @@ -197,7 +208,8 @@ bool KIUI::IsInputControlFocused( wxWindow* aFocus ) dataViewCtrl = dynamic_cast( parent ); } - return ( textEntry || styledText || listBox || dataViewCtrl || searchCtrl || dataViewCtrl ); + return ( textEntry || styledText || listBox || dataViewCtrl || searchCtrl || dataViewCtrl + || checkboxCtrl || choiceCtrl || radioBtn || spinCtrl || spinDblCtrl || sliderCtl ); } @@ -207,6 +219,7 @@ bool KIUI::IsInputControlEditable( wxWindow* aFocus ) wxStyledTextCtrl* styledText = dynamic_cast( aFocus ); wxSearchCtrl* searchCtrl = dynamic_cast( aFocus ); wxListBox* listBox = dynamic_cast( aFocus ); + wxCheckBox* checkboxCtrl = dynamic_cast( aFocus ); if( textEntry ) return textEntry->IsEditable();