KiCad PCB EDA Suite
panel_setup_tracks_and_vias.cpp File Reference
#include <pcb_edit_frame.h>
#include <board_design_settings.h>
#include <bitmaps.h>
#include <widgets/wx_grid.h>
#include <widgets/std_bitmap_button.h>
#include <wx/treebook.h>
#include <grid_tricks.h>
#include <panel_setup_tracks_and_vias.h>

Go to the source code of this file.

Enumerations

enum  TRACK_VAR_GRID_COLUMNS { TR_WIDTH_COL = 0 }
 
enum  VIA_VAR_GRID_COLUMNS { VIA_SIZE_COL = 0 , VIA_DRILL_COL }
 
enum  DIFF_VAR_GRID_COLUMNS { DP_WIDTH_COL = 0 , DP_GAP_COL , DP_VIA_GAP_COL }
 

Functions

void removeSelectedRows (WX_GRID *aGrid)
 

Enumeration Type Documentation

◆ DIFF_VAR_GRID_COLUMNS

Enumerator
DP_WIDTH_COL 
DP_GAP_COL 
DP_VIA_GAP_COL 

Definition at line 47 of file panel_setup_tracks_and_vias.cpp.

◆ TRACK_VAR_GRID_COLUMNS

Enumerator
TR_WIDTH_COL 

Definition at line 36 of file panel_setup_tracks_and_vias.cpp.

37{
38 TR_WIDTH_COL = 0
39};

◆ VIA_VAR_GRID_COLUMNS

Enumerator
VIA_SIZE_COL 
VIA_DRILL_COL 

Definition at line 41 of file panel_setup_tracks_and_vias.cpp.

Function Documentation

◆ removeSelectedRows()

void removeSelectedRows ( WX_GRID aGrid)

Definition at line 434 of file panel_setup_tracks_and_vias.cpp.

435{
436 wxArrayInt selectedRows = aGrid->GetSelectedRows();
437 int curRow = aGrid->GetGridCursorRow();
438
439 if( selectedRows.empty() && curRow >= 0 && curRow < aGrid->GetNumberRows() )
440 selectedRows.Add( curRow );
441
442 for( int ii = selectedRows.Count() - 1; ii >= 0; --ii )
443 {
444 int row = selectedRows.Item( ii );
445 aGrid->DeleteRows( row, 1 );
446 curRow = std::min( curRow, row );
447 }
448
449 curRow = std::max( 0, curRow - 1 );
450 aGrid->MakeCellVisible( curRow, aGrid->GetGridCursorCol() );
451 aGrid->SetGridCursor( curRow, aGrid->GetGridCursorCol() );
452}

Referenced by PANEL_SETUP_TRACKS_AND_VIAS::OnRemoveDiffPairsClick(), PANEL_SETUP_TRACKS_AND_VIAS::OnRemoveTrackWidthsClick(), and PANEL_SETUP_TRACKS_AND_VIAS::OnRemoveViaSizesClick().