sim - Don't allow user to delete the type-in measure entry

This commit is contained in:
Fabien Corona 2023-02-22 19:03:50 +01:00
parent 1170fb2e18
commit 9006f38e70
1 changed files with 8 additions and 3 deletions

View File

@ -366,7 +366,9 @@ void MEASUREMENTS_GRID_TRICKS::showPopupMenu( wxMenu& menu, wxGridEvent& aEvent
if( m_menuCol == COL_MEASUREMENT_VALUE ) if( m_menuCol == COL_MEASUREMENT_VALUE )
menu.Append( MYID_FORMAT_VALUE, _( "Format Value..." ) ); menu.Append( MYID_FORMAT_VALUE, _( "Format Value..." ) );
if( m_menuRow < ( m_grid->GetNumberRows() - 1 ) )
menu.Append( MYID_DELETE_MEASUREMENT, _( "Delete Measurement" ) ); menu.Append( MYID_DELETE_MEASUREMENT, _( "Delete Measurement" ) );
menu.AppendSeparator(); menu.AppendSeparator();
GRID_TRICKS::showPopupMenu( menu, aEvent ); GRID_TRICKS::showPopupMenu( menu, aEvent );
@ -1211,10 +1213,13 @@ void SIM_PLOT_FRAME::SetMeasureFormat( int aRow, const SPICE_VALUE_FORMAT& aForm
void SIM_PLOT_FRAME::DeleteMeasurement( int aRow ) void SIM_PLOT_FRAME::DeleteMeasurement( int aRow )
{
if( aRow < ( m_measurementsGrid->GetNumberRows() - 1 ) )
{ {
m_measurementsGrid->DeleteRows( aRow, 1 ); m_measurementsGrid->DeleteRows( aRow, 1 );
m_workbookModified = true; m_workbookModified = true;
} }
}
void SIM_PLOT_FRAME::onMeasurementsGridCellChanged( wxGridEvent& aEvent ) void SIM_PLOT_FRAME::onMeasurementsGridCellChanged( wxGridEvent& aEvent )