From 4c8130739151704936887dd3f7745d4cec07d950 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Fri, 4 Feb 2022 09:37:30 -0800 Subject: [PATCH] Allow dialogs to force evaluation of UNIT_BINDER When setting previous values, we don't get the "OnFocus" event, so the evaluation would not get triggered by simply repeating (using the keyboard) Fixes https://gitlab.com/kicad/code/kicad/issues/10752 --- include/widgets/unit_binder.h | 8 ++++++++ pcbnew/dialogs/dialog_move_exact.cpp | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/include/widgets/unit_binder.h b/include/widgets/unit_binder.h index 8ad84bc5b4..adac6a6a9a 100644 --- a/include/widgets/unit_binder.h +++ b/include/widgets/unit_binder.h @@ -179,6 +179,14 @@ public: m_coordType = aCoordType; } + /** + * Force the binder to evaluate the text + */ + void RequireEval() + { + m_needsEval = true; + } + protected: void onSetFocus( wxFocusEvent& aEvent ); diff --git a/pcbnew/dialogs/dialog_move_exact.cpp b/pcbnew/dialogs/dialog_move_exact.cpp index b862c56298..03ab3656c8 100644 --- a/pcbnew/dialogs/dialog_move_exact.cpp +++ b/pcbnew/dialogs/dialog_move_exact.cpp @@ -78,6 +78,11 @@ DIALOG_MOVE_EXACT::DIALOG_MOVE_EXACT( PCB_BASE_FRAME *aParent, wxPoint& aTransla m_xEntry->ChangeValue( m_options.entry1 ); m_yEntry->ChangeValue( m_options.entry2 ); + // Force the evaluation when setting previous values + m_moveX.RequireEval(); + m_moveY.RequireEval(); + m_rotate.RequireEval(); + m_rotate.SetUnits( EDA_UNITS::DEGREES ); m_rotate.SetValue( m_options.entryRotation ); m_anchorOptions->SetSelection( std::min( m_options.entryAnchorSelection, m_menuIDs.size() ) );