KiCad PCB EDA Suite
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
dialog_footprint_properties_fp_editor.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 (C) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr
5 * Copyright (C) 2015 Dick Hollenbeck, dick@softplc.com
6 * Copyright (C) 2008 Wayne Stambaugh <stambaughw@gmail.com>
7 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, you may find one here:
21 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
22 * or you may search the http://www.gnu.org website for the version 2 license,
23 * or you may write to the Free Software Foundation, Inc.,
24 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
25 */
26
29#include <bitmaps.h>
30#include <board_commit.h>
32#include <confirm.h>
36#include <embedded_files.h>
37#include <filename_resolver.h>
38#include <footprint.h>
42#include <kiplatform/ui.h>
45#include <pgm_base.h>
47#include <tool/tool_manager.h>
48#include <tools/pcb_actions.h>
50#include <validators.h>
54#include <widgets/wx_grid.h>
55
56#include <fp_lib_table.h>
57#include <project_pcb.h>
58#include <kidialog.h>
59
61 m_frame( aFrame )
62{
63 m_layerColAttr = new wxGridCellAttr;
64 m_layerColAttr->SetRenderer( new GRID_CELL_LAYER_RENDERER( m_frame ) );
65
66 LSET forbiddenLayers = LSET::AllCuMask() | LSET::AllTechMask();
67 forbiddenLayers.set( Edge_Cuts );
68 forbiddenLayers.set( Margin );
69 m_layerColAttr->SetEditor( new GRID_CELL_LAYER_SELECTOR( m_frame, forbiddenLayers, true ) );
70}
71
72
74{
75 m_layerColAttr->DecRef();
76}
77
78
79bool PRIVATE_LAYERS_GRID_TABLE::CanGetValueAs( int aRow, int aCol, const wxString& aTypeName )
80{
81 return aTypeName == wxGRID_VALUE_NUMBER;
82}
83
84
85bool PRIVATE_LAYERS_GRID_TABLE::CanSetValueAs( int aRow, int aCol, const wxString& aTypeName )
86{
87 return aTypeName == wxGRID_VALUE_NUMBER;
88}
89
90
91wxGridCellAttr* PRIVATE_LAYERS_GRID_TABLE::GetAttr( int aRow, int aCol,
92 wxGridCellAttr::wxAttrKind aKind )
93{
94 m_layerColAttr->IncRef();
95 return enhanceAttr( m_layerColAttr, aRow, aCol, aKind );
96}
97
98
99wxString PRIVATE_LAYERS_GRID_TABLE::GetValue( int aRow, int aCol )
100{
101 return m_frame->GetBoard()->GetLayerName( this->at( (size_t) aRow ) );
102}
103
104
106{
107 return this->at( (size_t) aRow );
108}
109
110
111void PRIVATE_LAYERS_GRID_TABLE::SetValue( int aRow, int aCol, const wxString &aValue )
112{
113 wxFAIL_MSG( wxString::Format( wxT( "column %d doesn't hold a string value" ), aCol ) );
114}
115
116
117void PRIVATE_LAYERS_GRID_TABLE::SetValueAsLong( int aRow, int aCol, long aValue )
118{
119 this->at( (size_t) aRow ) = ToLAYER_ID( (int) aValue );
120}
121
122
123// Remember the last open page during session.
124
126
127
129 FOOTPRINT_EDIT_FRAME* aParent,
130 FOOTPRINT* aFootprint ) :
132 m_frame( aParent ),
133 m_footprint( aFootprint ),
134 m_initialized( false ),
135 m_netClearance( aParent, m_NetClearanceLabel, m_NetClearanceCtrl, m_NetClearanceUnits ),
136 m_solderMask( aParent, m_SolderMaskMarginLabel, m_SolderMaskMarginCtrl,
137 m_SolderMaskMarginUnits ),
138 m_solderPaste( aParent, m_SolderPasteMarginLabel, m_SolderPasteMarginCtrl,
139 m_SolderPasteMarginUnits ),
140 m_solderPasteRatio( aParent, m_PasteMarginRatioLabel, m_PasteMarginRatioCtrl,
141 m_PasteMarginRatioUnits ),
142 m_gridSize( 0, 0 ),
143 m_lastRequestedSize( 0, 0 )
144{
145 SetEvtHandlerEnabled( false );
146
147 // Create the extra panels.
150
151 m_NoteBook->AddPage( m_3dPanel, _("3D Models"), false );
152 m_NoteBook->AddPage( m_embeddedFiles, _( "Embedded Files" ) );
153
156
157 m_delayedErrorMessage = wxEmptyString;
158 m_delayedFocusCtrl = nullptr;
159 m_delayedFocusGrid = nullptr;
162 m_delayedFocusPage = NOTEBOOK_PAGES::PAGE_UNKNOWN;
163
164 // Give an icon
165 wxIcon icon;
166 icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_modedit ) );
167 SetIcon( icon );
168
169 // Give a bit more room for combobox editors
170 m_itemsGrid->SetDefaultRowSize( m_itemsGrid->GetDefaultRowSize() + 4 );
171 m_privateLayersGrid->SetDefaultRowSize( m_privateLayersGrid->GetDefaultRowSize() + 4 );
172
175
176 m_itemsGrid->PushEventHandler( new GRID_TRICKS( m_itemsGrid ) );
178 [this]( wxCommandEvent& aEvent )
179 {
180 OnAddLayer( aEvent );
181 } ) );
182 m_padGroupsGrid->PushEventHandler( new GRID_TRICKS( m_padGroupsGrid,
183 [this]( wxCommandEvent& aEvent )
184 {
185 OnAddPadGroup( aEvent );
186 } ) );
187
188 m_itemsGrid->SetSelectionMode( wxGrid::wxGridSelectRows );
189 m_privateLayersGrid->SetSelectionMode( wxGrid::wxGridSelectRows );
190 m_padGroupsGrid->SetSelectionMode( wxGrid::wxGridSelectRows );
191
192 // Show/hide columns according to the user's preference
194
196
197 // Set font sizes
198 wxFont infoFont = KIUI::GetInfoFont( this );
199 infoFont.SetStyle( wxFONTSTYLE_ITALIC );
200 m_staticTextInfoCopper->SetFont( infoFont );
201 m_staticTextInfoPaste->SetFont( infoFont );
202
203 if( static_cast<int>( m_page ) >= 0 )
204 m_NoteBook->SetSelection( (unsigned) m_page );
205
206 if( m_page == NOTEBOOK_PAGES::PAGE_GENERAL )
207 {
211 m_delayedFocusPage = NOTEBOOK_PAGES::PAGE_GENERAL;
212 }
213 else if( m_page == NOTEBOOK_PAGES::PAGE_CLEARANCES )
214 {
216 }
217
219
220 m_solderPasteRatio.SetUnits( EDA_UNITS::PERCENT );
222
223 // Configure button logos
224 m_bpAdd->SetBitmap( KiBitmapBundle( BITMAPS::small_plus ) );
225 m_bpDelete->SetBitmap( KiBitmapBundle( BITMAPS::small_trash ) );
226 m_bpAddLayer->SetBitmap( KiBitmapBundle( BITMAPS::small_plus ) );
227 m_bpDeleteLayer->SetBitmap( KiBitmapBundle( BITMAPS::small_trash ) );
228 m_bpAddPadGroup->SetBitmap( KiBitmapBundle( BITMAPS::small_plus ) );
229 m_bpRemovePadGroup->SetBitmap( KiBitmapBundle( BITMAPS::small_trash ) );
230
231 m_btnCreateJumperPadGroup->SetBitmap( KiBitmapBundle( BITMAPS::right ) );
232 m_btnRemoveJumperPadGroup->SetBitmap( KiBitmapBundle( BITMAPS::left ) );
233
235
237 SetEvtHandlerEnabled( true );
238}
239
240
242{
244
245 // Prevents crash bug in wxGrid's d'tor
248
249 // Delete the GRID_TRICKS.
250 m_itemsGrid->PopEventHandler( true );
251 m_privateLayersGrid->PopEventHandler( true );
252 m_padGroupsGrid->PopEventHandler( true );
253
254 m_page = static_cast<NOTEBOOK_PAGES>( m_NoteBook->GetSelection() );
255
256 // the GL canvas on the 3D models page has to be visible before it is destroyed
257 m_NoteBook->SetSelection( static_cast<int>( NOTEBOOK_PAGES::PAGE_3D_MODELS ) );
258}
259
260
262{
263 LIB_ID fpID = m_footprint->GetFPID();
264 wxString footprintName = fpID.GetLibItemName();
265
266 m_FootprintNameCtrl->ChangeValue( footprintName );
267
269 m_KeywordCtrl->SetValue( m_footprint->GetKeywords() );
270
271 if( !wxDialog::TransferDataToWindow() )
272 return false;
273
274 if( !m_PanelGeneral->TransferDataToWindow() )
275 return false;
276
277 // Add the models to the panel
279 return false;
280
282 return false;
283
284 // Footprint Fields
285 for( PCB_FIELD* field : m_footprint->GetFields() )
286 m_fields->push_back( *field );
287
288 // Notify the grid
289 wxGridTableMessage tmsg( m_fields, wxGRIDTABLE_NOTIFY_ROWS_APPENDED,
291 m_itemsGrid->ProcessTableMessage( tmsg );
292
294 m_componentType->SetSelection( 0 );
295 else if( m_footprint->GetAttributes() & FP_SMD )
296 m_componentType->SetSelection( 1 );
297 else
298 m_componentType->SetSelection( 2 );
299
300 // Private layers
301 for( PCB_LAYER_ID privateLayer : m_footprint->GetPrivateLayers().UIOrder() )
302 m_privateLayers->push_back( privateLayer );
303
304 // Notify the grid
305 wxGridTableMessage gridTableMessagesg( m_privateLayers, wxGRIDTABLE_NOTIFY_ROWS_APPENDED,
307 m_privateLayersGrid->ProcessTableMessage( gridTableMessagesg );
308
313 m_cbDNP->SetValue( m_footprint->GetAttributes() & FP_DNP );
314
315 // Local Clearances
316
317 if( m_footprint->GetLocalClearance().has_value() )
319 else
320 m_netClearance.SetValue( wxEmptyString );
321
322 if( m_footprint->GetLocalSolderMaskMargin().has_value() )
324 else
325 m_solderMask.SetValue( wxEmptyString );
326
327 if( m_footprint->GetLocalSolderPasteMargin().has_value() )
329 else
330 m_solderPaste.SetValue( wxEmptyString );
331
334 else
335 m_solderPasteRatio.SetValue( wxEmptyString );
336
338
340 {
341 default:
342 case ZONE_CONNECTION::INHERITED: m_ZoneConnectionChoice->SetSelection( 0 ); break;
343 case ZONE_CONNECTION::FULL: m_ZoneConnectionChoice->SetSelection( 1 ); break;
344 case ZONE_CONNECTION::THERMAL: m_ZoneConnectionChoice->SetSelection( 2 ); break;
345 case ZONE_CONNECTION::NONE: m_ZoneConnectionChoice->SetSelection( 3 ); break;
346 }
347
348 for( const wxString& group : m_footprint->GetNetTiePadGroups() )
349 {
350 if( !group.IsEmpty() )
351 {
352 m_padGroupsGrid->AppendRows( 1 );
353 m_padGroupsGrid->SetCellValue( m_padGroupsGrid->GetNumberRows() - 1, 0, group );
354 }
355 }
356
358 m_btnCreateJumperPadGroup->Disable();
359 m_btnRemoveJumperPadGroup->Disable();
360
361 // Pad connections tab
362 std::set<wxString> availablePads;
363
364 for( const PAD* pad : m_footprint->Pads() )
365 availablePads.insert( pad->GetNumber() );
366
367 for( const std::set<wxString>& group : m_footprint->JumperPadGroups() )
368 {
369 wxString groupTxt;
370 size_t i = 0;
371
372 for( const wxString& pinNumber : group )
373 {
374 availablePads.erase( pinNumber );
375 groupTxt << pinNumber;
376
377 if( ++i < group.size() )
378 groupTxt << ", ";
379 }
380
381 m_listJumperPadGroups->Append( groupTxt );
382 }
383
384 for( const wxString& pin : availablePads )
385 m_listAvailablePads->AppendString( pin );
386
387 // Items grid
388 for( int col = 0; col < m_itemsGrid->GetNumberCols(); col++ )
389 {
390 // Adjust min size to the column label size
391 m_itemsGrid->SetColMinimalWidth( col, m_itemsGrid->GetVisibleWidth( col, true, false ) );
392 // Adjust the column size.
393 int col_size = m_itemsGrid->GetVisibleWidth( col );
394
395 if( col == PFC_LAYER ) // This one's a drop-down. Check all possible values.
396 {
397 BOARD* board = m_footprint->GetBoard();
398
399 for( PCB_LAYER_ID layer : board->GetEnabledLayers().Seq() )
400 col_size = std::max( col_size, GetTextExtent( board->GetLayerName( layer ) ).x );
401
402 // Swatch and gaps:
403 col_size += KiROUND( 14 * GetDPIScaleFactor() ) + 12;
404 }
405
406 if( m_itemsGrid->IsColShown( col ) )
407 m_itemsGrid->SetColSize( col, col_size );
408 }
409
410 m_itemsGrid->SetRowLabelSize( 0 );
411
412 Layout();
414 m_initialized = true;
415
416 return true;
417}
418
419
421 LIB_ID* doOverwrite )
422{
423 if( aFootprintName.IsEmpty() )
424 {
425 m_delayedErrorMessage = _( "Footprint must have a name." );
426 return false;
427 }
428 else if( !FOOTPRINT::IsLibNameValid( aFootprintName ) )
429 {
430 m_delayedErrorMessage.Printf( _( "Footprint name may not contain '%s'." ),
432 return false;
433 }
434
435 LIB_ID fpID = m_footprint->GetFPID();
436 wxString libraryName = fpID.GetLibNickname();
437 wxString originalFPName = fpID.GetLibItemName();
439
440 if( aFootprintName != originalFPName && tbl->FootprintExists( libraryName, aFootprintName ) )
441 {
442 wxString msg = wxString::Format( _( "Footprint '%s' already exists in library '%s'." ),
443 aFootprintName, libraryName );
444
445 KIDIALOG errorDlg( m_frame, msg, _( "Confirmation" ), wxOK | wxCANCEL | wxICON_WARNING );
446 errorDlg.SetOKLabel( _( "Overwrite" ) );
447
448 if( errorDlg.ShowModal() == wxID_OK )
449 {
450 doOverwrite->SetLibNickname( libraryName );
451 doOverwrite->SetLibItemName( aFootprintName );
452 return true;
453 }
454 }
455
456 return true;
457}
458
459
461{
463 return false;
464
465 if( !DIALOG_SHIM::Validate() )
466 return false;
467
468 // First, test for invalid chars in footprint name
469 wxString footprintName = m_FootprintNameCtrl->GetValue();
470 LIB_ID overwrite;
471
472 if( !checkFootprintName( footprintName, &overwrite ) )
473 {
474 if( m_NoteBook->GetSelection() != 0 )
475 m_NoteBook->SetSelection( 0 );
476
478 m_delayedFocusPage = NOTEBOOK_PAGES::PAGE_GENERAL;
479
480 return false;
481 }
482
483 // Check for valid field text properties
484 for( int i = 0; i < (int) m_fields->size(); ++i )
485 {
486 PCB_FIELD& field = m_fields->at( i );
487
488 // Check for missing field names.
489 if( field.GetName( false ).IsEmpty() )
490 {
492 m_delayedErrorMessage = wxString::Format( _( "Fields must have a name." ) );
495
496 return false;
497 }
498
500 int maxSize = pcbIUScale.mmToIU( TEXT_MAX_SIZE_MM );
501
502 if( field.GetTextWidth() < minSize || field.GetTextWidth() > maxSize )
503 {
505 m_delayedErrorMessage = wxString::Format( _( "The text width must be between %s and %s." ),
507 m_frame->StringFromValue( maxSize, true ) );
510
511 return false;
512 }
513
514 if( field.GetTextHeight() < minSize || field.GetTextHeight() > maxSize )
515 {
517 m_delayedErrorMessage = wxString::Format( _( "The text height must be between %s and %s." ),
519 m_frame->StringFromValue( maxSize, true ) );
522
523 return false;
524 }
525
526 // Test for acceptable values for thickness and size and clamp if fails
527 int maxPenWidth = ClampTextPenSize( field.GetTextThickness(), field.GetTextSize() );
528
529 if( field.GetTextThickness() > maxPenWidth )
530 {
531 m_itemsGrid->SetCellValue( i, PFC_THICKNESS,
532 m_frame->StringFromValue( maxPenWidth, true ) );
533
535 m_delayedErrorMessage = _( "The text thickness is too large for the text size.\n"
536 "It will be clamped." );
539
540 return false;
541 }
542 }
543
544 if( !m_netClearance.Validate( 0, INT_MAX ) )
545 return false;
546
547 if( overwrite.IsValid() )
548 {
549 if( m_frame->DeleteFootprintFromLibrary( overwrite, false /* already confirmed */ ) )
550 m_frame->SyncLibraryTree( true );
551 }
552
553 return true;
554}
555
556
558{
562 {
563 return false;
564 }
565
568 BOARD_COMMIT commit( m_frame );
569 commit.Modify( m_footprint );
570
571 // Must be done inside the commit to capture the undo state
572 // This will call TransferDataToWindow() on the 3D panel and
573 // the embedded files panel.
574 if( !DIALOG_SHIM::TransferDataFromWindow() )
575 return false;
576
577 // Clear out embedded files that are no longer in use
578 std::set<wxString> files;
579 std::set<wxString> files_to_delete;
580
581 // Get the new files from the footprint fields
582 for( const PCB_FIELD& field : *m_fields )
583 {
584 if( field.GetText().StartsWith( FILEEXT::KiCadUriPrefix ) )
585 files.insert( field.GetText() );
586 }
587
588 // Find any files referenced in the old fields that are not in the new fields
589 for( PCB_FIELD* field : m_footprint->GetFields() )
590 {
591 if( field->GetText().StartsWith( FILEEXT::KiCadUriPrefix ) )
592 {
593 if( files.find( field->GetText() ) == files.end() )
594 files_to_delete.insert( field->GetText() );
595 }
596 }
597
598 for( const wxString& file : files_to_delete )
599 {
600 wxString name = file.Mid( FILEEXT::KiCadUriPrefix.size() + 3 ); // Skip "kicad-embed://"
602 }
603
604 LIB_ID fpID = m_footprint->GetFPID();
605 fpID.SetLibItemName( m_FootprintNameCtrl->GetValue() );
606 m_footprint->SetFPID( fpID );
607
609 m_footprint->SetKeywords( m_KeywordCtrl->GetValue() );
610
611 // Update fields
613
614 while( !m_footprint->GetFields().empty() )
615 {
616 PCB_FIELD* existing = m_footprint->GetFields().front();
617 view->Remove( existing );
618 m_footprint->Remove( existing );
619 delete existing;
620 }
621
622 for( PCB_FIELD& field : *m_fields )
623 {
624 PCB_FIELD* newField = field.CloneField();
625 m_footprint->Add( newField );
626 view->Add( newField );
627
628 if( newField->IsSelected() )
629 {
630 // The old copy was in the selection list, but this one is not. Remove the
631 // out-of-sync selection flag so we can re-add the field to the selection.
632 newField->ClearSelected();
633 selectionTool->AddItemToSel( newField, true );
634 }
635 }
636
637 LSET privateLayers;
638
639 for( PCB_LAYER_ID layer : *m_privateLayers )
640 privateLayers.set( layer );
641
642 m_footprint->SetPrivateLayers( privateLayers );
643
644 int attributes = 0;
645
646 switch( m_componentType->GetSelection() )
647 {
648 case 0: attributes |= FP_THROUGH_HOLE; break;
649 case 1: attributes |= FP_SMD; break;
650 default: break;
651 }
652
653 if( m_boardOnly->GetValue() )
654 attributes |= FP_BOARD_ONLY;
655
656 if( m_excludeFromPosFiles->GetValue() )
657 attributes |= FP_EXCLUDE_FROM_POS_FILES;
658
659 if( m_excludeFromBOM->GetValue() )
660 attributes |= FP_EXCLUDE_FROM_BOM;
661
662 if( m_noCourtyards->GetValue() )
663 attributes |= FP_ALLOW_MISSING_COURTYARD;
664
665 if( m_cbDNP->GetValue() )
666 attributes |= FP_DNP;
667
668 if( m_allowBridges->GetValue() )
669 attributes |= FP_ALLOW_SOLDERMASK_BRIDGES;
670
671 m_footprint->SetAttributes( attributes );
672
673 // Initialize mask clearances
674 if( m_netClearance.IsNull() )
676 else
678
679 if( m_solderMask.IsNull() )
681 else
683
684 if( m_solderPaste.IsNull() )
686 else
688
691 else
693
694 switch( m_ZoneConnectionChoice->GetSelection() )
695 {
696 default:
697 case 0: m_footprint->SetLocalZoneConnection( ZONE_CONNECTION::INHERITED ); break;
698 case 1: m_footprint->SetLocalZoneConnection( ZONE_CONNECTION::FULL ); break;
699 case 2: m_footprint->SetLocalZoneConnection( ZONE_CONNECTION::THERMAL ); break;
700 case 3: m_footprint->SetLocalZoneConnection( ZONE_CONNECTION::NONE ); break;
701 }
702
704
705 for( int ii = 0; ii < m_padGroupsGrid->GetNumberRows(); ++ii )
706 {
707 wxString group = m_padGroupsGrid->GetCellValue( ii, 0 );
708
709 if( !group.IsEmpty() )
711 }
712
714
715 std::vector<std::set<wxString>>& jumpers = m_footprint->JumperPadGroups();
716 jumpers.clear();
717
718 for( unsigned i = 0; i < m_listJumperPadGroups->GetCount(); ++i )
719 {
720 wxStringTokenizer tokenizer( m_listJumperPadGroups->GetString( i ), ", " );
721 std::set<wxString>& group = jumpers.emplace_back();
722
723 while( tokenizer.HasMoreTokens() )
724 {
725 if( wxString token = tokenizer.GetNextToken(); !token.IsEmpty() )
726 group.insert( token );
727 }
728 }
729
730 // Copy the models from the panel to the footprint
731 std::vector<FP_3DMODEL>& panelList = m_3dPanel->GetModelList();
732 std::vector<FP_3DMODEL>* fpList = &m_footprint->Models();
733 fpList->clear();
734 fpList->insert( fpList->end(), panelList.begin(), panelList.end() );
735
736 commit.Push( _( "Edit Footprint Properties" ) );
737
738 return true;
739}
740
741
743{
745 return;
746
747 const BOARD_DESIGN_SETTINGS& dsnSettings = m_frame->GetDesignSettings();
748
749 PCB_FIELD newField( m_footprint, FIELD_T::USER,
751
752 // Set active layer if legal; otherwise copy layer from previous text item
754 newField.SetLayer( m_frame->GetActiveLayer() );
755 else
756 newField.SetLayer( m_fields->at( m_fields->size() - 1 ).GetLayer() );
757
758 newField.SetTextSize( dsnSettings.GetTextSize( newField.GetLayer() ) );
759 newField.SetTextThickness( dsnSettings.GetTextThickness( newField.GetLayer() ) );
760 newField.SetItalic( dsnSettings.GetTextItalic( newField.GetLayer() ) );
761
762 m_fields->push_back( newField );
763
764 // notify the grid
765 wxGridTableMessage msg( m_fields, wxGRIDTABLE_NOTIFY_ROWS_APPENDED, 1 );
766 m_itemsGrid->ProcessTableMessage( msg );
767
768 m_itemsGrid->SetFocus();
769 m_itemsGrid->MakeCellVisible( (int) m_fields->size() - 1, 0 );
770 m_itemsGrid->SetGridCursor( (int) m_fields->size() - 1, 0 );
771
772 m_itemsGrid->EnableCellEditControl( true );
773 m_itemsGrid->ShowCellEditControl();
774
775 OnModify();
776}
777
778
780{
782 return;
783
784 wxArrayInt selectedRows = m_itemsGrid->GetSelectedRows();
785
786 if( selectedRows.empty() && m_itemsGrid->GetGridCursorRow() >= 0 )
787 selectedRows.push_back( m_itemsGrid->GetGridCursorRow() );
788
789 if( selectedRows.empty() )
790 return;
791
792 for( int row : selectedRows )
793 {
794 if( row < m_fields->GetMandatoryRowCount() )
795 {
796 DisplayError( this, wxString::Format( _( "The first %d fields are mandatory." ),
798 return;
799 }
800 }
801
802 m_itemsGrid->CommitPendingChanges( true /* quiet mode */ );
803 m_itemsGrid->ClearSelection();
804
805 // Reverse sort so deleting a row doesn't change the indexes of the other rows.
806 selectedRows.Sort( []( int* first, int* second )
807 {
808 return *second - *first;
809 } );
810
811 for( int row : selectedRows )
812 {
813 m_fields->erase( m_fields->begin() + row );
814
815 // notify the grid
816 wxGridTableMessage msg( m_fields, wxGRIDTABLE_NOTIFY_ROWS_DELETED, row, 1 );
817 m_itemsGrid->ProcessTableMessage( msg );
818
819 if( m_itemsGrid->GetNumberRows() > 0 )
820 {
821 m_itemsGrid->MakeCellVisible( std::max( 0, row-1 ), m_itemsGrid->GetGridCursorCol() );
822 m_itemsGrid->SetGridCursor( std::max( 0, row-1 ), m_itemsGrid->GetGridCursorCol() );
823 }
824 }
825
826 OnModify();
827}
828
829
831{
833 return;
834
835 PCB_LAYER_ID nextLayer = User_1;
836
837 while( alg::contains( *m_privateLayers, nextLayer ) && nextLayer < User_45 )
838 nextLayer = ToLAYER_ID( nextLayer + 1 );
839
840 m_privateLayers->push_back( nextLayer );
841
842 // notify the grid
843 wxGridTableMessage msg( m_privateLayers, wxGRIDTABLE_NOTIFY_ROWS_APPENDED, 1 );
844 m_privateLayersGrid->ProcessTableMessage( msg );
845
846 m_privateLayersGrid->SetFocus();
847 m_privateLayersGrid->MakeCellVisible( (int) m_privateLayers->size() - 1, 0 );
848 m_privateLayersGrid->SetGridCursor( (int) m_privateLayers->size() - 1, 0 );
849
850 OnModify();
851}
852
853
855{
857 return;
858
859 int curRow = m_privateLayersGrid->GetGridCursorRow();
860
861 if( curRow < 0 )
862 return;
863
864 m_privateLayers->erase( m_privateLayers->begin() + curRow );
865
866 // notify the grid
867 wxGridTableMessage msg( m_privateLayers, wxGRIDTABLE_NOTIFY_ROWS_DELETED, curRow, 1 );
868 m_privateLayersGrid->ProcessTableMessage( msg );
869
870 if( m_privateLayersGrid->GetNumberRows() > 0 )
871 {
872 m_privateLayersGrid->MakeCellVisible( std::max( 0, curRow-1 ),
873 m_privateLayersGrid->GetGridCursorCol() );
874 m_privateLayersGrid->SetGridCursor( std::max( 0, curRow-1 ),
875 m_privateLayersGrid->GetGridCursorCol() );
876 }
877
878 OnModify();
879}
880
881
883{
885 return;
886
887 m_padGroupsGrid->AppendRows( 1 );
888
889 m_padGroupsGrid->SetFocus();
890 m_padGroupsGrid->MakeCellVisible( m_padGroupsGrid->GetNumberRows() - 1, 0 );
891 m_padGroupsGrid->SetGridCursor( m_padGroupsGrid->GetNumberRows() - 1, 0 );
892
893 m_padGroupsGrid->EnableCellEditControl( true );
894 m_padGroupsGrid->ShowCellEditControl();
895
896 OnModify();
897}
898
899
901{
903 return;
904
905 wxArrayInt selectedRows = m_padGroupsGrid->GetSelectedRows();
906 int curRow = m_padGroupsGrid->GetGridCursorRow();
907
908 if( selectedRows.empty() && curRow >= 0 && curRow < m_padGroupsGrid->GetNumberRows() )
909 selectedRows.Add( curRow );
910
911 for( int ii = (int) selectedRows.Count() - 1; ii >= 0; --ii )
912 {
913 int row = selectedRows.Item( ii );
914 m_padGroupsGrid->DeleteRows( row, 1 );
915 curRow = std::min( curRow, row );
916 }
917
918 curRow = std::max( 0, curRow - 1 );
919 m_padGroupsGrid->MakeCellVisible( curRow, m_padGroupsGrid->GetGridCursorCol() );
920 m_padGroupsGrid->SetGridCursor( curRow, m_padGroupsGrid->GetGridCursorCol() );
921
922 OnModify();
923}
924
925
927{
928 // Account for scroll bars
930
931 itemsWidth -= m_itemsGrid->GetRowLabelSize();
932
933 for( int i = 0; i < m_itemsGrid->GetNumberCols(); i++ )
934 {
935 if( i == 1 )
936 continue;
937
938 itemsWidth -= m_itemsGrid->GetColSize( i );
939 }
940
941 m_itemsGrid->SetColSize(
942 1, std::max( itemsWidth, m_itemsGrid->GetVisibleWidth( 0, true, false ) ) );
943
944 // Update the width private layers grid
945 m_privateLayersGrid->SetColSize( 0, std::max( m_privateLayersGrid->GetClientSize().x,
947
948 // Update the width net tie pad groups grid
949 m_padGroupsGrid->SetColSize( 0, std::max( m_padGroupsGrid->GetClientSize().x,
951
952 // Update the width of the 3D panel
954}
955
956
958{
959 // Handle a delayed focus. The delay allows us to:
960 // a) change focus when the error was triggered from within a killFocus handler
961 // b) show the correct notebook page in the background before the error dialog comes up
962 // when triggered from an OK or a notebook page change
963
964 if( static_cast<int>( m_delayedFocusPage ) >= 0 )
965 {
966 if( m_NoteBook->GetSelection() != static_cast<int>( m_delayedFocusPage ) )
967 m_NoteBook->ChangeSelection( static_cast<int>( m_delayedFocusPage ) );
968
969 m_delayedFocusPage = NOTEBOOK_PAGES::PAGE_UNKNOWN;
970 }
971
972 if( !m_delayedErrorMessage.IsEmpty() )
973 {
974 // We will re-enter this routine when the error dialog is displayed, so make
975 // sure we don't keep putting up more dialogs.
976 wxString msg = m_delayedErrorMessage;
977 m_delayedErrorMessage = wxEmptyString;
978
979 // Do not use DisplayErrorMessage(); it screws up window order on Mac
980 DisplayError( nullptr, msg );
981 }
982
984 {
985 m_delayedFocusCtrl->SetFocus();
986
987 if( wxTextEntry* textEntry = dynamic_cast<wxTextEntry*>( m_delayedFocusCtrl ) )
988 textEntry->SelectAll();
989
990 m_delayedFocusCtrl = nullptr;
991 }
992 else if( m_delayedFocusGrid )
993 {
994 m_delayedFocusGrid->SetFocus();
997
998 if( !( m_delayedFocusColumn == 0 && m_delayedFocusRow < m_fields->GetMandatoryRowCount() ) )
999 m_delayedFocusGrid->EnableCellEditControl( true );
1000
1001 m_delayedFocusGrid->ShowCellEditControl();
1002
1003 m_delayedFocusGrid = nullptr;
1004 m_delayedFocusRow = -1;
1006 }
1007}
1008
1009
1011{
1012 wxSize new_size = aEvent.GetSize();
1013
1014 if( ( !m_itemsGrid->IsCellEditControlShown() || m_lastRequestedSize != new_size )
1015 && m_gridSize != new_size )
1016 {
1017 m_gridSize = new_size;
1018
1019 // A trick to fix a cosmetic issue: when, in m_itemsGrid, a layer selector widget has
1020 // the focus (is activated in column 6) when resizing the grid, the widget is not moved.
1021 // So just change the widget having the focus in this case
1022 if( m_NoteBook->GetSelection() == 0 && !m_itemsGrid->HasFocus() )
1023 {
1024 int col = m_itemsGrid->GetGridCursorCol();
1025
1026 if( col == 6 ) // a layer selector widget can be activated
1027 m_itemsGrid->SetFocus();
1028 }
1029
1031 }
1032
1033 // We store this value to check whether the dialog is changing size. This might indicate
1034 // that the user is scaling the dialog with an editor shown. Some editors do not close
1035 // (at least on GTK) when the user drags a dialog corner
1036 m_lastRequestedSize = new_size;
1037
1038 // Always propagate for a grid repaint (needed if the height changes, as well as width)
1039 aEvent.Skip();
1040}
1041
1042
1044{
1046 aEvent.Veto();
1047
1049 aEvent.Veto();
1050}
1051
1052
1054{
1055 if( m_initialized )
1056 OnModify();
1057}
1058
1059
1061{
1062 if( m_initialized )
1063 OnModify();
1064}
1065
1066
1068{
1069 if( m_initialized )
1070 OnModify();
1071}
1072
1073
1075{
1076 wxArrayInt selections;
1077 int n = m_listAvailablePads->GetSelections( selections );
1078 wxCHECK( n > 0, /* void */ );
1079
1080 m_listJumperPadGroups->Freeze();
1081 m_listAvailablePads->Freeze();
1082
1083 wxString group;
1084 int i = 0;
1085
1086 for( int idx : selections )
1087 {
1088 group << m_listAvailablePads->GetString( idx );
1089
1090 if( ++i < n )
1091 group << ", ";
1092 }
1093
1094 for( int idx = selections.size() - 1; idx >= 0; --idx )
1095 m_listAvailablePads->Delete( selections[idx] );
1096
1097 m_listJumperPadGroups->AppendString( group );
1098
1099 m_listJumperPadGroups->Thaw();
1100 m_listAvailablePads->Thaw();
1101}
1102
1103
1105{
1106 wxArrayInt selections;
1107 int n = m_listJumperPadGroups->GetSelections( selections );
1108 wxCHECK( n > 0, /* void */ );
1109
1110 m_listJumperPadGroups->Freeze();
1111 m_listAvailablePads->Freeze();
1112
1113 for( int idx : selections )
1114 {
1115 wxStringTokenizer tokenizer( m_listJumperPadGroups->GetString( idx ), ", " );
1116
1117 while( tokenizer.HasMoreTokens() )
1118 {
1119 if( wxString token = tokenizer.GetNextToken(); !token.IsEmpty() )
1120 m_listAvailablePads->AppendString( token );
1121 }
1122 }
1123
1124 for( int idx = selections.size() - 1; idx >= 0; --idx )
1125 m_listJumperPadGroups->Delete( selections[idx] );
1126
1127 m_listJumperPadGroups->Thaw();
1128 m_listAvailablePads->Thaw();
1129}
1130
1131
1133{
1134 wxArrayInt selections;
1135 int n = m_listJumperPadGroups->GetSelections( selections );
1136 m_btnRemoveJumperPadGroup->Enable( n > 0 );
1137}
1138
1139
1141{
1142 wxArrayInt selections;
1143 int n = m_listJumperPadGroups->GetSelections( selections );
1144 m_btnCreateJumperPadGroup->Enable( n > 0 );
1145}
const char * name
Definition: DXF_plotter.cpp:59
constexpr EDA_IU_SCALE pcbIUScale
Definition: base_units.h:108
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
Definition: bitmap.cpp:104
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
Definition: bitmap.cpp:110
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
Definition: box2.h:990
static TOOL_ACTION selectionClear
Clear the current selection.
Definition: actions.h:220
BASE_SET & set(size_t pos)
Definition: base_set.h:116
Container for design settings for a BOARD object.
int GetTextThickness(PCB_LAYER_ID aLayer) const
Return the default text thickness from the layer class for the given layer.
bool GetTextItalic(PCB_LAYER_ID aLayer) const
VECTOR2I GetTextSize(PCB_LAYER_ID aLayer) const
Return the default text size from the layer class for the given layer.
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Definition: board_item.h:229
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
Definition: board_item.h:280
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
Definition: board_item.cpp:48
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:297
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
Definition: board.cpp:614
const LSET & GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
Definition: board.cpp:829
Class DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR_BASE.
void OnBtnCreateJumperPadGroup(wxCommandEvent &event) override
void OnBtnRemoveJumperPadGroup(wxCommandEvent &event) override
DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR(FOOTPRINT_EDIT_FRAME *aParent, FOOTPRINT *aFootprint)
bool checkFootprintName(const wxString &aFootprintName, LIB_ID *doOverwrite)
void SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
Definition: dialog_shim.h:66
void SetupStandardButtons(std::map< int, wxString > aLabels={})
void OnModify()
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
void ClearSelected()
Definition: eda_item.h:130
bool IsSelected() const
Definition: eda_item.h:120
int GetTextHeight() const
Definition: eda_text.h:254
void SetTextSize(VECTOR2I aNewSize, bool aEnforceMinTextSize=true)
Definition: eda_text.cpp:526
int GetTextWidth() const
Definition: eda_text.h:251
void SetTextThickness(int aWidth)
The TextThickness is that set by the user.
Definition: eda_text.cpp:284
int GetTextThickness() const
Definition: eda_text.h:126
void SetItalic(bool aItalic)
Set the text to be italic - this will also update the font if needed.
Definition: eda_text.cpp:300
VECTOR2I GetTextSize() const
Definition: eda_text.h:248
void RemoveFile(const wxString &name, bool aErase=true)
Remove a file from the collection and frees the memory.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const override
Return the BOARD_DESIGN_SETTINGS for the open project.
void SyncLibraryTree(bool aProgress)
Synchronize the footprint library tree to the current state of the footprint library table.
bool DeleteFootprintFromLibrary(const LIB_ID &aFPID, bool aConfirm)
Delete the given footprint from its library.
FOOTPRINT_EDITOR_SETTINGS * GetSettings()
Provide a custom wxValidator object for limiting the allowable characters when defining footprint nam...
Definition: validators.h:53
bool GetDuplicatePadNumbersAreJumpers() const
Definition: footprint.h:820
void SetFPID(const LIB_ID &aFPID)
Definition: footprint.h:254
wxString GetLibDescription() const
Definition: footprint.h:262
ZONE_CONNECTION GetLocalZoneConnection() const
Definition: footprint.h:293
void Remove(BOARD_ITEM *aItem, REMOVE_MODE aMode=REMOVE_MODE::NORMAL) override
Removes an item from the container.
Definition: footprint.cpp:1130
static bool IsLibNameValid(const wxString &aName)
Test for validity of a name of a footprint to be used in a footprint library ( no spaces,...
Definition: footprint.cpp:2330
void SetLocalSolderPasteMarginRatio(std::optional< double > aRatio)
Definition: footprint.h:290
void SetKeywords(const wxString &aKeywords)
Definition: footprint.h:266
void SetAttributes(int aAttributes)
Definition: footprint.h:296
std::optional< int > GetLocalSolderPasteMargin() const
Definition: footprint.h:286
std::optional< int > GetLocalClearance() const
Definition: footprint.h:280
std::vector< std::set< wxString > > & JumperPadGroups()
Each jumper pad group is a set of pad numbers that should be treated as internally connected.
Definition: footprint.h:827
void SetDuplicatePadNumbersAreJumpers(bool aEnabled)
Definition: footprint.h:821
std::deque< PAD * > & Pads()
Definition: footprint.h:211
int GetAttributes() const
Definition: footprint.h:295
void SetLocalZoneConnection(ZONE_CONNECTION aType)
Definition: footprint.h:292
void ClearNetTiePadGroups()
Definition: footprint.h:346
LSET GetPrivateLayers() const
Definition: footprint.h:151
const std::vector< wxString > & GetNetTiePadGroups() const
Definition: footprint.h:344
const LIB_ID & GetFPID() const
Definition: footprint.h:253
void AddNetTiePadGroup(const wxString &aGroup)
Definition: footprint.h:351
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false) override
Removes an item from the container.
Definition: footprint.cpp:1069
std::optional< double > GetLocalSolderPasteMarginRatio() const
Definition: footprint.h:289
void GetFields(std::vector< PCB_FIELD * > &aVector, bool aVisibleOnly) const
Populate a std::vector with PCB_TEXTs.
Definition: footprint.cpp:627
std::vector< FP_3DMODEL > & Models()
Definition: footprint.h:225
static const wxChar * StringLibNameInvalidChars(bool aUserReadable)
Test for validity of the name in a library of the footprint ( no spaces, dir separators ....
Definition: footprint.cpp:2341
void SetLibDescription(const wxString &aDesc)
Definition: footprint.h:263
void SetLocalSolderMaskMargin(std::optional< int > aMargin)
Definition: footprint.h:284
void SetLocalClearance(std::optional< int > aClearance)
Definition: footprint.h:281
void SetPrivateLayers(const LSET &aLayers)
Adds an item to the container.
Definition: footprint.h:152
std::optional< int > GetLocalSolderMaskMargin() const
Definition: footprint.h:283
void SetLocalSolderPasteMargin(std::optional< int > aMargin)
Definition: footprint.h:287
wxString GetKeywords() const
Definition: footprint.h:265
bool FootprintExists(const wxString &aNickname, const wxString &aFootprintName)
Indicates whether or not the given footprint already exists in the given library.
Add mouse and command handling (such as cut, copy, and paste) to a WX_GRID instance.
Definition: grid_tricks.h:61
Helper class to create more flexible dialogs, including 'do not show again' checkbox handling.
Definition: kidialog.h:43
int ShowModal() override
Definition: kidialog.cpp:95
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1) override
Add a VIEW_ITEM to the view.
Definition: pcb_view.cpp:57
virtual void Remove(VIEW_ITEM *aItem) override
Remove a VIEW_ITEM from the view.
Definition: pcb_view.cpp:74
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:49
int SetLibItemName(const UTF8 &aLibItemName)
Override the library item name portion of the LIB_ID to aLibItemName.
Definition: lib_id.cpp:111
bool IsValid() const
Check if this LID_ID is valid.
Definition: lib_id.h:172
int SetLibNickname(const UTF8 &aLibNickname)
Override the logical library name portion of the LIB_ID to aLibNickname.
Definition: lib_id.cpp:100
const UTF8 & GetLibItemName() const
Definition: lib_id.h:102
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Definition: lib_id.h:87
LSET is a set of PCB_LAYER_IDs.
Definition: lset.h:37
LSEQ UIOrder() const
Return the copper, technical and user layers in the order shown in layer widget.
Definition: lset.cpp:736
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:583
LSEQ Seq(const LSEQ &aSequence) const
Return an LSEQ from the union of this LSET and a desired sequence.
Definition: lset.cpp:297
static const LSET & AllTechMask()
Return a mask holding all technical layers (no CU layer) on both side.
Definition: lset.cpp:662
Definition: pad.h:54
EMBEDDED_FILES * GetLocalFiles()
bool TransferDataToWindow() override
std::vector< FP_3DMODEL > & GetModelList()
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
virtual PCB_LAYER_ID GetActiveLayer() const
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
BOARD * GetBoard() const
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
wxString GetName(bool aUseDefaultName=true) const
Return the field name (not translated).
Definition: pcb_field.cpp:100
PCB_FIELD * CloneField() const
Same as Clone, but returns a PCB_FIELD item.
Definition: pcb_field.h:92
The selection tool: currently supports:
wxString GetValue(int aRow, int aCol) override
bool CanGetValueAs(int aRow, int aCol, const wxString &aTypeName) override
long GetValueAsLong(int aRow, int aCol) override
bool CanSetValueAs(int aRow, int aCol, const wxString &aTypeName) override
wxGridCellAttr * GetAttr(int aRow, int aCol, wxGridCellAttr::wxAttrKind aKind) override
void SetValue(int aRow, int aCol, const wxString &aValue) override
void SetValueAsLong(int aRow, int aCol, long aValue) override
static FP_LIB_TABLE * PcbFootprintLibs(PROJECT *aProject)
Return the table of footprint libraries without Kiway.
Definition: project_pcb.cpp:37
int AddItemToSel(const TOOL_EVENT &aEvent)
void SetBitmap(const wxBitmapBundle &aBmp)
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
Definition: tools_holder.h:55
bool RunAction(const std::string &aActionName, T aParam)
Run the specified action immediately, pausing the current action to run the new one.
Definition: tool_manager.h:150
wxString StringFromValue(double aValue, bool aAddUnitLabel=false, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
Converts aValue in internal units into a united string.
virtual long long int GetValue()
Return the current value in Internal Units.
virtual void SetUnits(EDA_UNITS aUnits)
Normally not needed (as the UNIT_BINDER inherits from the parent frame), but can be used to set to DE...
virtual void SetNegativeZero()
Definition: unit_binder.h:73
virtual double GetDoubleValue()
Return the current value in Internal Units.
virtual void SetDoubleValue(double aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
virtual bool Validate(double aMin, double aMax, EDA_UNITS aUnits=EDA_UNITS::UNSCALED)
Validate the control against the given range, informing the user of any errors found.
virtual void SetValue(long long int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
bool IsNull() const
Return true if the control holds no value (ie: empty string, not 0).
wxGridCellAttr * enhanceAttr(wxGridCellAttr *aInputAttr, int aRow, int aCol, wxGridCellAttr::wxAttrKind aKind)
Definition: wx_grid.cpp:45
int GetVisibleWidth(int aCol, bool aHeader=true, bool aContents=true, bool aKeep=false)
Calculate the specified column based on the actual size of the text on screen.
Definition: wx_grid.cpp:776
void ShowHideColumns(const wxString &shownColumns)
Show/hide the grid columns based on a tokenized string of shown column indexes.
Definition: wx_grid.cpp:494
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
void DestroyTable(wxGridTableBase *aTable)
Work-around for a bug in wxGrid which crashes when deleting the table if the cell edit control was no...
Definition: wx_grid.cpp:449
wxString GetShownColumnsAsString()
Get a tokenized string containing the shown column indexes.
Definition: wx_grid.cpp:464
bool CommitPendingChanges(bool aQuietMode=false)
Close any open cell edit controls.
Definition: wx_grid.cpp:644
void DisplayError(wxWindow *aParent, const wxString &aText)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:170
This file is part of the common library.
const int minSize
Push and Shove router track width and via size dialog.
#define _(s)
Declaration of the eda_3d_viewer class.
#define TEXT_MIN_SIZE_MM
Minimum text size (1 micron).
Definition: eda_text.h:47
#define TEXT_MAX_SIZE_MM
Maximum text size in mm (~10 inches)
Definition: eda_text.h:48
@ FP_SMD
Definition: footprint.h:81
@ FP_DNP
Definition: footprint.h:88
@ FP_ALLOW_MISSING_COURTYARD
Definition: footprint.h:87
@ FP_EXCLUDE_FROM_POS_FILES
Definition: footprint.h:82
@ FP_BOARD_ONLY
Definition: footprint.h:84
@ FP_EXCLUDE_FROM_BOM
Definition: footprint.h:83
@ FP_THROUGH_HOLE
Definition: footprint.h:80
@ FP_ALLOW_SOLDERMASK_BRIDGES
Definition: footprint.h:86
int ClampTextPenSize(int aPenSize, int aSize, bool aStrict)
Pen width should not allow characters to become cluttered up in their own fatness.
Definition: gr_text.cpp:72
static const std::string KiCadUriPrefix
This file is part of the common library.
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
@ User_1
Definition: layer_ids.h:124
PCB_LAYER_ID ToLAYER_ID(int aLayer)
Definition: lset.cpp:747
wxSize GetUnobscuredSize(const wxWindow *aWindow)
Tries to determine the size of the viewport of a scrollable widget (wxDataViewCtrl,...
Definition: wxgtk/ui.cpp:252
KICOMMON_API wxFont GetInfoFont(wxWindow *aWindow)
Definition: ui_common.cpp:156
bool contains(const _Container &__container, _Value __value)
Returns true if the container contains the given value.
Definition: kicad_algo.h:100
@ PFC_HEIGHT
@ PFC_THICKNESS
see class PGM_BASE
wxString UnescapeString(const wxString &aSource)
wxString EscapeString(const wxString &aSource, ESCAPE_CONTEXT aContext)
The Escape/Unescape routines use HTML-entity-reference-style encoding to handle characters which are:...
@ CTX_LINE
Definition: string_utils.h:59
constexpr int mmToIU(double mm) const
Definition: base_units.h:88
wxString GetUserFieldName(int aFieldNdx, bool aTranslateForHI)
#define DO_TRANSLATE
Custom text control validator definitions.