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
This commit is contained in:
Seth Hillbrand 2022-02-04 09:37:30 -08:00
parent 57cbe261f2
commit 4c81307391
2 changed files with 13 additions and 0 deletions

View File

@ -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 );

View File

@ -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() ) );