Fix bugs where values didn't get commited to param grid.

This would happen if you click on another grid cell after changing
a value, or clicking OK in the dialog.  The old value would get
saved and the new value lost.
This commit is contained in:
Jeff Young 2022-10-31 10:39:03 +00:00
parent 6390c28737
commit 1737a3b94e
1 changed files with 4 additions and 10 deletions

View File

@ -239,6 +239,8 @@ bool DIALOG_SIM_MODEL<T>::TransferDataFromWindow()
{
m_pinAssignmentsGrid->CommitPendingChanges();
m_paramGrid->GetGrid()->CommitChangesFromEditor();
if( !DIALOG_SIM_MODEL_BASE::TransferDataFromWindow() )
return false;
@ -1258,11 +1260,7 @@ void DIALOG_SIM_MODEL<T>::onParamGridSetFocus( wxFocusEvent& aEvent )
wxPropertyGrid* grid = m_paramGrid->GetGrid();
if( !grid )
{
wxFAIL;
return;
}
grid->CommitChangesFromEditor();
wxPGProperty* selected = grid->GetSelection();
@ -1281,11 +1279,7 @@ void DIALOG_SIM_MODEL<T>::onParamGridSelectionChange( wxPropertyGridEvent& aEven
{
wxPropertyGrid* grid = m_paramGrid->GetGrid();
if( !grid )
{
wxFAIL;
return;
}
grid->CommitChangesFromEditor();
// Jump over categories.
if( grid->GetSelection() && grid->GetSelection()->IsCategory() )