From 7ab4b8c6df91d504e23c584159354e0e802b1f0d Mon Sep 17 00:00:00 2001 From: James Crook Date: Mon, 9 Apr 2018 15:51:18 +0100 Subject: [PATCH] Bug 875 - First character is highlighted when tabbing into TimeText controls, not first non-zero character. --- src/widgets/NumericTextCtrl.cpp | 3 +++ src/widgets/NumericTextCtrl.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/widgets/NumericTextCtrl.cpp b/src/widgets/NumericTextCtrl.cpp index 7608152b2..a9664b853 100644 --- a/src/widgets/NumericTextCtrl.cpp +++ b/src/widgets/NumericTextCtrl.cpp @@ -1625,9 +1625,12 @@ void NumericTextCtrl::OnFocus(wxFocusEvent &event) { if (event.GetEventType() == wxEVT_KILL_FOCUS) { AudacityProject::ReleaseKeyboard(this); + mFocusedDigit =0; } else { AudacityProject::CaptureKeyboard(this); + if( mFocusedDigit <=0 ) + UpdateAutoFocus(); } Refresh(false); diff --git a/src/widgets/NumericTextCtrl.h b/src/widgets/NumericTextCtrl.h index 9c2418fb2..3fe58daf9 100644 --- a/src/widgets/NumericTextCtrl.h +++ b/src/widgets/NumericTextCtrl.h @@ -157,7 +157,7 @@ class NumericTextCtrl final : public wxControl, public NumericConverter DECLARE_DYNAMIC_CLASS(NumericTextCtrl) struct Options { - bool autoPos { false }; + bool autoPos { true }; bool readOnly { false }; bool menuEnabled { true }; bool hasInvalidValue { false };