Use enums for column ids.

(The nickname, in particular, is no longer column 1.)

Fixes https://gitlab.com/kicad/code/kicad/issues/14291
This commit is contained in:
Jeff Young 2023-04-02 15:09:29 +01:00
parent 3a8d6dffba
commit 7252c7471c
2 changed files with 6 additions and 6 deletions

View File

@ -559,8 +559,8 @@ void PANEL_SYM_LIB_TABLE::browseLibrariesHandler( wxCommandEvent& event )
if( !filePathsList.IsEmpty() ) if( !filePathsList.IsEmpty() )
{ {
m_cur_grid->MakeCellVisible( m_cur_grid->GetNumberRows() - 1, 0 ); m_cur_grid->MakeCellVisible( m_cur_grid->GetNumberRows() - 1, COL_ENABLED );
m_cur_grid->SetGridCursor( m_cur_grid->GetNumberRows() - 1, 1 ); m_cur_grid->SetGridCursor( m_cur_grid->GetNumberRows() - 1, COL_NICKNAME );
} }
} }
@ -575,8 +575,8 @@ void PANEL_SYM_LIB_TABLE::appendRowHandler( wxCommandEvent& event )
int row = m_cur_grid->GetNumberRows() - 1; int row = m_cur_grid->GetNumberRows() - 1;
// wx documentation is wrong, SetGridCursor does not make visible. // wx documentation is wrong, SetGridCursor does not make visible.
m_cur_grid->MakeCellVisible( row, 0 ); m_cur_grid->MakeCellVisible( row, COL_ENABLED );
m_cur_grid->SetGridCursor( row, 1 ); m_cur_grid->SetGridCursor( row, COL_NICKNAME );
m_cur_grid->EnableCellEditControl( true ); m_cur_grid->EnableCellEditControl( true );
m_cur_grid->ShowCellEditControl(); m_cur_grid->ShowCellEditControl();
} }

View File

@ -655,8 +655,8 @@ void PANEL_FP_LIB_TABLE::appendRowHandler( wxCommandEvent& event )
int last_row = m_cur_grid->GetNumberRows() - 1; int last_row = m_cur_grid->GetNumberRows() - 1;
// wx documentation is wrong, SetGridCursor does not make visible. // wx documentation is wrong, SetGridCursor does not make visible.
m_cur_grid->MakeCellVisible( last_row, 0 ); m_cur_grid->MakeCellVisible( last_row, COL_ENABLED );
m_cur_grid->SetGridCursor( last_row, 1 ); m_cur_grid->SetGridCursor( last_row, COL_NICKNAME );
m_cur_grid->EnableCellEditControl( true ); m_cur_grid->EnableCellEditControl( true );
m_cur_grid->ShowCellEditControl(); m_cur_grid->ShowCellEditControl();
} }