KiCad PCB EDA Suite
dialog_lib_edit_pin_table.cpp File Reference
#include "dialog_lib_edit_pin_table.h"
#include "grid_tricks.h"
#include "lib_pin.h"
#include "pin_numbers.h"
#include "pgm_base.h"
#include <bitmaps.h>
#include <confirm.h>
#include <symbol_edit_frame.h>
#include <symbol_editor_settings.h>
#include <kiplatform/ui.h>
#include <widgets/grid_icon_text_helpers.h>
#include <widgets/grid_combobox.h>
#include <widgets/wx_grid.h>
#include <widgets/bitmap_button.h>
#include <settings/settings_manager.h>
#include <wx/tokenzr.h>
#include <string_utils.h>

Go to the source code of this file.

Classes

class  PIN_TABLE_DATA_MODEL
 

Macros

#define UNITS_ALL   _( "ALL" )
 
#define DEMORGAN_ALL   _( "ALL" )
 
#define DEMORGAN_STD   _( "Standard" )
 
#define DEMORGAN_ALT   _( "Alternate" )
 

Functions

void getSelectedArea (WX_GRID *aGrid, int *aRowStart, int *aRowCount)
 

Macro Definition Documentation

◆ DEMORGAN_ALL

#define DEMORGAN_ALL   _( "ALL" )

Definition at line 43 of file dialog_lib_edit_pin_table.cpp.

◆ DEMORGAN_ALT

#define DEMORGAN_ALT   _( "Alternate" )

Definition at line 45 of file dialog_lib_edit_pin_table.cpp.

◆ DEMORGAN_STD

#define DEMORGAN_STD   _( "Standard" )

Definition at line 44 of file dialog_lib_edit_pin_table.cpp.

◆ UNITS_ALL

#define UNITS_ALL   _( "ALL" )

Definition at line 42 of file dialog_lib_edit_pin_table.cpp.

Function Documentation

◆ getSelectedArea()

void getSelectedArea ( WX_GRID aGrid,
int *  aRowStart,
int *  aRowCount 
)

Definition at line 48 of file dialog_lib_edit_pin_table.cpp.

49{
50 wxGridCellCoordsArray topLeft = aGrid->GetSelectionBlockTopLeft();
51 wxGridCellCoordsArray botRight = aGrid->GetSelectionBlockBottomRight();
52
53 wxArrayInt cols = aGrid->GetSelectedCols();
54 wxArrayInt rows = aGrid->GetSelectedRows();
55
56 if( topLeft.Count() && botRight.Count() )
57 {
58 *aRowStart = topLeft[0].GetRow();
59 *aRowCount = botRight[0].GetRow() - *aRowStart + 1;
60 }
61 else if( cols.Count() )
62 {
63 *aRowStart = 0;
64 *aRowCount = aGrid->GetNumberRows();
65 }
66 else if( rows.Count() )
67 {
68 *aRowStart = rows[0];
69 *aRowCount = rows.Count();
70 }
71 else
72 {
73 *aRowStart = aGrid->GetGridCursorRow();
74 *aRowCount = *aRowStart >= 0 ? 1 : 0;
75 }
76}

Referenced by DIALOG_LIB_EDIT_PIN_TABLE::OnUpdateUI(), and PIN_TABLE_DATA_MODEL::RebuildRows().