KiCad PCB EDA Suite
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, [email protected]
6  * Copyright (C) 2008 Wayne Stambaugh <[email protected]>
7  * Copyright (C) 2004-2021 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 
27 #include <confirm.h>
30 #include <validators.h>
31 #include <board_design_settings.h>
32 #include <board_commit.h>
33 #include <bitmaps.h>
35 #include <widgets/wx_grid.h>
36 #include <widgets/text_ctrl_eval.h>
37 #include <footprint.h>
38 #include <footprint_edit_frame.h>
43 #include "filename_resolver.h"
44 #include <pgm_base.h>
48 #include <tool/tool_manager.h>
50 
51 #include <fp_lib_table.h>
52 
53 
54 // Remember the last open page during session.
55 
57 
58 
60  FOOTPRINT_EDIT_FRAME* aParent,
61  FOOTPRINT* aFootprint ) :
63  m_frame( aParent ),
64  m_footprint( aFootprint ),
65  m_netClearance( aParent, m_NetClearanceLabel, m_NetClearanceCtrl, m_NetClearanceUnits ),
66  m_solderMask( aParent, m_SolderMaskMarginLabel, m_SolderMaskMarginCtrl,
67  m_SolderMaskMarginUnits ),
68  m_solderPaste( aParent, m_SolderPasteMarginLabel, m_SolderPasteMarginCtrl,
69  m_SolderPasteMarginUnits ),
70  m_solderPasteRatio( aParent, m_PasteMarginRatioLabel, m_PasteMarginRatioCtrl,
71  m_PasteMarginRatioUnits )
72 {
73  // Create the 3D models page
75  m_NoteBook->AddPage( m_3dPanel, _("3D Models"), false );
76 
78 
79  m_delayedErrorMessage = wxEmptyString;
80  m_delayedFocusCtrl = nullptr;
81  m_delayedFocusGrid = nullptr;
82  m_delayedFocusRow = -1;
85 
86  // Give an icon
87  wxIcon icon;
88  icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_modedit ) );
89  SetIcon( icon );
90 
91  // Give a bit more room for combobox editors
92  m_itemsGrid->SetDefaultRowSize( m_itemsGrid->GetDefaultRowSize() + 4 );
93 
95  m_itemsGrid->PushEventHandler( new GRID_TRICKS( m_itemsGrid ) );
96  m_itemsGrid->SetSelectionMode( wxGrid::wxGridSelectRows );
97 
98  // Show/hide columns according to the user's preference
100 
102 
103  // Set font sizes
104  wxFont infoFont = KIUI::GetInfoFont( this );
105 #if __WXMAC__
106  m_allow90Label->SetFont( infoFont );
107  m_allow180Label->SetFont( infoFont );
108 #endif
109 
110  infoFont.SetStyle( wxFONTSTYLE_ITALIC );
111  m_staticTextInfoValNeg->SetFont( infoFont );
112  m_staticTextInfoValPos->SetFont( infoFont );
113  m_staticTextInfoCopper->SetFont( infoFont );
114  m_staticTextInfoPaste->SetFont( infoFont );
115 
116  if( static_cast<int>( m_page ) >= 0 )
117  m_NoteBook->SetSelection( (unsigned) m_page );
118 
120  {
122  m_delayedFocusRow = 0;
125  }
127  {
129  }
130 
132 
135 
136  m_sdbSizerStdButtonsOK->SetDefault();
137 
138  // Configure button logos
139  m_bpAdd->SetBitmap( KiBitmap( BITMAPS::small_plus ) );
140  m_bpDelete->SetBitmap( KiBitmap( BITMAPS::small_trash ) );
141 
142  // wxFormBuilder doesn't include this event...
143  m_itemsGrid->Connect( wxEVT_GRID_CELL_CHANGING,
145  nullptr, this );
146 
148 }
149 
150 
152 {
154  m_itemsGrid->GetShownColumns().ToStdString();
155 
156  // Prevents crash bug in wxGrid's d'tor
158 
159  m_itemsGrid->Disconnect( wxEVT_GRID_CELL_CHANGING,
161  nullptr, this );
162 
163  // Delete the GRID_TRICKS.
164  m_itemsGrid->PopEventHandler( true );
165 
166  m_page = static_cast<NOTEBOOK_PAGES>( m_NoteBook->GetSelection() );
167 
168  // the GL canvas on the 3D models page has to be visible before it is destroyed
169  m_NoteBook->SetSelection( static_cast<int>( NOTEBOOK_PAGES::PAGE_3D_MODELS ) );
170 }
171 
172 
174 {
175  LIB_ID fpID = m_footprint->GetFPID();
176  wxString footprintName = fpID.GetLibItemName();
177 
178  m_FootprintNameCtrl->ChangeValue( footprintName );
179 
180  m_DocCtrl->SetValue( m_footprint->GetDescription() );
181  m_KeywordCtrl->SetValue( m_footprint->GetKeywords() );
182 
183  if( !wxDialog::TransferDataToWindow() )
184  return false;
185 
186  if( !m_PanelGeneral->TransferDataToWindow() )
187  return false;
188 
189  // Add the models to the panel
191  return false;
192 
193  // Footprint Texts
194  m_texts->push_back( m_footprint->Reference() );
195  m_texts->push_back( m_footprint->Value() );
196 
197  for( auto item : m_footprint->GraphicalItems() )
198  {
199  auto textItem = dyn_cast<FP_TEXT*>( item );
200 
201  if( textItem )
202  m_texts->push_back( *textItem );
203  }
204 
205  // Notify the grid
206  wxGridTableMessage tmsg( m_texts, wxGRIDTABLE_NOTIFY_ROWS_APPENDED, m_texts->GetNumberRows() );
207  m_itemsGrid->ProcessTableMessage( tmsg );
208 
209  // Footprint Properties
212 
214  m_componentType->SetSelection( 0 );
215  else if( m_footprint->GetAttributes() & FP_SMD )
216  m_componentType->SetSelection( 1 );
217  else
218  m_componentType->SetSelection( 2 );
219 
223 
224  // Local Clearances
225 
230 
231  switch( m_footprint->GetZoneConnection() )
232  {
233  default:
234  case ZONE_CONNECTION::INHERITED: m_ZoneConnectionChoice->SetSelection( 0 ); break;
235  case ZONE_CONNECTION::FULL: m_ZoneConnectionChoice->SetSelection( 1 ); break;
236  case ZONE_CONNECTION::THERMAL: m_ZoneConnectionChoice->SetSelection( 2 ); break;
237  case ZONE_CONNECTION::NONE: m_ZoneConnectionChoice->SetSelection( 3 ); break;
238  }
239 
240  // Items grid
241  for( int col = 0; col < m_itemsGrid->GetNumberCols(); col++ )
242  {
243  // Adjust min size to the column label size
244  m_itemsGrid->SetColMinimalWidth( col, m_itemsGrid->GetVisibleWidth( col, true, false,
245  false ) );
246  // Adjust the column size.
247  int col_size = m_itemsGrid->GetVisibleWidth( col, true, true, false );
248 
249  if( col == FPT_LAYER ) // This one's a drop-down. Check all possible values.
250  {
251  BOARD* board = m_footprint->GetBoard();
252 
253  for( PCB_LAYER_ID layer : board->GetEnabledLayers().Seq() )
254  col_size = std::max( col_size, GetTextExtent( board->GetLayerName( layer ) ).x );
255 
256  // And the swatch:
257  col_size += 20;
258  }
259 
260  if( m_itemsGrid->IsColShown( col ) )
261  m_itemsGrid->SetColSize( col, col_size );
262  }
263 
264  m_itemsGrid->SetRowLabelSize( m_itemsGrid->GetVisibleWidth( -1, true, true, true ) );
265 
266  Layout();
267  adjustGridColumns( m_itemsGrid->GetRect().GetWidth() );
268 
269  return true;
270 }
271 
272 
273 bool DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::checkFootprintName( const wxString& aFootprintName )
274 {
275  if( aFootprintName.IsEmpty() )
276  {
277  m_delayedErrorMessage = _( "Footprint must have a name." );
278  return false;
279  }
280  else if( !FOOTPRINT::IsLibNameValid( aFootprintName ) )
281  {
282  m_delayedErrorMessage.Printf( _( "Footprint name may not contain '%s'." ),
284  return false;
285  }
286 
287  return true;
288 }
289 
290 
292 {
294  return false;
295 
296  if( !DIALOG_SHIM::Validate() )
297  return false;
298 
299  // First, test for invalid chars in footprint name
300  wxString footprintName = m_FootprintNameCtrl->GetValue();
301 
302  if( !checkFootprintName( footprintName ) )
303  {
304  if( m_NoteBook->GetSelection() != 0 )
305  m_NoteBook->SetSelection( 0 );
306 
309 
310  return false;
311  }
312 
313  // Check for empty texts.
314  for( size_t i = 2; i < m_texts->size(); ++i )
315  {
316  FP_TEXT& text = m_texts->at( i );
317 
318  if( text.GetText().IsEmpty() )
319  {
320  if( m_NoteBook->GetSelection() != 0 )
321  m_NoteBook->SetSelection( 0 );
322 
323  m_delayedErrorMessage = _( "Text items must have some content." );
326  m_delayedFocusRow = i;
327 
328  return false;
329  }
330  }
331 
332  if( !m_netClearance.Validate( 0, INT_MAX ) )
333  return false;
334 
335  return true;
336 }
337 
338 
340 {
341  if( !Validate() )
342  return false;
343 
344  if( !DIALOG_SHIM::TransferDataFromWindow() )
345  return false;
346 
348  return false;
349 
350  // This only commits the editor, model updating is done below so it is inside
351  // the commit
353  return false;
354 
355  auto view = m_frame->GetCanvas()->GetView();
356  BOARD_COMMIT commit( m_frame );
357  commit.Modify( m_footprint );
358 
359  LIB_ID fpID = m_footprint->GetFPID();
360  fpID.SetLibItemName( m_FootprintNameCtrl->GetValue() );
361  m_footprint->SetFPID( fpID );
362 
363  m_footprint->SetDescription( m_DocCtrl->GetValue() );
364  m_footprint->SetKeywords( m_KeywordCtrl->GetValue() );
365 
366  // copy reference and value
367  m_footprint->Reference() = m_texts->at( 0 );
368  m_footprint->Value() = m_texts->at( 1 );
369 
370  size_t i = 2;
371  std::vector<FP_TEXT*> items_to_remove;
372 
373  for( BOARD_ITEM* item : m_footprint->GraphicalItems() )
374  {
375  FP_TEXT* textItem = dynamic_cast<FP_TEXT*>( item );
376 
377  if( textItem )
378  {
379  // copy grid table entries till we run out, then delete any remaining texts
380  if( i < m_texts->size() )
381  *textItem = m_texts->at( i++ );
382  else // store this item to remove and delete it later,
383  // after the graphic list is explored:
384  items_to_remove.push_back( textItem );
385  }
386  }
387 
388  // Remove text items:
390 
391  for( FP_TEXT* item: items_to_remove )
392  {
393  selTool->RemoveItemFromSel( item );
394  view->Remove( item );
395  item->DeleteStructure();
396  }
397 
398  // if there are still grid table entries, create new texts for them
399  while( i < m_texts->size() )
400  {
401  FP_TEXT* newText = new FP_TEXT( m_texts->at( i++ ) );
402  m_footprint->Add( newText, ADD_MODE::APPEND );
403  view->Add( newText );
404  }
405 
406  int attributes = 0;
407 
408  switch( m_componentType->GetSelection() )
409  {
410  case 0: attributes |= FP_THROUGH_HOLE; break;
411  case 1: attributes |= FP_SMD; break;
412  default: break;
413  }
414 
415  if( m_boardOnly->GetValue() )
416  attributes |= FP_BOARD_ONLY;
417 
418  if( m_excludeFromPosFiles->GetValue() )
419  attributes |= FP_EXCLUDE_FROM_POS_FILES;
420 
421  if( m_excludeFromBOM->GetValue() )
422  attributes |= FP_EXCLUDE_FROM_BOM;
423 
424  m_footprint->SetAttributes( attributes );
425 
428 
429  // Initialize masks clearances
434 
435  switch( m_ZoneConnectionChoice->GetSelection() )
436  {
437  default:
442  }
443 
444  // Copy the models from the panel to the footprint
445  std::vector<FP_3DMODEL>& panelList = m_3dPanel->GetModelList();
446  std::list<FP_3DMODEL>* fpList = &m_footprint->Models();
447  fpList->clear();
448  fpList->insert( fpList->end(), panelList.begin(), panelList.end() );
449 
450  commit.Push( _( "Modify footprint properties" ) );
451 
452  return true;
453 }
454 
455 
456 static bool footprintIsFromBoard( FOOTPRINT* aFootprint )
457 {
458  return aFootprint->GetLink() != niluuid;
459 }
460 
461 
463 {
464  // Currently: nothing to do
465 }
466 
467 
469 {
471  {
472  // Currently: nothing to do
473  }
474 }
475 
476 
478 {
480  return;
481 
482  const BOARD_DESIGN_SETTINGS& dsnSettings = m_frame->GetDesignSettings();
483  FP_TEXT textItem( m_footprint );
484 
485  // Set active layer if legal; otherwise copy layer from previous text item
487  textItem.SetLayer( m_frame->GetActiveLayer() );
488  else
489  textItem.SetLayer( m_texts->at( m_texts->size() - 1 ).GetLayer() );
490 
491  textItem.SetTextSize( dsnSettings.GetTextSize( textItem.GetLayer() ) );
492  textItem.SetTextThickness( dsnSettings.GetTextThickness( textItem.GetLayer() ) );
493  textItem.SetItalic( dsnSettings.GetTextItalic( textItem.GetLayer() ) );
494 
495  m_texts->push_back( textItem );
496 
497  // notify the grid
498  wxGridTableMessage msg( m_texts, wxGRIDTABLE_NOTIFY_ROWS_APPENDED, 1 );
499  m_itemsGrid->ProcessTableMessage( msg );
500 
501  m_itemsGrid->SetFocus();
502  m_itemsGrid->MakeCellVisible( m_texts->size() - 1, 0 );
503  m_itemsGrid->SetGridCursor( m_texts->size() - 1, 0 );
504 
505  m_itemsGrid->EnableCellEditControl( true );
506  m_itemsGrid->ShowCellEditControl();
507 }
508 
509 
511 {
513  return;
514 
515  wxArrayInt selectedRows = m_itemsGrid->GetSelectedRows();
516 
517  if( selectedRows.empty() && m_itemsGrid->GetGridCursorRow() >= 0 )
518  selectedRows.push_back( m_itemsGrid->GetGridCursorRow() );
519 
520  if( selectedRows.empty() )
521  return;
522 
523  for( int row : selectedRows )
524  {
525  if( row < 2 )
526  {
527  DisplayError( nullptr, _( "Reference and value are mandatory." ) );
528  return;
529  }
530  }
531 
532  // Reverse sort so deleting a row doesn't change the indexes of the other rows.
533  selectedRows.Sort( []( int* first, int* second ) { return *second - *first; } );
534 
535  for( int row : selectedRows )
536  {
537  m_texts->erase( m_texts->begin() + row );
538 
539  // notify the grid
540  wxGridTableMessage msg( m_texts, wxGRIDTABLE_NOTIFY_ROWS_DELETED, row, 1 );
541  m_itemsGrid->ProcessTableMessage( msg );
542 
543  if( m_itemsGrid->GetNumberRows() > 0 )
544  {
545  m_itemsGrid->MakeCellVisible( std::max( 0, row-1 ), m_itemsGrid->GetGridCursorCol() );
546  m_itemsGrid->SetGridCursor( std::max( 0, row-1 ), m_itemsGrid->GetGridCursorCol() );
547  }
548  }
549 }
550 
551 
553 {
554  // Account for scroll bars
555  int itemsWidth = aWidth - ( m_itemsGrid->GetSize().x - m_itemsGrid->GetClientSize().x );
556 
557  itemsWidth -= m_itemsGrid->GetRowLabelSize();
558 
559  for( int i = 1; i < m_itemsGrid->GetNumberCols(); i++ )
560  itemsWidth -= m_itemsGrid->GetColSize( i );
561 
562  if( itemsWidth > 0 )
563  {
564  m_itemsGrid->SetColSize( 0, std::max( itemsWidth,
565  m_itemsGrid->GetVisibleWidth( 0, true, false, false ) ) );
566  }
567 
568  // Update the width of the 3D panel
570 }
571 
572 
574 {
575  if( !m_itemsGrid->IsCellEditControlShown() )
576  adjustGridColumns( m_itemsGrid->GetRect().GetWidth() );
577 
578  // Handle a delayed focus. The delay allows us to:
579  // a) change focus when the error was triggered from within a killFocus handler
580  // b) show the correct notebook page in the background before the error dialog comes up
581  // when triggered from an OK or a notebook page change
582 
583  if( static_cast<int>( m_delayedFocusPage ) >= 0 )
584  {
585  if( m_NoteBook->GetSelection() != static_cast<int>( m_delayedFocusPage ) )
586  m_NoteBook->ChangeSelection( static_cast<int>( m_delayedFocusPage ) );
587 
589  }
590 
591  if( !m_delayedErrorMessage.IsEmpty() )
592  {
593  // We will re-enter this routine when the error dialog is displayed, so make
594  // sure we don't keep putting up more dialogs.
595  wxString msg = m_delayedErrorMessage;
596  m_delayedErrorMessage = wxEmptyString;
597 
598  // Do not use DisplayErrorMessage(); it screws up window order on Mac
599  DisplayError( nullptr, msg );
600  }
601 
602  if( m_delayedFocusCtrl )
603  {
604  m_delayedFocusCtrl->SetFocus();
605 
606  if( auto textEntry = dynamic_cast<wxTextEntry*>( m_delayedFocusCtrl ) )
607  textEntry->SelectAll();
608 
609  m_delayedFocusCtrl = nullptr;
610  }
611  else if( m_delayedFocusGrid )
612  {
613  m_delayedFocusGrid->SetFocus();
616 
617  m_delayedFocusGrid->EnableCellEditControl( true );
618  m_delayedFocusGrid->ShowCellEditControl();
619 
620  m_delayedFocusGrid = nullptr;
621  m_delayedFocusRow = -1;
623  }
624 }
625 
626 
628 {
629  adjustGridColumns( event.GetSize().GetX() );
630 
631  event.Skip();
632 }
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:279
COMMIT & Modify(EDA_ITEM *aItem)
Create an undo entry for an item that has been already modified.
Definition: commit.h:103
const wxString & GetDescription() const
Definition: footprint.h:198
const UTF8 & GetLibItemName() const
Definition: lib_id.h:104
KIID niluuid(0)
virtual void SetNegativeZero()
Definition: unit_binder.h:67
std::list< FP_3DMODEL > & Models()
Definition: footprint.h:183
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
Definition: board.cpp:362
BOARD_DESIGN_SETTINGS & GetDesignSettings() const override
Returns the BOARD_DESIGN_SETTINGS for the open project.
void SetZoneConnection(ZONE_CONNECTION aType)
Definition: footprint.h:227
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
Definition: board_item.h:164
This file is part of the common library.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:49
int GetPlacementCost180() const
Definition: footprint.h:578
void ShowHideColumns(const wxString &shownColumns)
Show/hide the grid columns based on a tokenized string of shown column indexes.
Definition: wx_grid.cpp:172
int GetNumberRows() override
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
void SetItalic(bool isItalic)
Definition: eda_text.h:200
Class DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR_BASE.
wxFont GetInfoFont(wxWindow *aWindow)
Definition: ui_common.cpp:144
Add mouse and command handling (such as cut, copy, and paste) to a WX_GRID instance.
Definition: grid_tricks.h:55
std::vector< FP_3DMODEL > & GetModelList()
void SetLocalSolderPasteMarginRatio(double aRatio)
Definition: footprint.h:225
LSET GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
Definition: board.cpp:467
void SetTextSize(const wxSize &aNewSize)
Definition: eda_text.h:258
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:93
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
int GetTextThickness(PCB_LAYER_ID aLayer) const
Return the default text thickness from the layer class for the given layer.
static LSET AllTechMask()
Return a mask holding all technical layers (no CU layer) on both side.
Definition: lset.cpp:829
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:411
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 SetAttributes(int aAttributes)
Definition: footprint.h:237
void SetPlacementCost180(int aCost)
Definition: footprint.h:579
int GetVisibleWidth(int aCol, bool aHeader=true, bool aContents=false, bool aKeep=true)
Calculates the specified column based on the actual size of the text on screen.
Definition: wx_grid.cpp:282
FP_TEXT & Value()
read/write accessors:
Definition: footprint.h:499
void SetDescription(const wxString &aDoc)
Definition: footprint.h:199
This class provides a custom wxValidator object for limiting the allowable characters when defining f...
Definition: validators.h:63
FP_TEXT & Reference()
Definition: footprint.h:500
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:139
bool GetTextItalic(PCB_LAYER_ID aLayer) const
virtual PCB_LAYER_ID GetActiveLayer() const
DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR(FOOTPRINT_EDIT_FRAME *aParent, FOOTPRINT *aFootprint)
pads are covered by copper
static bool footprintIsFromBoard(FOOTPRINT *aFootprint)
void SetLocalClearance(int aClearance)
Definition: footprint.h:211
int GetLocalClearance() const
Definition: footprint.h:210
#define _(s)
DRAWINGS & GraphicalItems()
Definition: footprint.h:172
const LIB_ID & GetFPID() const
Definition: footprint.h:195
bool CommitPendingChanges(bool aQuietMode=false)
Close any open cell edit controls.
Definition: wx_grid.cpp:226
int SetLibItemName(const UTF8 &aLibItemName)
Override the library item name portion of the LIB_ID to aLibItemName.
Definition: lib_id.cpp: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:105
const wxString & GetKeywords() const
Definition: footprint.h:201
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
KIID GetLink() const
Definition: footprint.h:575
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
Use thermal relief for pads.
void SetFPID(const LIB_ID &aFPID)
Definition: footprint.h:196
wxString GetShownColumns()
Get a tokenized string containing the shown column indexes.
Definition: wx_grid.cpp:153
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...
Definition: unit_binder.cpp:92
int GetLocalSolderMaskMargin() const
Definition: footprint.h:207
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.
see class PGM_BASE
int GetAttributes() const
Definition: footprint.h:236
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:191
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:65
virtual void SetValue(int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
void SetKeywords(const wxString &aKeywords)
Definition: footprint.h:202
The selection tool: currently supports:
virtual void Push(const wxString &aMessage=wxT("A commit"), bool aCreateUndoEntry=true, bool aSetDirtyBit=true) override
Revert the commit by restoring the modified items state.
Pads are not covered.
double GetLocalSolderPasteMarginRatio() const
Definition: footprint.h:224
virtual long long int GetValue()
Return the current value in Internal Units.
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
Definition: board_item.cpp:36
FOOTPRINT_EDITOR_SETTINGS * GetSettings()
void SetTextThickness(int aWidth)
The TextThickness is that set by the user.
Definition: eda_text.h:180
ZONE_CONNECTION GetZoneConnection() const
Definition: footprint.h:228
int GetPlacementCost90() const
Definition: footprint.h:581
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
Definition: tools_holder.h:54
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:1433
int GetLocalSolderPasteMargin() const
Definition: footprint.h:221
void RemoveItemFromSel(BOARD_ITEM *aItem, bool aQuietMode=false)
Multiple item unselection event handler.
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT) override
Removes an item from the container.
Definition: footprint.cpp:513
virtual void SetDoubleValue(double aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
virtual double GetDoubleValue()
Return the current value in Internal Units.
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Definition: board_item.h:143
Custom text control validator definitions.
wxSize GetTextSize(PCB_LAYER_ID aLayer) const
Return the default text size from the layer class for the given layer.
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:1444
void SetPlacementCost90(int aCost)
Definition: footprint.h:582
void SetLocalSolderMaskMargin(int aMargin)
Definition: footprint.h:208
Container for design settings for a BOARD object.
void SetLocalSolderPasteMargin(int aMargin)
Definition: footprint.h:222