KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_footprint_properties.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) 2016 Mario Luzeiro <[email protected]>
5 * Copyright (C) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr
6 * Copyright (C) 2015 Dick Hollenbeck, [email protected]
7 * Copyright (C) 2004-2023 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
28#include <bitmaps.h>
29#include <board_commit.h>
31#include <footprint.h>
32#include <confirm.h>
34#include <filename_resolver.h>
35#include <pcb_edit_frame.h>
36#include <pcbnew_settings.h>
37#include <pgm_base.h>
38#include <project_pcb.h>
39#include <kiplatform/ui.h>
48
49
50int DIALOG_FOOTPRINT_PROPERTIES::m_page = 0; // remember the last open page during session
51
52
54 FOOTPRINT* aFootprint ) :
56 m_frame( aParent ),
57 m_footprint( aFootprint ),
58 m_posX( aParent, m_XPosLabel, m_ModPositionX, m_XPosUnit ),
59 m_posY( aParent, m_YPosLabel, m_ModPositionY, m_YPosUnit ),
60 m_orientation( aParent, m_orientationLabel, m_orientationCtrl, nullptr ),
61 m_netClearance( aParent, m_NetClearanceLabel, m_NetClearanceCtrl, m_NetClearanceUnits ),
62 m_solderMask( aParent, m_SolderMaskMarginLabel, m_SolderMaskMarginCtrl,
63 m_SolderMaskMarginUnits ),
64 m_solderPaste( aParent, m_SolderPasteMarginLabel, m_SolderPasteMarginCtrl,
65 m_SolderPasteMarginUnits ),
66 m_solderPasteRatio( aParent, m_PasteMarginRatioLabel, m_PasteMarginRatioCtrl,
67 m_PasteMarginRatioUnits ),
68 m_returnValue( FP_PROPS_CANCEL ),
69 m_initialized( false ),
70 m_gridSize( 0, 0 ),
71 m_lastRequestedSize( 0, 0 )
72{
73 // Create the 3D models page
75 m_NoteBook->AddPage( m_3dPanel, _("3D Models"), false );
76
77 // Configure display origin transforms
80
81 m_fields = new FP_TEXT_GRID_TABLE( m_frame, this );
82
83 m_delayedErrorMessage = wxEmptyString;
84 m_delayedFocusGrid = nullptr;
87 m_initialFocus = false;
88
89 // Give an icon
90 wxIcon icon;
91 icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_modedit ) );
92 SetIcon( icon );
93
94 // Give a bit more room for combobox editors
95 m_itemsGrid->SetDefaultRowSize( m_itemsGrid->GetDefaultRowSize() + 4 );
96
98 m_itemsGrid->PushEventHandler( new GRID_TRICKS( m_itemsGrid ) );
99
100 // Show/hide text item columns according to the user's preference
102 m_itemsGrid->ShowHideColumns( cfg->m_FootprintTextShownColumns );
103
104 m_orientation.SetUnits( EDA_UNITS::DEGREES );
106
107 // Set predefined rotations in combo dropdown, according to the locale floating point
108 // separator notation
109 double rot_list[] = { 0.0, 90.0, -90.0, 180.0 };
110
111 for( size_t ii = 0; ii < m_orientationCtrl->GetCount() && ii < 4; ++ii )
112 m_orientationCtrl->SetString( ii, wxString::Format( "%.1f", rot_list[ii] ) );
113
114 // Set font size for items showing long strings:
115 wxFont infoFont = KIUI::GetInfoFont( this );
116 m_libraryIDLabel->SetFont( infoFont );
117 m_tcLibraryID->SetFont( infoFont );
118
119 infoFont.SetStyle( wxFONTSTYLE_ITALIC );
120 m_staticTextInfoCopper->SetFont( infoFont );
121 m_staticTextInfoPaste->SetFont( infoFont );
122
123 m_NoteBook->SetSelection( m_page );
124
125 if( m_page == 0 )
126 {
130 }
131 else if( m_page == 1 )
132 {
134 }
135
137
138 m_solderPasteRatio.SetUnits( EDA_UNITS::PERCENT );
140
141 // Configure button logos
142 m_bpAdd->SetBitmap( KiBitmapBundle( BITMAPS::small_plus ) );
143 m_bpDelete->SetBitmap( KiBitmapBundle( BITMAPS::small_trash ) );
144
145 m_tcLibraryID->SetBackgroundColour( KIPLATFORM::UI::GetDialogBGColour() );
146
147 // We can't set the tab order through wxWidgets due to shortcomings in their mnemonics
148 // implementation on MSW
149 m_tabOrder = {
161 m_cbDNP,
168 };
169
171
173 m_initialized = true;
174}
175
176
178{
179 PCBNEW_SETTINGS* cfg = nullptr;
180
181 try
182 {
183 cfg = m_frame->GetPcbNewSettings();
184 }
185 catch( const std::runtime_error& e )
186 {
187 wxFAIL_MSG( e.what() );
188 }
189
190 if( cfg )
191 {
193 }
194
195 // Prevents crash bug in wxGrid's d'tor
197
198 // Delete the GRID_TRICKS.
199 m_itemsGrid->PopEventHandler( true );
200
201 // free the memory used by all models, otherwise models which were
202 // browsed but not used would consume memory
204
205 // the GL canvas has to be visible before it is destroyed
206 m_page = m_NoteBook->GetSelection();
207 m_NoteBook->SetSelection( 1 );
208}
209
210
212{
214 {
216 Close();
217 }
218}
219
220
222{
224 {
226 Close();
227 }
228}
229
230
232{
234 {
236 Close();
237 }
238}
239
240
242{
244 {
246 Close();
247 }
248}
249
250
252{
253 if( !wxDialog::TransferDataToWindow() )
254 return false;
255
256 if( !m_PanelGeneral->TransferDataToWindow() )
257 return false;
258
259 // Add the models to the panel
261 return false;
262
263 // Footprint Fields
264 for( PCB_FIELD* field : m_footprint->GetFields() )
265 m_fields->push_back( field );
266
267 // notify the grid
268 wxGridTableMessage tmsg( m_fields, wxGRIDTABLE_NOTIFY_ROWS_APPENDED,
270 m_itemsGrid->ProcessTableMessage( tmsg );
271
272 // Footprint Properties
273
276
277 m_BoardSideCtrl->SetSelection( (m_footprint->GetLayer() == B_Cu) ? 1 : 0 );
278
279 EDA_ANGLE orientation = m_footprint->GetOrientation();
281
282 m_cbLocked->SetValue( m_footprint->IsLocked() );
283 m_cbLocked->SetToolTip( _( "Locked footprints cannot be freely moved and oriented on the "
284 "canvas and can only be selected when the 'Locked items' checkbox "
285 "is checked in the selection filter." ) );
286
288 m_componentType->SetSelection( 0 );
289 else if( m_footprint->GetAttributes() & FP_SMD )
290 m_componentType->SetSelection( 1 );
291 else
292 m_componentType->SetSelection( 2 );
293
298 m_cbDNP->SetValue( m_footprint->GetAttributes() & FP_DNP );
299
300 // Local Clearances
301
307
308 switch( m_footprint->GetZoneConnection() )
309 {
310 default:
311 case ZONE_CONNECTION::INHERITED: m_ZoneConnectionChoice->SetSelection( 0 ); break;
312 case ZONE_CONNECTION::FULL: m_ZoneConnectionChoice->SetSelection( 1 ); break;
313 case ZONE_CONNECTION::THERMAL: m_ZoneConnectionChoice->SetSelection( 2 ); break;
314 case ZONE_CONNECTION::NONE: m_ZoneConnectionChoice->SetSelection( 3 ); break;
315 }
316
317 // Show the footprint's FPID.
318 m_tcLibraryID->SetValue( m_footprint->GetFPID().Format() );
319
320 for( int col = 0; col < m_itemsGrid->GetNumberCols(); col++ )
321 {
322 m_itemsGrid->SetColMinimalWidth( col, m_itemsGrid->GetVisibleWidth( col, true, false ) );
323
324 // Adjust the column size.
325 int col_size = m_itemsGrid->GetVisibleWidth( col );
326
327 if( col == FPT_LAYER ) // This one's a drop-down. Check all possible values.
328 {
329 BOARD* board = m_footprint->GetBoard();
330
331 for( PCB_LAYER_ID layer : board->GetEnabledLayers().Seq() )
332 col_size = std::max( col_size, GetTextExtent( board->GetLayerName( layer ) ).x );
333
334 // And the swatch:
335 col_size += 20;
336 }
337
338 if( m_itemsGrid->IsColShown( col ) )
339 m_itemsGrid->SetColSize( col, col_size );
340 }
341
342 m_itemsGrid->SetRowLabelSize( 0 );
343
344 Layout();
346
347 return true;
348}
349
350
352{
354 return false;
355
356 if( !DIALOG_SHIM::Validate() )
357 return false;
358
359 // Validate texts.
360 for( size_t i = 0; i < m_fields->size(); ++i )
361 {
362 PCB_FIELD* field = m_fields->at( i );
363
364 // Check for missing field names.
365 if( field->GetName( false ).IsEmpty() )
366 {
368 m_delayedErrorMessage = wxString::Format( _( "Fields must have a name." ) );
371
372 return false;
373 }
374
376 int maxSize = pcbIUScale.MilsToIU( TEXT_MAX_SIZE_MILS );
377 int width = m_frame->ValueFromString( m_itemsGrid->GetCellValue( i, FPT_WIDTH ) );
378 int height = m_frame->ValueFromString( m_itemsGrid->GetCellValue( i, FPT_HEIGHT ) );
379
380 if( width < minSize )
381 {
382 wxString min = m_frame->StringFromValue( minSize, true );
383
384 m_itemsGrid->SetCellValue( i, FPT_WIDTH, min );
385
387 m_delayedErrorMessage = wxString::Format( _( "Text width must be at least %s." ), min );
390
391 return false;
392 }
393 else if( width > maxSize )
394 {
395 wxString max = m_frame->StringFromValue( maxSize, true );
396
397 m_itemsGrid->SetCellValue( i, FPT_WIDTH, max );
398
400 m_delayedErrorMessage = wxString::Format( _( "Text width must be at most %s." ), max );
403
404 return false;
405 }
406
407 if( height < minSize )
408 {
409 wxString min = m_frame->StringFromValue( minSize, true );
410
411 m_itemsGrid->SetCellValue( i, FPT_HEIGHT, min );
412
414 m_delayedErrorMessage = wxString::Format( _( "Text height must be at least %s." ), min );
417
418 return false;
419 }
420 else if( height > maxSize )
421 {
422 wxString max = m_frame->StringFromValue( maxSize, true );
423
424 m_itemsGrid->SetCellValue( i, FPT_HEIGHT, max );
425
427 m_delayedErrorMessage = wxString::Format( _( "Text height must be at most %s." ), max );
430
431 return false;
432 }
433
434 // Test for acceptable values for thickness and size and clamp if fails
435 int maxPenWidth = Clamp_Text_PenSize( field->GetTextThickness(), field->GetTextSize() );
436
437 if( field->GetTextThickness() > maxPenWidth )
438 {
439 wxString clamped = m_frame->StringFromValue( maxPenWidth, true );
440
441 m_itemsGrid->SetCellValue( i, FPT_THICKNESS, clamped );
442
444 m_delayedErrorMessage = wxString::Format( _( "Text thickness is too large for the "
445 "text size.\n"
446 "It will be clamped at %s." ),
447 clamped );
450
451 return false;
452 }
453 }
454
455 if( !m_netClearance.Validate( 0, INT_MAX ) )
456 return false;
457
458 return true;
459}
460
461
463{
464 if( !Validate() )
465 return false;
466
468 return false;
469
470 // This only commits the editor, model updating is done below so it is inside
471 // the commit
473 return false;
474
475 auto view = m_frame->GetCanvas()->GetView();
476 BOARD_COMMIT commit( m_frame );
477 commit.Modify( m_footprint );
478
479 // Update fields
480 size_t i = 0;
481
482 for( PCB_FIELD* field : m_footprint->GetFields() )
483 {
484 // copy grid table entries till we run out, then delete any remaining texts
485 if( i < m_fields->size() )
486 field = m_fields->at( i++ );
487 else
488 field->DeleteStructure();
489 }
490
491 // if there are still grid table entries, create new fields for them
492 while( i < m_fields->size() )
493 {
494 view->Add( m_footprint->AddField( *m_fields->at( i++ ) ) );
495 }
496
497 // Initialize masks clearances
502
503 switch( m_ZoneConnectionChoice->GetSelection() )
504 {
505 default:
506 case 0: m_footprint->SetZoneConnection( ZONE_CONNECTION::INHERITED ); break;
507 case 1: m_footprint->SetZoneConnection( ZONE_CONNECTION::FULL ); break;
508 case 2: m_footprint->SetZoneConnection( ZONE_CONNECTION::THERMAL ); break;
509 case 3: m_footprint->SetZoneConnection( ZONE_CONNECTION::NONE ); break;
510 }
511
512 // Set Footprint Position
514 m_footprint->SetPosition( pos );
515 m_footprint->SetLocked( m_cbLocked->GetValue() );
516
517 int attributes = 0;
518
519 switch( m_componentType->GetSelection() )
520 {
521 case 0: attributes |= FP_THROUGH_HOLE; break;
522 case 1: attributes |= FP_SMD; break;
523 default: break;
524 }
525
526 if( m_boardOnly->GetValue() )
527 attributes |= FP_BOARD_ONLY;
528
529 if( m_excludeFromPosFiles->GetValue() )
530 attributes |= FP_EXCLUDE_FROM_POS_FILES;
531
532 if( m_excludeFromBOM->GetValue() )
533 attributes |= FP_EXCLUDE_FROM_BOM;
534
535 if( m_cbDNP->GetValue() )
536 attributes |= FP_DNP;
537
538 if( m_noCourtyards->GetValue() )
539 attributes |= FP_ALLOW_MISSING_COURTYARD;
540
541 if( m_allowSolderMaskBridges->GetValue() )
542 attributes |= FP_ALLOW_SOLDERMASK_BRIDGES;
543
544 m_footprint->SetAttributes( attributes );
545
547
548 if( m_footprint->GetOrientation() != orient )
550
551 // Set component side, that also have effect on the fields positions on board
552 bool change_layer = false;
553 if( m_BoardSideCtrl->GetSelection() == 0 ) // layer req = COMPONENT
554 {
555 if( m_footprint->GetLayer() == B_Cu )
556 change_layer = true;
557 }
558 else if( m_footprint->GetLayer() == F_Cu )
559 change_layer = true;
560
561 if( change_layer )
563
564 // Copy the models from the panel to the footprint
565 std::vector<FP_3DMODEL>& panelList = m_3dPanel->GetModelList();
566 std::vector<FP_3DMODEL>* fpList = &m_footprint->Models();
567 fpList->clear();
568 fpList->insert( fpList->end(), panelList.begin(), panelList.end() );
569
570 // This is a simple edit, we must create an undo entry
571 if( m_footprint->GetEditFlags() == 0 ) // i.e. not edited, or moved
572 commit.Push( _( "Modify footprint properties" ) );
573
575 return true;
576}
577
578
580{
582 return;
583
584 int fieldId = (int) m_fields->size();
585 PCB_FIELD* newField =
586 new PCB_FIELD( m_footprint, m_fields->size(),
588
589 newField->SetVisible( false );
590 newField->SetLayer( m_footprint->GetLayer() == F_Cu ? F_Fab : B_Fab );
591 newField->SetFPRelativePosition( { 0, 0 } );
593
594 m_fields->push_back( newField );
595
596 // notify the grid
597 wxGridTableMessage msg( m_fields, wxGRIDTABLE_NOTIFY_ROWS_APPENDED, 1 );
598 m_itemsGrid->ProcessTableMessage( msg );
599
600 m_itemsGrid->SetFocus();
601 m_itemsGrid->MakeCellVisible( m_fields->size() - 1, 0 );
602 m_itemsGrid->SetGridCursor( m_fields->size() - 1, 0 );
603
604 m_itemsGrid->EnableCellEditControl( true );
605 m_itemsGrid->ShowCellEditControl();
606}
607
608
610{
612 return;
613
614 wxArrayInt selectedRows = m_itemsGrid->GetSelectedRows();
615
616 if( selectedRows.empty() && m_itemsGrid->GetGridCursorRow() >= 0 )
617 selectedRows.push_back( m_itemsGrid->GetGridCursorRow() );
618
619 if( selectedRows.empty() )
620 return;
621
622 for( int row : selectedRows )
623 {
624 if( row < MANDATORY_FIELDS )
625 {
626 DisplayError( this, wxString::Format( _( "The first %d fields are mandatory." ),
628 return;
629 }
630 }
631
632 m_itemsGrid->CommitPendingChanges( true /* quiet mode */ );
633 m_itemsGrid->ClearSelection();
634
635 // Reverse sort so deleting a row doesn't change the indexes of the other rows.
636 selectedRows.Sort( []( int* first, int* second ) { return *second - *first; } );
637
638 for( int row : selectedRows )
639 {
640 m_fields->erase( m_fields->begin() + row );
641
642 // notify the grid
643 wxGridTableMessage msg( m_fields, wxGRIDTABLE_NOTIFY_ROWS_DELETED, row, 1 );
644 m_itemsGrid->ProcessTableMessage( msg );
645
646 if( m_itemsGrid->GetNumberRows() > 0 )
647 {
648 m_itemsGrid->MakeCellVisible( std::max( 0, row-1 ), m_itemsGrid->GetGridCursorCol() );
649 m_itemsGrid->SetGridCursor( std::max( 0, row-1 ), m_itemsGrid->GetGridCursorCol() );
650 }
651 }
652}
653
654
656{
657 // Account for scroll bars
659
660 itemsWidth -= m_itemsGrid->GetRowLabelSize();
661
662 for( int i = 0; i < m_itemsGrid->GetNumberCols(); i++ )
663 {
664 if( i == 1 )
665 continue;
666
667 itemsWidth -= m_itemsGrid->GetColSize( i );
668 }
669
670 m_itemsGrid->SetColSize(
671 1, std::max( itemsWidth, m_itemsGrid->GetVisibleWidth( 0, true, false ) ) );
672
673 // Update the width of the 3D panel
675}
676
677
679{
680 if( !m_initialized )
681 return;
682
683 // Handle a grid error. This is delayed to OnUpdateUI so that we can change focus
684 // even when the original validation was triggered from a killFocus event, and so
685 // that the corresponding notebook page can be shown in the background when triggered
686 // from an OK.
687 if( m_delayedFocusRow >= 0 )
688 {
689 // We will re-enter this routine if an error dialog is displayed, so make sure we
690 // zero out our member variables first.
691 wxGrid* grid = m_delayedFocusGrid;
692 int row = m_delayedFocusRow;
693 int col = m_delayedFocusColumn;
694 wxString msg = m_delayedErrorMessage;
695
696 m_delayedFocusGrid = nullptr;
699 m_delayedErrorMessage = wxEmptyString;
700
701 if( !msg.IsEmpty() )
702 {
703 // Do not use DisplayErrorMessage(); it screws up window order on Mac
704 DisplayError( nullptr, msg );
705 }
706
707 grid->SetFocus();
708 grid->MakeCellVisible( row, col );
709
710 // Selecting the first grid item only makes sense for the
711 // items grid
712 if( !m_initialFocus || grid == m_itemsGrid )
713 {
714 grid->SetGridCursor( row, col );
715
716 if( !( col == 0 && row < MANDATORY_FIELDS ) )
717 grid->EnableCellEditControl( true );
718
719 grid->ShowCellEditControl();
720
721 if( grid == m_itemsGrid && row == 0 && col == 0 )
722 {
723 auto referenceEditor = grid->GetCellEditor( 0, 0 );
724
725 if( auto textEntry = dynamic_cast<wxTextEntry*>( referenceEditor->GetControl() ) )
726 KIUI::SelectReferenceNumber( textEntry );
727
728 referenceEditor->DecRef();
729 }
730 }
731 m_initialFocus = false;
732 }
733}
734
735
737{
738 wxSize new_size = aEvent.GetSize();
739
740 if( ( !m_itemsGrid->IsCellEditControlShown() || m_lastRequestedSize != new_size )
741 && m_gridSize != new_size )
742 {
743 m_gridSize = new_size;
744
745 // A trick to fix a cosmetic issue: when, in m_itemsGrid, a layer selector widget has
746 // the focus (is activated in column 6) when resizing the grid, the widget is not moved.
747 // So just change the widget having the focus in this case
748 if( m_NoteBook->GetSelection() == 0 && !m_itemsGrid->HasFocus() )
749 {
750 int col = m_itemsGrid->GetGridCursorCol();
751
752 if( col == 6 ) // a layer selector widget can be activated
753 m_itemsGrid->SetFocus();
754 }
755
757 }
758
759 // We store this value to check whether the dialog is changing size. This might indicate
760 // that the user is scaling the dialog with an editor shown. Some editors do not close
761 // (at least on GTK) when the user drags a dialog corner
762 m_lastRequestedSize = new_size;
763
764 // Always propagate for a grid repaint (needed if the height changes, as well as width)
765 aEvent.Skip();
766
767}
768
769
770void DIALOG_FOOTPRINT_PROPERTIES::OnPageChange( wxNotebookEvent& aEvent )
771{
772 int page = aEvent.GetSelection();
773
774 // Shouldn't be necessary, but is on at least OSX
775 if( page >= 0 )
776 m_NoteBook->ChangeSelection( (unsigned) page );
777}
778
779
constexpr EDA_IU_SCALE pcbIUScale
Definition: base_units.h:109
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap)
Definition: bitmap.cpp:110
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
virtual void Push(const wxString &aMessage=wxEmptyString, int aCommitFlags=0) override
Revert the commit by restoring the modified items state.
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
Definition: board_item.h:259
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
Definition: board_item.cpp:45
void SetFPRelativePosition(const VECTOR2I &aPos)
Definition: board_item.cpp:275
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:276
LSET GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
Definition: board.cpp:649
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
Definition: board.cpp:536
COMMIT & Modify(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Create an undo entry for an item that has been already modified.
Definition: commit.h:103
Class DIALOG_FOOTPRINT_PROPERTIES_BASE.
void OnDeleteField(wxCommandEvent &) override
void OnUpdateUI(wxUpdateUIEvent &) override
void OnAddField(wxCommandEvent &) override
void OnPageChange(wxNotebookEvent &event) override
PANEL_FP_PROPERTIES_3D_MODEL * m_3dPanel
void OnGridSize(wxSizeEvent &aEvent) override
void EditLibraryFootprint(wxCommandEvent &) override
DIALOG_FOOTPRINT_PROPERTIES(PCB_EDIT_FRAME *aParent, FOOTPRINT *aFootprint)
void EditFootprint(wxCommandEvent &) override
void UpdateFootprint(wxCommandEvent &) override
void ChangeFootprint(wxCommandEvent &) override
std::vector< wxWindow * > m_tabOrder
Definition: dialog_shim.h:225
void SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
Definition: dialog_shim.h:97
void SetupStandardButtons(std::map< int, wxString > aLabels={})
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
EDA_ANGLE Normalize()
Definition: eda_angle.h:249
EDA_ANGLE Normalize180()
Definition: eda_angle.h:288
EDA_ITEM_FLAGS GetEditFlags() const
Definition: eda_item.h:129
virtual void SetVisible(bool aVisible)
Definition: eda_text.cpp:229
int GetTextThickness() const
Definition: eda_text.h:123
VECTOR2I GetTextSize() const
Definition: eda_text.h:218
void SetPosition(const VECTOR2I &aPos) override
Definition: footprint.cpp:1997
void SetLocked(bool isLocked) override
Set the #MODULE_is_LOCKED bit in the m_ModuleStatus.
Definition: footprint.h:375
EDA_ANGLE GetOrientation() const
Definition: footprint.h:209
PCB_FIELD * AddField(const PCB_FIELD &aField)
Add a field to the symbol.
Definition: footprint.cpp:336
int GetLocalClearance() const
Definition: footprint.h:257
void SetAttributes(int aAttributes)
Definition: footprint.h:278
double GetLocalSolderPasteMarginRatio() const
Definition: footprint.h:271
void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
Rotate this object.
Definition: footprint.cpp:1902
void SetLocalSolderPasteMarginRatio(double aRatio)
Definition: footprint.h:272
void SetLocalSolderPasteMargin(int aMargin)
Definition: footprint.h:269
int GetAttributes() const
Definition: footprint.h:277
PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
Definition: footprint.h:218
int GetLocalSolderPasteMargin() const
Definition: footprint.h:268
void SetLocalClearance(int aClearance)
Definition: footprint.h:258
const LIB_ID & GetFPID() const
Definition: footprint.h:230
bool IsLocked() const override
Definition: footprint.h:365
void SetLocalSolderMaskMargin(int aMargin)
Definition: footprint.h:255
void GetFields(std::vector< PCB_FIELD * > &aVector, bool aVisibleOnly)
Populate a std::vector with PCB_TEXTs.
Definition: footprint.cpp:321
void SetZoneConnection(ZONE_CONNECTION aType)
Definition: footprint.h:274
std::vector< FP_3DMODEL > & Models()
Definition: footprint.h:202
void Flip(const VECTOR2I &aCentre, bool aFlipLeftRight) override
Flip this object, i.e.
Definition: footprint.cpp:1937
ZONE_CONNECTION GetZoneConnection() const
Definition: footprint.h:275
VECTOR2I GetPosition() const override
Definition: footprint.h:206
int GetLocalSolderMaskMargin() const
Definition: footprint.h:254
int GetNumberRows() override
Add mouse and command handling (such as cut, copy, and paste) to a WX_GRID instance.
Definition: grid_tricks.h:61
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
UTF8 Format() const
Definition: lib_id.cpp:118
LSEQ Seq(const PCB_LAYER_ID *aWishListSequence, unsigned aCount) const
Return an LSEQ from the union of this LSET and a desired sequence.
Definition: lset.cpp:418
std::vector< FP_3DMODEL > & GetModelList()
wxString m_FootprintTextShownColumns
PCBNEW_SETTINGS * GetPcbNewSettings() const
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Returns the BOARD_DESIGN_SETTINGS for the open project.
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
The main frame for Pcbnew.
wxString GetName(bool aUseDefaultName=true) const
Return the field name (not translated).
Definition: pcb_field.cpp:47
void StyleFromSettings(const BOARD_DESIGN_SETTINGS &settings) override
Definition: pcb_text.cpp:256
static S3D_CACHE * Get3DCacheManager(PROJECT *aProject, bool updateProjDir=false)
Return a pointer to an instance of the 3D cache manager.
Definition: project_pcb.cpp:77
void FlushCache(bool closePlugins=true)
Free all data in the cache and by default closes all plugins.
Definition: 3d_cache.cpp:608
void SetBitmap(const wxBitmapBundle &aBmp)
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.
int ValueFromString(const wxString &aTextValue, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
Converts aTextValue in aUnits to internal units used by the frame.
virtual long long int GetValue()
Return the current value in Internal Units.
virtual void SetPrecision(int aLength)
Normally not needed, but can be used to set the precision when using internal units that are floats (...
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 EDA_ANGLE GetAngleValue()
virtual void SetNegativeZero()
Definition: unit_binder.h:71
virtual double GetDoubleValue()
Return the current value in Internal Units.
virtual void SetAngleValue(const EDA_ANGLE &aValue)
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.
void SetCoordType(ORIGIN_TRANSFORMS::COORD_TYPES_T aCoordType)
Set the current origin transform mode.
Definition: unit_binder.h:189
int GetVisibleWidth(int aCol, bool aHeader=true, bool aContents=true, bool aKeep=false)
Calculates the specified column based on the actual size of the text on screen.
Definition: wx_grid.cpp:545
void ShowHideColumns(const wxString &shownColumns)
Show/hide the grid columns based on a tokenized string of shown column indexes.
Definition: wx_grid.cpp:298
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:156
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:254
wxString GetShownColumnsAsString()
Get a tokenized string containing the shown column indexes.
Definition: wx_grid.cpp:268
bool CommitPendingChanges(bool aQuietMode=false)
Close any open cell edit controls.
Definition: wx_grid.cpp:448
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:280
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_MILS
Minimum text size in mils.
Definition: eda_text.h:42
#define TEXT_MAX_SIZE_MILS
Maximum text size in mils (10 inches)
Definition: eda_text.h:43
@ FP_SMD
Definition: footprint.h:73
@ FP_DNP
Definition: footprint.h:80
@ FP_ALLOW_MISSING_COURTYARD
Definition: footprint.h:79
@ FP_EXCLUDE_FROM_POS_FILES
Definition: footprint.h:74
@ FP_BOARD_ONLY
Definition: footprint.h:76
@ FP_EXCLUDE_FROM_BOM
Definition: footprint.h:75
@ FP_THROUGH_HOLE
Definition: footprint.h:72
@ FP_ALLOW_SOLDERMASK_BRIDGES
Definition: footprint.h:78
@ FPT_LAYER
@ FPT_WIDTH
@ FPT_HEIGHT
@ FPT_THICKNESS
@ FPT_NAME
int Clamp_Text_PenSize(int aPenSize, int aSize, bool aStrict)
Pen width should not allow characters to become cluttered up in their own fatness.
Definition: gr_text.cpp:87
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:60
@ B_Cu
Definition: layer_ids.h:96
@ F_Fab
Definition: layer_ids.h:121
@ F_Cu
Definition: layer_ids.h:65
@ B_Fab
Definition: layer_ids.h:120
wxColour GetDialogBGColour()
Definition: gtk/ui.cpp:61
wxSize GetUnobscuredSize(const wxWindow *aWindow)
Tries to determine the size of the viewport of a scrollable widget (wxDataViewCtrl,...
Definition: gtk/ui.cpp:195
wxFont GetInfoFont(wxWindow *aWindow)
Definition: ui_common.cpp:151
void SelectReferenceNumber(wxTextEntry *aTextEntry)
Select the number (or "?") in a reference for ease of editing.
Definition: ui_common.cpp:225
see class PGM_BASE
constexpr int MilsToIU(int mils) const
Definition: base_units.h:94
static const wxString GetDefaultFieldName(int aFieldNdx, bool aTranslateForHI=false)
Return a default symbol field name for field aFieldNdx for all components.
#define DO_TRANSLATE
@ MANDATORY_FIELDS
The first 5 are mandatory, and must be instantiated in SCH_COMPONENT and LIB_PART constructors.