KiCad PCB EDA Suite
Loading...
Searching...
No Matches
panel_fp_editor_field_defaults.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
25
26#include <pgm_base.h>
30#include <template_fieldnames.h>
32#include <grid_tricks.h>
33#include <eda_text.h>
35#include <bitmaps.h>
36#include <confirm.h>
37
38
39class LAYER_NAMES_GRID_TABLE : public wxGridTableBase
40{
41 std::vector<TEXT_ITEM_INFO> m_items;
42
43public:
45
46 int GetNumberRows() override { return m_items.size(); }
47 int GetNumberCols() override { return 2; }
48
49 wxString GetColLabelValue( int aCol ) override
50 {
51 switch( aCol )
52 {
53 case 0: return _( "Layer" );
54 case 1: return _( "Name" );
55 default: return wxEmptyString;
56 }
57 }
58
59 bool CanGetValueAs( int aRow, int aCol, const wxString& aTypeName ) override
60 {
61 switch( aCol )
62 {
63 case 0: return aTypeName == wxGRID_VALUE_NUMBER;
64 case 1: return aTypeName == wxGRID_VALUE_STRING;
65 default: wxFAIL; return false;
66 }
67 }
68
69 bool CanSetValueAs( int aRow, int aCol, const wxString& aTypeName ) override
70 {
71 return CanGetValueAs( aRow, aCol, aTypeName );
72 }
73
74 wxString GetValue( int row, int col ) override { return m_items[row].m_Text; }
75 void SetValue( int row, int col, const wxString& value ) override
76 {
77 if( col == 1 )
78 m_items[row].m_Text = value;
79 }
80
81 long GetValueAsLong( int row, int col ) override { return m_items[row].m_Layer; }
82 void SetValueAsLong( int row, int col, long value ) override
83 {
84 if( col == 0 )
85 m_items[row].m_Layer = static_cast<int>( value );
86 }
87
88 bool AppendRows( size_t aNumRows = 1 ) override
89 {
90 std::set<int> layers;
91 int layer = User_1;
92
93 for( const TEXT_ITEM_INFO& item : m_items )
94 layers.insert( item.m_Layer );
95
96
97 for( size_t i = 0; i < aNumRows; ++i )
98 {
99 while( layers.contains( layer ) )
100 layer = layer + 2;
101
102 if( IsUserLayer( static_cast<PCB_LAYER_ID>( layer ) ) )
103 {
104 layers.insert( layer );
105 m_items.emplace_back( wxT( "" ), true, layer );
106 }
107 else
108 {
109 return false;
110 }
111 }
112
113 if( GetView() )
114 {
115 wxGridTableMessage msg( this, wxGRIDTABLE_NOTIFY_ROWS_APPENDED, aNumRows );
116 GetView()->ProcessTableMessage( msg );
117 }
118
119 return true;
120 }
121
122 bool DeleteRows( size_t aPos, size_t aNumRows ) override
123 {
124 // aPos may be a large positive, e.g. size_t(-1), and the sum of
125 // aPos+aNumRows may wrap here, so both ends of the range are tested.
126 if( aPos < m_items.size() && aPos + aNumRows <= m_items.size() )
127 {
128 m_items.erase( m_items.begin() + aPos, m_items.begin() + aPos + aNumRows );
129
130 if( GetView() )
131 {
132 wxGridTableMessage msg( this, wxGRIDTABLE_NOTIFY_ROWS_DELETED, aPos, aNumRows );
133 GetView()->ProcessTableMessage( msg );
134 }
135 return true;
136 }
137
138 return false;
139 }
140};
141
142class TEXT_ITEMS_GRID_TABLE : public wxGridTableBase
143{
145 std::vector<TEXT_ITEM_INFO> m_items;
146
147public:
148 TEXT_ITEMS_GRID_TABLE( bool aForFieldProps ) : m_forFieldProps( aForFieldProps ) {}
149
150 int GetNumberRows() override { return m_items.size(); }
151 int GetNumberCols() override { return 3; }
152
153 wxString GetColLabelValue( int aCol ) override
154 {
155 switch( aCol )
156 {
157 case 0: return m_forFieldProps ? _( "Value" ) : _( "Text Items" );
158 case 1: return _( "Show" );
159 case 2: return _( "Layer" );
160 default: return wxEmptyString;
161 }
162 }
163
164 wxString GetRowLabelValue( int aRow ) override
165 {
166 switch( aRow )
167 {
168 case 0: return _( "Reference designator" );
169 case 1: return _( "Value" );
170 default: return wxEmptyString;
171 }
172 }
173
174 bool CanGetValueAs( int aRow, int aCol, const wxString& aTypeName ) override
175 {
176 switch( aCol )
177 {
178 case 0: return aTypeName == wxGRID_VALUE_STRING;
179 case 1: return aTypeName == wxGRID_VALUE_BOOL;
180 case 2: return aTypeName == wxGRID_VALUE_NUMBER;
181 default: wxFAIL; return false;
182 }
183 }
184
185 bool CanSetValueAs( int aRow, int aCol, const wxString& aTypeName ) override
186 {
187 return CanGetValueAs( aRow, aCol, aTypeName );
188 }
189
190 wxString GetValue( int row, int col ) override { return m_items[row].m_Text; }
191 void SetValue( int row, int col, const wxString& value ) override
192 {
193 if( col == 0 )
194 m_items[row].m_Text = value;
195 }
196
197 bool GetValueAsBool( int row, int col ) override { return m_items[row].m_Visible; }
198 void SetValueAsBool( int row, int col, bool value ) override
199 {
200 if( col == 1 )
201 m_items[row].m_Visible = value;
202 }
203
204 long GetValueAsLong( int row, int col ) override { return m_items[row].m_Layer; }
205 void SetValueAsLong( int row, int col, long value ) override
206 {
207 if( col == 2 )
208 m_items[row].m_Layer = (int) value;
209 }
210
211 bool AppendRows( size_t aNumRows = 1 ) override
212 {
213 for( size_t i = 0; i < aNumRows; ++i )
214 m_items.emplace_back( wxT( "" ), true, F_SilkS );
215
216 if( GetView() )
217 {
218 wxGridTableMessage msg( this, wxGRIDTABLE_NOTIFY_ROWS_APPENDED, aNumRows );
219 GetView()->ProcessTableMessage( msg );
220 }
221
222 return true;
223 }
224
225 bool DeleteRows( size_t aPos, size_t aNumRows ) override
226 {
227 // aPos may be a large positive, e.g. size_t(-1), and the sum of
228 // aPos+aNumRows may wrap here, so both ends of the range are tested.
229 if( aPos < m_items.size() && aPos + aNumRows <= m_items.size() )
230 {
231 m_items.erase( m_items.begin() + aPos, m_items.begin() + aPos + aNumRows );
232
233 if( GetView() )
234 {
235 wxGridTableMessage msg( this, wxGRIDTABLE_NOTIFY_ROWS_DELETED, aPos, aNumRows );
236 GetView()->ProcessTableMessage( msg );
237 }
238 return true;
239 }
240
241 return false;
242 }
243};
244
245
247{
249 return *mgr.GetAppSettings<FOOTPRINT_EDITOR_SETTINGS>( "fpedit" );
250}
251
252
254 UNITS_PROVIDER* aUnitsProvider ) :
255 PANEL_FP_EDITOR_FIELD_DEFAULTS_BASE( aParent ), m_unitProvider( aUnitsProvider ),
256 m_designSettings( GetPgmSettings().m_DesignSettings )
257{
258 m_fieldPropsGrid->SetDefaultRowSize( m_fieldPropsGrid->GetDefaultRowSize() + 4 );
259
260 m_fieldPropsGrid->SetTable( new TEXT_ITEMS_GRID_TABLE( true ), true );
261 m_fieldPropsGrid->PushEventHandler( new GRID_TRICKS( m_fieldPropsGrid ) );
262 m_fieldPropsGrid->SetSelectionMode( wxGrid::wxGridSelectRows );
263
264 wxGridCellAttr* attr = new wxGridCellAttr;
265 attr->SetRenderer( new wxGridCellBoolRenderer() );
266 attr->SetReadOnly(); // not really; we delegate interactivity to GRID_TRICKS
267 attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
268 m_fieldPropsGrid->SetColAttr( 1, attr );
269
270 attr = new wxGridCellAttr;
271 attr->SetRenderer( new GRID_CELL_LAYER_RENDERER( nullptr ) );
272 attr->SetEditor( new GRID_CELL_LAYER_SELECTOR( nullptr, {} ) );
273 m_fieldPropsGrid->SetColAttr( 2, attr );
274
275 m_textItemsGrid->SetDefaultRowSize( m_textItemsGrid->GetDefaultRowSize() + 4 );
276
277 m_textItemsGrid->SetTable( new TEXT_ITEMS_GRID_TABLE( false ), true );
278 m_textItemsGrid->PushEventHandler( new GRID_TRICKS( m_textItemsGrid ) );
279 m_textItemsGrid->SetSelectionMode( wxGrid::wxGridSelectRows );
280
281 attr = new wxGridCellAttr;
282 attr->SetRenderer( new wxGridCellBoolRenderer() );
283 attr->SetReadOnly(); // not really; we delegate interactivity to GRID_TRICKS
284 attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
285 m_textItemsGrid->SetColAttr( 1, attr );
286
287 attr = new wxGridCellAttr;
288 attr->SetRenderer( new GRID_CELL_LAYER_RENDERER( nullptr ) );
289 attr->SetEditor( new GRID_CELL_LAYER_SELECTOR( nullptr, {} ) );
290 m_textItemsGrid->SetColAttr( 2, attr );
291
292 m_layerNameitemsGrid->SetDefaultRowSize( m_layerNameitemsGrid->GetDefaultRowSize() + 4 );
293
295 m_layerNameitemsGrid->PushEventHandler( new GRID_TRICKS( m_layerNameitemsGrid ) );
296 m_layerNameitemsGrid->SetSelectionMode( wxGrid::wxGridSelectRows );
297
298 attr = new wxGridCellAttr;
299 attr->SetRenderer( new GRID_CELL_LAYER_RENDERER( nullptr ) );
300 attr->SetEditor( new GRID_CELL_LAYER_SELECTOR( nullptr, LSET::AllTechMask() | LSET::AllCuMask() | Edge_Cuts | Margin ) );
301 m_layerNameitemsGrid->SetColAttr( 0, attr );
302
303
304}
305
306
308{
309 // destroy GRID_TRICKS before grids.
310 m_fieldPropsGrid->PopEventHandler( true );
311 m_textItemsGrid->PopEventHandler( true );
312 m_layerNameitemsGrid->PopEventHandler( true );
313}
314
315
317{
318 // Footprint defaults
319 m_fieldPropsGrid->GetTable()->DeleteRows( 0, m_fieldPropsGrid->GetNumberRows() );
320 m_fieldPropsGrid->GetTable()->AppendRows( 2 );
321
322 for( int i : { REFERENCE_FIELD, VALUE_FIELD } )
323 {
325
326 m_fieldPropsGrid->GetTable()->SetValue( i, 0, item.m_Text );
327 m_fieldPropsGrid->GetTable()->SetValueAsBool( i, 1, item.m_Visible );
328 m_fieldPropsGrid->GetTable()->SetValueAsLong( i, 2, item.m_Layer );
329 }
330
331 m_textItemsGrid->GetTable()->DeleteRows( 0, m_textItemsGrid->GetNumberRows() );
332 m_textItemsGrid->GetTable()->AppendRows( aCfg->m_DesignSettings.m_DefaultFPTextItems.size()
333 - 2 );
334
335 for( int i = 2; i < (int) aCfg->m_DesignSettings.m_DefaultFPTextItems.size(); ++i )
336 {
338
339 m_textItemsGrid->GetTable()->SetValue( i - 2, 0, item.m_Text );
340 m_textItemsGrid->GetTable()->SetValueAsBool( i - 2, 1, item.m_Visible );
341 m_textItemsGrid->GetTable()->SetValueAsLong( i - 2, 2, item.m_Layer );
342 }
343
344 for( auto& item : aCfg->m_DesignSettings.m_UserLayerNames )
345 {
346 wxString orig_name = item.first;
347 int layer = LSET::NameToLayer( orig_name );
348
349 if( !IsUserLayer( static_cast<PCB_LAYER_ID>( layer ) ) )
350 continue;
351
352 if( !m_layerNameitemsGrid->GetTable()->AppendRows( 1 ) )
353 break;
354
355 int row = m_layerNameitemsGrid->GetNumberRows() - 1;
356 m_layerNameitemsGrid->GetTable()->SetValueAsLong( row, 0, layer );
357 m_layerNameitemsGrid->GetTable()->SetValue( row, 1, item.second );
358 }
359
360 Layout();
361}
362
363
365{
367
368 loadFPSettings( &cfg );
369
370 return true;
371}
372
373
375{
376 bool retVal = wxPanel::Show( aShow );
377
378 if( aShow )
379 {
380 // These *should* work in the constructor, and indeed they do if this panel is the
381 // first displayed. However, on OSX 3.0.5 (at least), if another panel is displayed
382 // first then the icons will be blank unless they're set here.
383 m_bpAdd->SetBitmap( KiBitmapBundle( BITMAPS::small_plus ) );
384 m_bpDelete->SetBitmap( KiBitmapBundle( BITMAPS::small_trash ) );
385 m_bpAddLayer->SetBitmap( KiBitmapBundle( BITMAPS::small_plus ) );
386 m_bpDeleteLayer->SetBitmap( KiBitmapBundle( BITMAPS::small_trash ) );
387 }
388
389 return retVal;
390}
391
392
394{
396 return false;
397
399
400 // Footprint defaults
401 cfg.m_DefaultFPTextItems.clear();
402
403 wxGridTableBase* table = m_fieldPropsGrid->GetTable();
404
405 for( int i : { REFERENCE_FIELD, VALUE_FIELD } )
406 {
407 wxString text = table->GetValue( i, 0 );
408 bool visible = table->GetValueAsBool( i, 1 );
409 int layer = (int) table->GetValueAsLong( i, 2 );
410
411 cfg.m_DefaultFPTextItems.emplace_back( text, visible, layer );
412 }
413
414 table = m_textItemsGrid->GetTable();
415
416 for( int i = 0; i < m_textItemsGrid->GetNumberRows(); ++i )
417 {
418 wxString text = table->GetValue( i, 0 );
419 bool visible = table->GetValueAsBool( i, 1 );
420 int layer = (int) table->GetValueAsLong( i, 2 );
421
422 cfg.m_DefaultFPTextItems.emplace_back( text, visible, layer );
423 }
424
425 cfg.m_UserLayerNames.clear();
426 table = m_layerNameitemsGrid->GetTable();
427
428 for( int i = 0; i < m_layerNameitemsGrid->GetNumberRows(); ++i )
429 {
430 PCB_LAYER_ID layer = static_cast<PCB_LAYER_ID>( table->GetValueAsLong( i, 0 ) );
431 wxString orig_name = LSET::Name( static_cast<PCB_LAYER_ID>( layer ) );
432 wxString name = table->GetValue( i, 1 );
433
434 if( layer >= 0 && IsUserLayer( layer ) && !name.IsEmpty() )
435 cfg.m_UserLayerNames.emplace( orig_name.ToStdString(), name );
436 }
437
438 return true;
439}
440
441
443{
444 for( int i = 0; i < m_layerNameitemsGrid->GetNumberRows(); ++i )
445 {
446 if( m_layerNameitemsGrid->GetTable()->GetValueAsLong( i, 0 ) == aLayer )
447 return false;
448 }
449
450 return true;
451}
452
453
455{
456 std::set<int> usedLayers;
457
458 for( int i = 0; i < m_layerNameitemsGrid->GetNumberRows(); ++i )
459 usedLayers.insert( m_layerNameitemsGrid->GetTable()->GetValueAsLong( i, 0 ) );
460
461 for( int ii = User_1; ii < User_45; ++ii )
462 {
463 if( !usedLayers.contains( ii ) )
464 return ii;
465 }
466
467 return -1;
468}
469
470
472{
473 wxGridTableBase* table = m_layerNameitemsGrid->GetTable();
474
475 if( event.GetCol() == 0 )
476 {
477 int layer = static_cast<int>( table->GetValueAsLong( event.GetRow(), 0 ) );
478
479 for( int i = 0; i < m_layerNameitemsGrid->GetNumberRows(); ++i )
480 {
481 if( i != event.GetRow()
482 && table->GetValueAsLong( i, 0 ) == layer )
483 {
484 table->SetValueAsLong( event.GetRow(), 0, getNextAvailableLayer() );
485 return;
486 }
487 }
488 }
489
490 for( int ii = 0; ii < m_layerNameitemsGrid->GetNumberRows(); ++ii )
491 {
492 wxString layerName = table->GetValue( ii, 1 );
493
494 if( ii != event.GetRow() && layerName == table->GetValue( event.GetRow(), 1 ) )
495 {
496 wxString msg = wxString::Format( _( "Layer name %s already in use." ), layerName );
497 PAGED_DIALOG::GetDialog( this )->SetError( msg, this, m_layerNameitemsGrid, ii, 1 );
498 return;
499 }
500 }
501}
502
503
505{
507 return;
508
509 wxGridTableBase* table = m_textItemsGrid->GetTable();
510
511 int newRow = m_textItemsGrid->GetNumberRows();
512 table->AppendRows( 1 );
513 table->SetValueAsBool( newRow, 1, table->GetValueAsBool( newRow - 1, 1 ) );
514 table->SetValueAsLong( newRow, 2, table->GetValueAsLong( newRow - 1, 2 ) );
515
516 m_textItemsGrid->MakeCellVisible( newRow, 0 );
517 m_textItemsGrid->SetGridCursor( newRow, 0 );
518
519 m_textItemsGrid->EnableCellEditControl( true );
520 m_textItemsGrid->ShowCellEditControl();
521}
522
523
525{
527 return;
528
529 wxGridTableBase* table = m_layerNameitemsGrid->GetTable();
530
531 int newRow = m_layerNameitemsGrid->GetNumberRows();
532 table->AppendRows( 1 );
533
534 m_layerNameitemsGrid->MakeCellVisible( newRow, 0 );
535 m_layerNameitemsGrid->SetGridCursor( newRow, 0 );
536
537 m_layerNameitemsGrid->EnableCellEditControl( true );
538 m_layerNameitemsGrid->ShowCellEditControl();
539}
540
541
543{
544 wxArrayInt selectedRows = m_textItemsGrid->GetSelectedRows();
545
546 if( selectedRows.empty() && m_textItemsGrid->GetGridCursorRow() >= 0 )
547 selectedRows.push_back( m_textItemsGrid->GetGridCursorRow() );
548
549 if( selectedRows.empty() )
550 return;
551
553 return;
554
555 // Reverse sort so deleting a row doesn't change the indexes of the other rows.
556 selectedRows.Sort(
557 []( int* first, int* second )
558 {
559 return *second - *first;
560 } );
561
562 for( int row : selectedRows )
563 {
564 m_textItemsGrid->GetTable()->DeleteRows( row, 1 );
565
566 if( m_textItemsGrid->GetNumberRows() > 0 )
567 {
568 m_textItemsGrid->MakeCellVisible( std::max( 0, row - 1 ),
569 m_textItemsGrid->GetGridCursorCol() );
570 m_textItemsGrid->SetGridCursor( std::max( 0, row - 1 ),
571 m_textItemsGrid->GetGridCursorCol() );
572 }
573 }
574}
575
576
578{
579 wxArrayInt selectedRows = m_layerNameitemsGrid->GetSelectedRows();
580
581 if( selectedRows.empty() && m_layerNameitemsGrid->GetGridCursorRow() >= 0 )
582 selectedRows.push_back( m_layerNameitemsGrid->GetGridCursorRow() );
583
584 if( selectedRows.empty() )
585 return;
586
588 return;
589
590 // Reverse sort so deleting a row doesn't change the indexes of the other rows.
591 selectedRows.Sort(
592 []( int* first, int* second )
593 {
594 return *second - *first;
595 } );
596
597 for( int row : selectedRows )
598 {
599 m_layerNameitemsGrid->GetTable()->DeleteRows( row, 1 );
600
601 if( m_layerNameitemsGrid->GetNumberRows() > 0 )
602 {
603 m_layerNameitemsGrid->MakeCellVisible( std::max( 0, row - 1 ),
604 m_layerNameitemsGrid->GetGridCursorCol() );
605 m_layerNameitemsGrid->SetGridCursor( std::max( 0, row - 1 ),
606 m_layerNameitemsGrid->GetGridCursorCol() );
607 }
608 }
609}
610
611
613{
615 cfg.Load(); // Loading without a file will init to defaults
616
617 loadFPSettings( &cfg );
618}
const char * name
Definition: DXF_plotter.cpp:59
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap)
Definition: bitmap.cpp:110
Container for design settings for a BOARD object.
std::vector< TEXT_ITEM_INFO > m_DefaultFPTextItems
std::map< std::string, wxString > m_UserLayerNames
BOARD_DESIGN_SETTINGS m_DesignSettings
Only some of these settings are actually used for footprint editing.
Add mouse and command handling (such as cut, copy, and paste) to a WX_GRID instance.
Definition: grid_tricks.h:61
virtual void Load()
Updates the parameters of this object based on the current JSON document contents.
bool DeleteRows(size_t aPos, size_t aNumRows) override
void SetValue(int row, int col, const wxString &value) override
std::vector< TEXT_ITEM_INFO > m_items
bool CanGetValueAs(int aRow, int aCol, const wxString &aTypeName) override
wxString GetColLabelValue(int aCol) override
bool AppendRows(size_t aNumRows=1) override
wxString GetValue(int row, int col) override
bool CanSetValueAs(int aRow, int aCol, const wxString &aTypeName) override
void SetValueAsLong(int row, int col, long value) override
long GetValueAsLong(int row, int col) override
static LSET AllTechMask()
Return a mask holding all technical layers (no CU layer) on both side.
Definition: lset.cpp:628
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:564
static int NameToLayer(wxString &aName)
Return the layer number from a layer name.
Definition: lset.cpp:117
static wxString Name(PCB_LAYER_ID aLayerId)
Return the fixed name association with aLayerId.
Definition: lset.cpp:188
static PAGED_DIALOG * GetDialog(wxWindow *aWindow)
void SetError(const wxString &aMessage, const wxString &aPageName, int aCtrlId, int aRow=-1, int aCol=-1)
Class PANEL_FP_EDITOR_FIELD_DEFAULTS_BASE.
PANEL_FP_EDITOR_FIELD_DEFAULTS(wxWindow *aParent, UNITS_PROVIDER *aUnitsProvider)
virtual void onLayerChange(wxGridEvent &event) override
virtual void OnAddTextItem(wxCommandEvent &event) override
virtual void OnDeleteTextItem(wxCommandEvent &event) override
void loadFPSettings(const FOOTPRINT_EDITOR_SETTINGS *aCfg)
void ResetPanel() override
Reset the contents of this panel.
virtual void OnAddLayerItem(wxCommandEvent &event) override
virtual void OnDeleteLayerItem(wxCommandEvent &event) override
virtual SETTINGS_MANAGER & GetSettingsManager() const
Definition: pgm_base.h:125
T * GetAppSettings(const wxString &aFilename)
Return a handle to the a given settings by type.
void SetBitmap(const wxBitmapBundle &aBmp)
std::vector< TEXT_ITEM_INFO > m_items
bool DeleteRows(size_t aPos, size_t aNumRows) override
wxString GetRowLabelValue(int aRow) override
void SetValueAsLong(int row, int col, long value) override
void SetValue(int row, int col, const wxString &value) override
wxString GetValue(int row, int col) override
void SetValueAsBool(int row, int col, bool value) override
wxString GetColLabelValue(int aCol) override
bool CanSetValueAs(int aRow, int aCol, const wxString &aTypeName) override
bool GetValueAsBool(int row, int col) override
bool AppendRows(size_t aNumRows=1) override
bool CanGetValueAs(int aRow, int aCol, const wxString &aTypeName) override
long GetValueAsLong(int row, int col) override
void SetTable(wxGridTableBase *table, bool aTakeOwnership=false)
Hide wxGrid's SetTable() method with one which doesn't mess up the grid column widths when setting th...
Definition: wx_grid.cpp:277
bool CommitPendingChanges(bool aQuietMode=false)
Close any open cell edit controls.
Definition: wx_grid.cpp:646
This file is part of the common library.
#define _(s)
bool IsUserLayer(PCB_LAYER_ID aLayerId)
Test whether a layer is a non copper and a non tech layer.
Definition: layer_ids.h:698
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:60
@ User_45
Definition: layer_ids.h:168
@ Edge_Cuts
Definition: layer_ids.h:112
@ Margin
Definition: layer_ids.h:113
@ F_SilkS
Definition: layer_ids.h:100
@ User_1
Definition: layer_ids.h:124
static FOOTPRINT_EDITOR_SETTINGS & GetPgmSettings()
PGM_BASE & Pgm()
The global program "get" accessor.
Definition: pgm_base.cpp:1073
see class PGM_BASE
@ VALUE_FIELD
Field Value of part, i.e. "3.3K".
@ REFERENCE_FIELD
Field Reference of part, i.e. "IC21".