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

(cherry picked from commit 4c81307391)
This commit is contained in:
Seth Hillbrand 2022-02-04 09:37:30 -08:00
parent 42917874dd
commit 57df1b469a
2 changed files with 13 additions and 0 deletions

View File

@ -186,6 +186,14 @@ public:
m_coordType = aCoordType;
}
/**
* Force the binder to evaluate the text
*/
void RequireEval()
{
m_needsEval = true;
}
protected:
void onSetFocus( wxFocusEvent& aEvent );

View File

@ -77,6 +77,11 @@ DIALOG_MOVE_EXACT::DIALOG_MOVE_EXACT( PCB_BASE_FRAME *aParent, VECTOR2I& aTransl
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() ) );