Set format on all matching signals.

This commit is contained in:
Jeff Young 2023-07-20 20:49:43 +01:00
parent 74695b0995
commit e8ae3533d1
1 changed files with 20 additions and 4 deletions

View File

@ -302,15 +302,31 @@ void CURSORS_GRID_TRICKS::showPopupMenu( wxMenu& menu, wxGridEvent& aEvent )
void CURSORS_GRID_TRICKS::doPopupSelection( wxCommandEvent& event ) void CURSORS_GRID_TRICKS::doPopupSelection( wxCommandEvent& event )
{ {
auto getSignalName =
[this]( int row ) -> wxString
{
wxString signal = m_grid->GetCellValue( row, COL_CURSOR_SIGNAL );
if( signal.EndsWith( "[2 - 1]" ) )
signal = signal.Left( signal.size() - 7 );
return signal;
};
if( event.GetId() == MYID_FORMAT_VALUE ) if( event.GetId() == MYID_FORMAT_VALUE )
{ {
int cursorId = m_menuRow; int axis = m_menuCol - COL_CURSOR_X;
int cursorAxis = m_menuCol - COL_CURSOR_X; SPICE_VALUE_FORMAT format = m_parent->GetCursorFormat( m_menuRow, axis );
SPICE_VALUE_FORMAT format = m_parent->GetCursorFormat( cursorId, cursorAxis );
DIALOG_SIM_FORMAT_VALUE formatDialog( m_parent, &format ); DIALOG_SIM_FORMAT_VALUE formatDialog( m_parent, &format );
if( formatDialog.ShowModal() == wxID_OK ) if( formatDialog.ShowModal() == wxID_OK )
m_parent->SetCursorFormat( cursorId, cursorAxis, format ); {
for( int row = 0; row < m_grid->GetNumberRows(); ++row )
{
if( getSignalName( row ) == getSignalName( m_menuRow ) )
m_parent->SetCursorFormat( row, axis, format );
}
}
} }
else else
{ {