KeyConfigPrefs: bring into line with implementation change of wxStaticBox

Commit 75e44df made controls in a wxStaticBox children rather than siblings. Three of the controls in KeyConfigPrefs are not handled by ShuttleGui, so needed manual changes of parent.

In addition, on Windows tabbing out of the text box for setting the shortcut resulted in the wrong control getting the focus. Changing to using Navigate() rather than NavigateIn() fixed this, though I don't know why. This needs testing on other platforms.
This commit is contained in:
David Bailes 2019-03-28 13:30:20 +00:00
parent cd3a0326ae
commit f7644c74f4
1 changed files with 6 additions and 5 deletions

View File

@ -31,6 +31,7 @@ KeyConfigPrefs and MousePrefs use.
#include <wx/menu.h>
#include <wx/button.h>
#include <wx/stattext.h>
#include <wx/statbox.h>
#include "../Prefs.h"
#include "../Project.h"
@ -149,7 +150,7 @@ void KeyConfigPrefs::PopulateOrExchange(ShuttleGui & S)
{
S.SetBorder(2);
S.StartStatic(_("Key Bindings"), 1);
wxStaticBox* staticBox = S.StartStatic(_("Key Bindings"), 1);
{
S.StartMultiColumn(3, wxEXPAND);
{
@ -188,7 +189,7 @@ void KeyConfigPrefs::PopulateOrExchange(ShuttleGui & S)
mFilterLabel = S.AddVariableText(_("Searc&h:"));
if (!mFilter) {
mFilter = safenew wxTextCtrl(this,
mFilter = safenew wxTextCtrl(staticBox,
FilterID,
wxT(""),
wxDefaultPosition,
@ -216,7 +217,7 @@ void KeyConfigPrefs::PopulateOrExchange(ShuttleGui & S)
S.StartHorizontalLay(wxEXPAND, 1);
{
if (!mView) {
mView = safenew KeyView(this, CommandsListID);
mView = safenew KeyView(staticBox, CommandsListID);
mView->SetName(_("Bindings"));
}
S.Prop(true);
@ -227,7 +228,7 @@ void KeyConfigPrefs::PopulateOrExchange(ShuttleGui & S)
S.StartThreeColumn();
{
if (!mKey) {
mKey = safenew wxTextCtrl(this,
mKey = safenew wxTextCtrl(staticBox,
CurrentComboID,
wxT(""),
wxDefaultPosition,
@ -419,7 +420,7 @@ void KeyConfigPrefs::OnHotkeyKeyDown(wxKeyEvent & e)
// active, buttons on the Mac do not accept focus and all the
// controls between this one and the tree control are buttons.
if (e.GetKeyCode() == WXK_TAB) {
NavigateIn(e.ShiftDown()
t->Navigate(e.ShiftDown()
? wxNavigationKeyEvent::IsBackward
: wxNavigationKeyEvent::IsForward);
return;