Make SME prop-grid hack Mac-only.

Fixes https://gitlab.com/kicad/code/kicad/issues/13852

(cherry picked from commit dcba555d44)
This commit is contained in:
Jeff Young 2023-03-02 10:41:48 +00:00
parent e17dc25bba
commit c216ed2d1f
1 changed files with 5 additions and 3 deletions

View File

@ -145,11 +145,12 @@ bool SIM_STRING_PROPERTY::OnEvent( wxPropertyGrid* propgrid, wxWindow* wnd_prima
}
}
#ifdef __WXMAC__
if( wxPropertyGrid* propGrid = dynamic_cast<wxPropertyGrid*>( wnd_primary->GetParent() ) )
{
// This doesn't seem like it should be required, as wxPGTextCtrlEditor::OnTextCtrlEvent()
// should be setting the value to modified. But it doesn't (or the modified flag is
// cleared at some point later), and even if it is set, the changes don't get committed.
// This shouldn't be required, as wxPGTextCtrlEditor::OnTextCtrlEvent() should be setting
// the value to modified. But it doesn't on Mac (or the modified flag is cleared at some
// point later), and even if it is set, the changes don't get committed.
// (We used to have code in DIALOG_SIM_MODEL to commit things on *some* actions, but it
// wasn't complete and this appears to have at least a better hit rate.)
propGrid->CallAfter(
@ -159,6 +160,7 @@ bool SIM_STRING_PROPERTY::OnEvent( wxPropertyGrid* propgrid, wxWindow* wnd_prima
propGrid->CommitChangesFromEditor();
} );
}
#endif
return false;
}