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<PCB_LAYER_ID>( 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, static_cast<PCB_LAYER_ID>( 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 ) :
149 m_forFieldProps( aForFieldProps )
150 {}
151
152 int GetNumberRows() override { return m_items.size(); }
153 int GetNumberCols() override { return m_forFieldProps ? 3 : 2; }
154
155 wxString GetColLabelValue( int aCol ) override
156 {
157 if( m_forFieldProps )
158 {
159 switch( aCol )
160 {
161 case 0: return _( "Value" );
162 case 1: return _( "Show" );
163 case 2: return _( "Layer" );
164 default: return wxEmptyString;
165 }
166 }
167 else
168 {
169 switch( aCol )
170 {
171 case 0: return _( "Text Items" );
172 case 1: return _( "Layer" );
173 default: return wxEmptyString;
174 }
175 }
176 }
177
178 wxString GetRowLabelValue( int aRow ) override
179 {
180 switch( aRow )
181 {
182 case 0: return _( "Reference designator" );
183 case 1: return _( "Value" );
184 default: return wxEmptyString;
185 }
186 }
187
188 bool CanGetValueAs( int aRow, int aCol, const wxString& aTypeName ) override
189 {
190 if( m_forFieldProps )
191 {
192 switch( aCol )
193 {
194 case 0: return aTypeName == wxGRID_VALUE_STRING;
195 case 1: return aTypeName == wxGRID_VALUE_BOOL;
196 case 2: return aTypeName == wxGRID_VALUE_NUMBER;
197 default: wxFAIL; return false;
198 }
199 }
200 else
201 {
202 switch( aCol )
203 {
204 case 0: return aTypeName == wxGRID_VALUE_STRING;
205 case 1: return aTypeName == wxGRID_VALUE_NUMBER;
206 default: wxFAIL; return false;
207 }
208 }
209 }
210
211 bool CanSetValueAs( int aRow, int aCol, const wxString& aTypeName ) override
212 {
213 return CanGetValueAs( aRow, aCol, aTypeName );
214 }
215
216 wxString GetValue( int row, int col ) override { return m_items[row].m_Text; }
217 void SetValue( int row, int col, const wxString& value ) override
218 {
219 if( col == 0 )
220 m_items[row].m_Text = value;
221 }
222
223 bool GetValueAsBool( int row, int col ) override { return m_items[row].m_Visible; }
224 void SetValueAsBool( int row, int col, bool value ) override
225 {
226 if( col == 1 )
227 m_items[row].m_Visible = value;
228 }
229
230 long GetValueAsLong( int row, int col ) override { return m_items[row].m_Layer; }
231 void SetValueAsLong( int row, int col, long value ) override
232 {
233 if( col == 2 )
234 m_items[row].m_Layer = static_cast<PCB_LAYER_ID>( value );
235 }
236
237 bool AppendRows( size_t aNumRows = 1 ) override
238 {
239 for( size_t i = 0; i < aNumRows; ++i )
240 m_items.emplace_back( wxT( "" ), true, F_SilkS );
241
242 if( GetView() )
243 {
244 wxGridTableMessage msg( this, wxGRIDTABLE_NOTIFY_ROWS_APPENDED, aNumRows );
245 GetView()->ProcessTableMessage( msg );
246 }
247
248 return true;
249 }
250
251 bool DeleteRows( size_t aPos, size_t aNumRows ) override
252 {
253 // aPos may be a large positive, e.g. size_t(-1), and the sum of
254 // aPos+aNumRows may wrap here, so both ends of the range are tested.
255 if( aPos < m_items.size() && aPos + aNumRows <= m_items.size() )
256 {
257 m_items.erase( m_items.begin() + aPos, m_items.begin() + aPos + aNumRows );
258
259 if( GetView() )
260 {
261 wxGridTableMessage msg( this, wxGRIDTABLE_NOTIFY_ROWS_DELETED, aPos, aNumRows );
262 GetView()->ProcessTableMessage( msg );
263 }
264 return true;
265 }
266
267 return false;
268 }
269};
270
271
273{
275 return *mgr.GetAppSettings<FOOTPRINT_EDITOR_SETTINGS>( "fpedit" );
276}
277
278
280 UNITS_PROVIDER* aUnitsProvider ) :
281 PANEL_FP_EDITOR_FIELD_DEFAULTS_BASE( aParent ), m_unitProvider( aUnitsProvider ),
282 m_designSettings( GetPgmSettings().m_DesignSettings )
283{
284 m_fieldPropsGrid->SetDefaultRowSize( m_fieldPropsGrid->GetDefaultRowSize() + 4 );
285
286 m_fieldPropsGrid->SetTable( new TEXT_ITEMS_GRID_TABLE( true ), true );
287 m_fieldPropsGrid->PushEventHandler( new GRID_TRICKS( m_fieldPropsGrid ) );
288 m_fieldPropsGrid->SetSelectionMode( wxGrid::wxGridSelectRows );
289
290 wxGridCellAttr* attr = new wxGridCellAttr;
291 attr->SetRenderer( new wxGridCellBoolRenderer() );
292 attr->SetReadOnly(); // not really; we delegate interactivity to GRID_TRICKS
293 attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
294 m_fieldPropsGrid->SetColAttr( 1, attr );
295
296 attr = new wxGridCellAttr;
297 attr->SetRenderer( new GRID_CELL_LAYER_RENDERER( nullptr ) );
298 attr->SetEditor( new GRID_CELL_LAYER_SELECTOR( nullptr, {} ) );
299 m_fieldPropsGrid->SetColAttr( 2, attr );
300
301 m_textItemsGrid->SetDefaultRowSize( m_textItemsGrid->GetDefaultRowSize() + 4 );
302
303 m_textItemsGrid->SetTable( new TEXT_ITEMS_GRID_TABLE( false ), true );
304 m_textItemsGrid->PushEventHandler( new GRID_TRICKS( m_textItemsGrid ) );
305 m_textItemsGrid->SetSelectionMode( wxGrid::wxGridSelectRows );
306
307 attr = new wxGridCellAttr;
308 attr->SetRenderer( new GRID_CELL_LAYER_RENDERER( nullptr ) );
309 attr->SetEditor( new GRID_CELL_LAYER_SELECTOR( nullptr, {} ) );
310 m_textItemsGrid->SetColAttr( 1, attr );
311
312 m_layerNameitemsGrid->SetDefaultRowSize( m_layerNameitemsGrid->GetDefaultRowSize() + 4 );
313
315 m_layerNameitemsGrid->PushEventHandler( new GRID_TRICKS( m_layerNameitemsGrid ) );
316 m_layerNameitemsGrid->SetSelectionMode( wxGrid::wxGridSelectRows );
317
318 attr = new wxGridCellAttr;
319 attr->SetRenderer( new GRID_CELL_LAYER_RENDERER( nullptr ) );
320 LSET forbiddenLayers = LSET::AllCuMask() | LSET::AllTechMask();
321 forbiddenLayers.set( Edge_Cuts );
322 forbiddenLayers.set( Margin );
323 attr->SetEditor( new GRID_CELL_LAYER_SELECTOR( nullptr, forbiddenLayers ) );
324 m_layerNameitemsGrid->SetColAttr( 0, attr );
325
326
327}
328
329
331{
332 // destroy GRID_TRICKS before grids.
333 m_fieldPropsGrid->PopEventHandler( true );
334 m_textItemsGrid->PopEventHandler( true );
335 m_layerNameitemsGrid->PopEventHandler( true );
336}
337
338
340{
341 // Footprint defaults
342 wxGridTableBase* table = m_fieldPropsGrid->GetTable();
343 table->DeleteRows( 0, m_fieldPropsGrid->GetNumberRows() );
344 table->AppendRows( 2 );
345
346 for( int i : { 0, 1 } )
347 {
349
350 table->SetValue( i, 0, item.m_Text );
351 table->SetValueAsBool( i, 1, item.m_Visible );
352 table->SetValueAsLong( i, 2, item.m_Layer );
353 }
354
355 table = m_textItemsGrid->GetTable();
356 table->DeleteRows( 0, m_textItemsGrid->GetNumberRows() );
357
358 // if aCfg->m_DesignSettings.m_DefaultFPTextItems.size() is > 2 (first and second are ref and
359 // value), some extra texts must be added to the list of default texts
360 int extra_texts_cnt = aCfg->m_DesignSettings.m_DefaultFPTextItems.size() - 2;
361
362 if( extra_texts_cnt > 0 )
363 table->AppendRows( extra_texts_cnt );
364
365 for( int i = 2; i < (int) aCfg->m_DesignSettings.m_DefaultFPTextItems.size(); ++i )
366 {
368
369 table->SetValue( i - 2, 0, item.m_Text );
370 table->SetValueAsLong( i - 2, 1, item.m_Layer );
371 }
372
373 table = m_layerNameitemsGrid->GetTable();
374
375 for( auto& item : aCfg->m_DesignSettings.m_UserLayerNames )
376 {
377 wxString orig_name = item.first;
378 int layer = LSET::NameToLayer( orig_name );
379
380 if( !IsUserLayer( static_cast<PCB_LAYER_ID>( layer ) ) )
381 continue;
382
383 int row = m_layerNameitemsGrid->GetNumberRows();
384 table->AppendRows( 1 );
385 table->SetValueAsLong( row, 0, layer );
386 table->SetValue( row, 1, item.second );
387 }
388
389 Layout();
390}
391
392
394{
396
397 loadFPSettings( &cfg );
398
399 return true;
400}
401
402
404{
405 bool retVal = wxPanel::Show( aShow );
406
407 if( aShow )
408 {
409 // These *should* work in the constructor, and indeed they do if this panel is the
410 // first displayed. However, on OSX 3.0.5 (at least), if another panel is displayed
411 // first then the icons will be blank unless they're set here.
412 m_bpAdd->SetBitmap( KiBitmapBundle( BITMAPS::small_plus ) );
413 m_bpDelete->SetBitmap( KiBitmapBundle( BITMAPS::small_trash ) );
414 m_bpAddLayer->SetBitmap( KiBitmapBundle( BITMAPS::small_plus ) );
415 m_bpDeleteLayer->SetBitmap( KiBitmapBundle( BITMAPS::small_trash ) );
416 }
417
418 return retVal;
419}
420
421
423{
425 return false;
426
428
429 // Footprint defaults
430 cfg.m_DefaultFPTextItems.clear();
431
432 wxGridTableBase* table = m_fieldPropsGrid->GetTable();
433
434 for( int i : { 0, 1 } )
435 {
436 wxString text = table->GetValue( i, 0 );
437 bool visible = table->GetValueAsBool( i, 1 );
438 PCB_LAYER_ID layer = static_cast<PCB_LAYER_ID>( table->GetValueAsLong( i, 2 ) );
439
440 cfg.m_DefaultFPTextItems.emplace_back( text, visible, layer );
441 }
442
443 table = m_textItemsGrid->GetTable();
444
445 for( int i = 0; i < m_textItemsGrid->GetNumberRows(); ++i )
446 {
447 wxString text = table->GetValue( i, 0 );
448 PCB_LAYER_ID layer = static_cast<PCB_LAYER_ID>( table->GetValueAsLong( i, 1 ) );
449
450 cfg.m_DefaultFPTextItems.emplace_back( text, true, layer );
451 }
452
453 cfg.m_UserLayerNames.clear();
454 table = m_layerNameitemsGrid->GetTable();
455
456 for( int i = 0; i < m_layerNameitemsGrid->GetNumberRows(); ++i )
457 {
458 PCB_LAYER_ID layer = static_cast<PCB_LAYER_ID>( table->GetValueAsLong( i, 0 ) );
459 wxString orig_name = LSET::Name( static_cast<PCB_LAYER_ID>( layer ) );
460 wxString name = table->GetValue( i, 1 );
461
462 if( layer >= 0 && IsUserLayer( layer ) && !name.IsEmpty() )
463 cfg.m_UserLayerNames.emplace( orig_name.ToStdString(), name );
464 }
465
466 return true;
467}
468
469
471{
472 for( int i = 0; i < m_layerNameitemsGrid->GetNumberRows(); ++i )
473 {
474 if( m_layerNameitemsGrid->GetTable()->GetValueAsLong( i, 0 ) == aLayer )
475 return false;
476 }
477
478 return true;
479}
480
481
483{
484 std::set<int> usedLayers;
485
486 for( int i = 0; i < m_layerNameitemsGrid->GetNumberRows(); ++i )
487 usedLayers.insert( m_layerNameitemsGrid->GetTable()->GetValueAsLong( i, 0 ) );
488
489 for( int ii = User_1; ii < User_45; ++ii )
490 {
491 if( !usedLayers.contains( ii ) )
492 return ii;
493 }
494
495 return -1;
496}
497
498
500{
501 wxGridTableBase* table = m_layerNameitemsGrid->GetTable();
502
503 if( event.GetCol() == 0 )
504 {
505 int layer = static_cast<int>( table->GetValueAsLong( event.GetRow(), 0 ) );
506
507 for( int i = 0; i < m_layerNameitemsGrid->GetNumberRows(); ++i )
508 {
509 if( i != event.GetRow()
510 && table->GetValueAsLong( i, 0 ) == layer )
511 {
512 table->SetValueAsLong( event.GetRow(), 0, getNextAvailableLayer() );
513 return;
514 }
515 }
516 }
517
518 for( int ii = 0; ii < m_layerNameitemsGrid->GetNumberRows(); ++ii )
519 {
520 wxString layerName = table->GetValue( ii, 1 );
521
522 if( ii != event.GetRow() && layerName == table->GetValue( event.GetRow(), 1 ) )
523 {
524 wxString msg = wxString::Format( _( "Layer name %s already in use." ), layerName );
525 PAGED_DIALOG::GetDialog( this )->SetError( msg, this, m_layerNameitemsGrid, ii, 1 );
526 return;
527 }
528 }
529}
530
531
533{
535 return;
536
537 wxGridTableBase* table = m_textItemsGrid->GetTable();
538
539 int newRow = m_textItemsGrid->GetNumberRows();
540 table->AppendRows( 1 );
541 table->SetValueAsLong( newRow, 1, table->GetValueAsLong( newRow - 1, 1 ) );
542
543 m_textItemsGrid->MakeCellVisible( newRow, 0 );
544 m_textItemsGrid->SetGridCursor( newRow, 0 );
545
546 m_textItemsGrid->EnableCellEditControl( true );
547 m_textItemsGrid->ShowCellEditControl();
548}
549
550
552{
554 return;
555
556 wxGridTableBase* table = m_layerNameitemsGrid->GetTable();
557
558 int newRow = m_layerNameitemsGrid->GetNumberRows();
559 table->AppendRows( 1 );
560
561 m_layerNameitemsGrid->MakeCellVisible( newRow, 0 );
562 m_layerNameitemsGrid->SetGridCursor( newRow, 0 );
563
564 m_layerNameitemsGrid->EnableCellEditControl( true );
565 m_layerNameitemsGrid->ShowCellEditControl();
566}
567
568
570{
571 wxArrayInt selectedRows = m_textItemsGrid->GetSelectedRows();
572
573 if( selectedRows.empty() && m_textItemsGrid->GetGridCursorRow() >= 0 )
574 selectedRows.push_back( m_textItemsGrid->GetGridCursorRow() );
575
576 if( selectedRows.empty() )
577 return;
578
580 return;
581
582 // Reverse sort so deleting a row doesn't change the indexes of the other rows.
583 selectedRows.Sort(
584 []( int* first, int* second )
585 {
586 return *second - *first;
587 } );
588
589 for( int row : selectedRows )
590 {
591 m_textItemsGrid->GetTable()->DeleteRows( row, 1 );
592
593 if( m_textItemsGrid->GetNumberRows() > 0 )
594 {
595 m_textItemsGrid->MakeCellVisible( std::max( 0, row - 1 ),
596 m_textItemsGrid->GetGridCursorCol() );
597 m_textItemsGrid->SetGridCursor( std::max( 0, row - 1 ),
598 m_textItemsGrid->GetGridCursorCol() );
599 }
600 }
601}
602
603
605{
606 wxArrayInt selectedRows = m_layerNameitemsGrid->GetSelectedRows();
607
608 if( selectedRows.empty() && m_layerNameitemsGrid->GetGridCursorRow() >= 0 )
609 selectedRows.push_back( m_layerNameitemsGrid->GetGridCursorRow() );
610
611 if( selectedRows.empty() )
612 return;
613
615 return;
616
617 // Reverse sort so deleting a row doesn't change the indexes of the other rows.
618 selectedRows.Sort(
619 []( int* first, int* second )
620 {
621 return *second - *first;
622 } );
623
624 for( int row : selectedRows )
625 {
626 m_layerNameitemsGrid->GetTable()->DeleteRows( row, 1 );
627
628 if( m_layerNameitemsGrid->GetNumberRows() > 0 )
629 {
630 m_layerNameitemsGrid->MakeCellVisible( std::max( 0, row - 1 ),
631 m_layerNameitemsGrid->GetGridCursorCol() );
632 m_layerNameitemsGrid->SetGridCursor( std::max( 0, row - 1 ),
633 m_layerNameitemsGrid->GetGridCursorCol() );
634 }
635 }
636}
637
638
640{
642 cfg.Load(); // Loading without a file will init to defaults
643
644 loadFPSettings( &cfg );
645}
const char * name
Definition: DXF_plotter.cpp:59
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
Definition: bitmap.cpp:110
BASE_SET & set(size_t pos)
Definition: base_set.h:116
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
LSET is a set of PCB_LAYER_IDs.
Definition: lset.h:37
static LSET AllTechMask()
Return a mask holding all technical layers (no CU layer) on both side.
Definition: lset.cpp:636
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:572
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:275
bool CommitPendingChanges(bool aQuietMode=false)
Close any open cell edit controls.
Definition: wx_grid.cpp:644
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:699
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