Fix TAB navigation with wxComboCtrl in non-MSW ports

Derive wxGenericComboCtrl from wxNavigationEnabled<> to make TAB work
correctly when the focus was on it, otherwise it didn't move it
correctly to the next control.

This notably allows TAB to cycle through all the controls in the "combo"
sample whereas previously it stopped on reaching the combo control with
the list popup with wxGTK.
This commit is contained in:
Vadim Zeitlin
2018-01-30 19:50:09 +01:00
parent 3825baf708
commit 27cad5e04d

View File

@@ -16,6 +16,8 @@
// Only define generic if native doesn't have all the features // Only define generic if native doesn't have all the features
#if !defined(wxCOMBOCONTROL_FULLY_FEATURED) #if !defined(wxCOMBOCONTROL_FULLY_FEATURED)
#include "wx/containr.h"
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Generic wxComboCtrl // Generic wxComboCtrl
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -32,11 +34,12 @@
extern WXDLLIMPEXP_DATA_CORE(const char) wxComboBoxNameStr[]; extern WXDLLIMPEXP_DATA_CORE(const char) wxComboBoxNameStr[];
class WXDLLIMPEXP_CORE wxGenericComboCtrl : public wxComboCtrlBase class WXDLLIMPEXP_CORE wxGenericComboCtrl
: public wxNavigationEnabled<wxComboCtrlBase>
{ {
public: public:
// ctors and such // ctors and such
wxGenericComboCtrl() : wxComboCtrlBase() { Init(); } wxGenericComboCtrl() { Init(); }
wxGenericComboCtrl(wxWindow *parent, wxGenericComboCtrl(wxWindow *parent,
wxWindowID id = wxID_ANY, wxWindowID id = wxID_ANY,
@@ -46,7 +49,6 @@ public:
long style = 0, long style = 0,
const wxValidator& validator = wxDefaultValidator, const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr) const wxString& name = wxComboBoxNameStr)
: wxComboCtrlBase()
{ {
Init(); Init();