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, dick@softplc.com
6  * Copyright (C) 2008 Wayne Stambaugh <stambaughw@gmail.com>
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 
97  // Show/hide columns according to the user's preference
99 
101 
102  // Set font sizes
103  wxFont infoFont = KIUI::GetInfoFont( this );
104 #if __WXMAC__
105  m_allow90Label->SetFont( infoFont );
106  m_allow180Label->SetFont( infoFont );
107 #endif
108 
109  infoFont.SetStyle( wxFONTSTYLE_ITALIC );
110  m_staticTextInfoValNeg->SetFont( infoFont );
111  m_staticTextInfoValPos->SetFont( infoFont );
112  m_staticTextInfoCopper->SetFont( infoFont );
113  m_staticTextInfoPaste->SetFont( infoFont );
114 
115  if( static_cast<int>( m_page ) >= 0 )
116  m_NoteBook->SetSelection( (unsigned) m_page );
117 
119  {
121  m_delayedFocusRow = 0;
124  }
126  {
128  }
129 
131 
134 
135  m_sdbSizerStdButtonsOK->SetDefault();
136 
137  // Configure button logos
138  m_bpAdd->SetBitmap( KiBitmap( BITMAPS::small_plus ) );
139  m_bpDelete->SetBitmap( KiBitmap( BITMAPS::small_trash ) );
140 
141  // wxFormBuilder doesn't include this event...
142  m_itemsGrid->Connect( wxEVT_GRID_CELL_CHANGING,
144  nullptr, this );
145 
147 }
148 
149 
151 {
153  m_itemsGrid->GetShownColumns().ToStdString();
154 
155  // Prevents crash bug in wxGrid's d'tor
157 
158  m_itemsGrid->Disconnect( wxEVT_GRID_CELL_CHANGING,
160  nullptr, this );
161 
162  // Delete the GRID_TRICKS.
163  m_itemsGrid->PopEventHandler( true );
164 
165  m_page = static_cast<NOTEBOOK_PAGES>( m_NoteBook->GetSelection() );
166 
167  // the GL canvas on the 3D models page has to be visible before it is destroyed
168  m_NoteBook->SetSelection( static_cast<int>( NOTEBOOK_PAGES::PAGE_3D_MODELS ) );
169 }
170 
171 
173 {
174  LIB_ID fpID = m_footprint->GetFPID();
175  wxString footprintName = fpID.GetLibItemName();
176 
177  m_FootprintNameCtrl->ChangeValue( footprintName );
178 
179  m_DocCtrl->SetValue( m_footprint->GetDescription() );
180  m_KeywordCtrl->SetValue( m_footprint->GetKeywords() );
181 
182  if( !wxDialog::TransferDataToWindow() )
183  return false;
184 
185  if( !m_PanelGeneral->TransferDataToWindow() )
186  return false;
187 
188  // Add the models to the panel
190  return false;
191 
192  // Footprint Texts
193  m_texts->push_back( m_footprint->Reference() );
194  m_texts->push_back( m_footprint->Value() );
195 
196  for( auto item : m_footprint->GraphicalItems() )
197  {
198  auto textItem = dyn_cast<FP_TEXT*>( item );
199 
200  if( textItem )
201  m_texts->push_back( *textItem );
202  }
203 
204  // Notify the grid
205  wxGridTableMessage tmsg( m_texts, wxGRIDTABLE_NOTIFY_ROWS_APPENDED, m_texts->GetNumberRows() );
206  m_itemsGrid->ProcessTableMessage( tmsg );
207 
208  // Footprint Properties
211 
213  m_componentType->SetSelection( 0 );
214  else if( m_footprint->GetAttributes() & FP_SMD )
215  m_componentType->SetSelection( 1 );
216  else
217  m_componentType->SetSelection( 2 );
218 
222 
223  // Local Clearances
224 
229 
230  switch( m_footprint->GetZoneConnection() )
231  {
232  default:
233  case ZONE_CONNECTION::INHERITED: m_ZoneConnectionChoice->SetSelection( 0 ); break;
234  case ZONE_CONNECTION::FULL: m_ZoneConnectionChoice->SetSelection( 1 ); break;
235  case ZONE_CONNECTION::THERMAL: m_ZoneConnectionChoice->SetSelection( 2 ); break;
236  case ZONE_CONNECTION::NONE: m_ZoneConnectionChoice->SetSelection( 3 ); break;
237  }
238 
239  // Items grid
240  for( int col = 0; col < m_itemsGrid->GetNumberCols(); col++ )
241  {
242  // Adjust min size to the column label size
243  m_itemsGrid->SetColMinimalWidth( col, m_itemsGrid->GetVisibleWidth( col, true, false,
244  false ) );
245  // Adjust the column size.
246  int col_size = m_itemsGrid->GetVisibleWidth( col, true, true, false );
247 
248  if( col == FPT_LAYER ) // This one's a drop-down. Check all possible values.
249  {
250  BOARD* board = m_footprint->GetBoard();
251 
252  for( PCB_LAYER_ID layer : board->GetEnabledLayers().Seq() )
253  col_size = std::max( col_size, GetTextExtent( board->GetLayerName( layer ) ).x );
254 
255  // And the swatch:
256  col_size += 20;
257  }
258 
259  if( m_itemsGrid->IsColShown( col ) )
260  m_itemsGrid->SetColSize( col, col_size );
261  }
262 
263  m_itemsGrid->SetRowLabelSize( m_itemsGrid->GetVisibleWidth( -1, true, true, true ) );
264 
265  Layout();
266  adjustGridColumns( m_itemsGrid->GetRect().GetWidth() );
267 
268  return true;
269 }
270 
271 
272 bool DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::checkFootprintName( const wxString& aFootprintName )
273 {
274  if( aFootprintName.IsEmpty() )
275  {
276  m_delayedErrorMessage = _( "Footprint must have a name." );
277  return false;
278  }
279  else if( !FOOTPRINT::IsLibNameValid( aFootprintName ) )
280  {
281  m_delayedErrorMessage.Printf( _( "Footprint name may not contain '%s'." ),
283  return false;
284  }
285 
286  return true;
287 }
288 
289 
291 {
293  return false;
294 
295  if( !DIALOG_SHIM::Validate() )
296  return false;
297 
298  // First, test for invalid chars in footprint name
299  wxString footprintName = m_FootprintNameCtrl->GetValue();
300 
301  if( !checkFootprintName( footprintName ) )
302  {
303  if( m_NoteBook->GetSelection() != 0 )
304  m_NoteBook->SetSelection( 0 );
305 
308 
309  return false;
310  }
311 
312  // Check for empty texts.
313  for( size_t i = 2; i < m_texts->size(); ++i )
314  {
315  FP_TEXT& text = m_texts->at( i );
316 
317  if( text.GetText().IsEmpty() )
318  {
319  if( m_NoteBook->GetSelection() != 0 )
320  m_NoteBook->SetSelection( 0 );
321 
322  m_delayedErrorMessage = _( "Text items must have some content." );
325  m_delayedFocusRow = i;
326 
327  return false;
328  }
329  }
330 
331  if( !m_netClearance.Validate( 0, INT_MAX ) )
332  return false;
333 
334  return true;
335 }
336 
337 
339 {
340  if( !Validate() )
341  return false;
342 
343  if( !DIALOG_SHIM::TransferDataFromWindow() )
344  return false;
345 
347  return false;
348 
349  // This only commits the editor, model updating is done below so it is inside
350  // the commit
352  return false;
353 
354  auto view = m_frame->GetCanvas()->GetView();
355  BOARD_COMMIT commit( m_frame );
356  commit.Modify( m_footprint );
357 
358  LIB_ID fpID = m_footprint->GetFPID();
359  fpID.SetLibItemName( m_FootprintNameCtrl->GetValue() );
360  m_footprint->SetFPID( fpID );
361 
362  m_footprint->SetDescription( m_DocCtrl->GetValue() );
363  m_footprint->SetKeywords( m_KeywordCtrl->GetValue() );
364 
365  // copy reference and value
366  m_footprint->Reference() = m_texts->at( 0 );
367  m_footprint->Value() = m_texts->at( 1 );
368 
369  size_t i = 2;
370  std::vector<FP_TEXT*> items_to_remove;
371 
372  for( BOARD_ITEM* item : m_footprint->GraphicalItems() )
373  {
374  FP_TEXT* textItem = dynamic_cast<FP_TEXT*>( item );
375 
376  if( textItem )
377  {
378  // copy grid table entries till we run out, then delete any remaining texts
379  if( i < m_texts->size() )
380  *textItem = m_texts->at( i++ );
381  else // store this item to remove and delete it later,
382  // after the graphic list is explored:
383  items_to_remove.push_back( textItem );
384  }
385  }
386 
387  // Remove text items:
389 
390  for( FP_TEXT* item: items_to_remove )
391  {
392  selTool->RemoveItemFromSel( item );
393  view->Remove( item );
394  item->DeleteStructure();
395  }
396 
397  // if there are still grid table entries, create new texts for them
398  while( i < m_texts->size() )
399  {
400  FP_TEXT* newText = new FP_TEXT( m_texts->at( i++ ) );
401  m_footprint->Add( newText, ADD_MODE::APPEND );
402  view->Add( newText );
403  }
404 
405  int attributes = 0;
406 
407  switch( m_componentType->GetSelection() )
408  {
409  case 0: attributes |= FP_THROUGH_HOLE; break;
410  case 1: attributes |= FP_SMD; break;
411  default: break;
412  }
413 
414  if( m_boardOnly->GetValue() )
415  attributes |= FP_BOARD_ONLY;
416 
417  if( m_excludeFromPosFiles->GetValue() )
418  attributes |= FP_EXCLUDE_FROM_POS_FILES;
419 
420  if( m_excludeFromBOM->GetValue() )
421  attributes |= FP_EXCLUDE_FROM_BOM;
422 
423  m_footprint->SetAttributes( attributes );
424 
427 
428  // Initialize masks clearances
433 
434  switch( m_ZoneConnectionChoice->GetSelection() )
435  {
436  default:
441  }
442 
443  // Copy the models from the panel to the footprint
444  std::vector<FP_3DMODEL>& panelList = m_3dPanel->GetModelList();
445  std::list<FP_3DMODEL>* fpList = &m_footprint->Models();
446  fpList->clear();
447  fpList->insert( fpList->end(), panelList.begin(), panelList.end() );
448 
449  commit.Push( _( "Modify footprint properties" ) );
450 
451  return true;
452 }
453 
454 
455 static bool footprintIsFromBoard( FOOTPRINT* aFootprint )
456 {
457  return aFootprint->GetLink() != niluuid;
458 }
459 
460 
462 {
463  // Currently: nothing to do
464 }
465 
466 
468 {
470  {
471  // Currently: nothing to do
472  }
473 }
474 
475 
477 {
479  return;
480 
481  const BOARD_DESIGN_SETTINGS& dsnSettings = m_frame->GetDesignSettings();
482  FP_TEXT textItem( m_footprint );
483 
484  // Set active layer if legal; otherwise copy layer from previous text item
486  textItem.SetLayer( m_frame->GetActiveLayer() );
487  else
488  textItem.SetLayer( m_texts->at( m_texts->size() - 1 ).GetLayer() );
489 
490  textItem.SetTextSize( dsnSettings.GetTextSize( textItem.GetLayer() ) );
491  textItem.SetTextThickness( dsnSettings.GetTextThickness( textItem.GetLayer() ) );
492  textItem.SetItalic( dsnSettings.GetTextItalic( textItem.GetLayer() ) );
493 
494  m_texts->push_back( textItem );
495 
496  // notify the grid
497  wxGridTableMessage msg( m_texts, wxGRIDTABLE_NOTIFY_ROWS_APPENDED, 1 );
498  m_itemsGrid->ProcessTableMessage( msg );
499 
500  m_itemsGrid->SetFocus();
501  m_itemsGrid->MakeCellVisible( m_texts->size() - 1, 0 );
502  m_itemsGrid->SetGridCursor( m_texts->size() - 1, 0 );
503 
504  m_itemsGrid->EnableCellEditControl( true );
505  m_itemsGrid->ShowCellEditControl();
506 }
507 
508 
510 {
512  return;
513 
514  int curRow = m_itemsGrid->GetGridCursorRow();
515 
516  if( curRow < 0 )
517  {
518  return;
519  }
520  else if( curRow < 2 )
521  {
522  DisplayError( nullptr, _( "Reference and value are mandatory." ) );
523  return;
524  }
525 
526  m_texts->erase( m_texts->begin() + curRow );
527 
528  // notify the grid
529  wxGridTableMessage msg( m_texts, wxGRIDTABLE_NOTIFY_ROWS_DELETED, curRow, 1 );
530  m_itemsGrid->ProcessTableMessage( msg );
531 
532  if( m_itemsGrid->GetNumberRows() > 0 )
533  {
534  m_itemsGrid->MakeCellVisible( std::max( 0, curRow-1 ), m_itemsGrid->GetGridCursorCol() );
535  m_itemsGrid->SetGridCursor( std::max( 0, curRow-1 ), m_itemsGrid->GetGridCursorCol() );
536  }
537 }
538 
539 
541 {
542  // Account for scroll bars
543  int itemsWidth = aWidth - ( m_itemsGrid->GetSize().x - m_itemsGrid->GetClientSize().x );
544 
545  itemsWidth -= m_itemsGrid->GetRowLabelSize();
546 
547  for( int i = 1; i < m_itemsGrid->GetNumberCols(); i++ )
548  itemsWidth -= m_itemsGrid->GetColSize( i );
549 
550  if( itemsWidth > 0 )
551  {
552  m_itemsGrid->SetColSize( 0, std::max( itemsWidth,
553  m_itemsGrid->GetVisibleWidth( 0, true, false, false ) ) );
554  }
555 
556  // Update the width of the 3D panel
558 }
559 
560 
562 {
563  if( !m_itemsGrid->IsCellEditControlShown() )
564  adjustGridColumns( m_itemsGrid->GetRect().GetWidth() );
565 
566  // Handle a delayed focus. The delay allows us to:
567  // a) change focus when the error was triggered from within a killFocus handler
568  // b) show the correct notebook page in the background before the error dialog comes up
569  // when triggered from an OK or a notebook page change
570 
571  if( static_cast<int>( m_delayedFocusPage ) >= 0 )
572  {
573  if( m_NoteBook->GetSelection() != static_cast<int>( m_delayedFocusPage ) )
574  m_NoteBook->SetSelection( static_cast<int>( m_delayedFocusPage ) );
575 
577  }
578 
579  if( !m_delayedErrorMessage.IsEmpty() )
580  {
581  // We will re-enter this routine when the error dialog is displayed, so make
582  // sure we don't keep putting up more dialogs.
583  wxString msg = m_delayedErrorMessage;
584  m_delayedErrorMessage = wxEmptyString;
585 
586  // Do not use DisplayErrorMessage(); it screws up window order on Mac
587  DisplayError( nullptr, msg );
588  }
589 
590  if( m_delayedFocusCtrl )
591  {
592  m_delayedFocusCtrl->SetFocus();
593 
594  if( auto textEntry = dynamic_cast<wxTextEntry*>( m_delayedFocusCtrl ) )
595  textEntry->SelectAll();
596 
597  m_delayedFocusCtrl = nullptr;
598  }
599  else if( m_delayedFocusGrid )
600  {
601  m_delayedFocusGrid->SetFocus();
604 
605  m_delayedFocusGrid->EnableCellEditControl( true );
606  m_delayedFocusGrid->ShowCellEditControl();
607 
608  m_delayedFocusGrid = nullptr;
609  m_delayedFocusRow = -1;
611  }
612 }
613 
614 
616 {
617  adjustGridColumns( event.GetSize().GetX() );
618 
619  event.Skip();
620 }
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:197
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:182
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:226
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
Definition: board_item.h:161
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:136
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:179
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:224
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:237
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:72
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:820
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:236
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:246
FP_TEXT & Value()
read/write accessors:
Definition: footprint.h:499
void SetDescription(const wxString &aDoc)
Definition: footprint.h:198
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:104
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:210
int GetLocalClearance() const
Definition: footprint.h:209
#define _(s)
DRAWINGS & GraphicalItems()
Definition: footprint.h:171
const LIB_ID & GetFPID() const
Definition: footprint.h:194
bool CommitPendingChanges(bool aQuietMode=false)
Close any open cell edit controls.
Definition: wx_grid.cpp:190
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:200
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
EDA_UNITS m_units
Definition: dialog_shim.h:198
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:195
wxString GetShownColumns()
Get a tokenized string containing the shown column indexes.
Definition: wx_grid.cpp:117
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:206
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:235
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:190
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:201
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:223
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:159
ZONE_CONNECTION GetZoneConnection() const
Definition: footprint.h:227
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:1414
int GetLocalSolderPasteMargin() const
Definition: footprint.h:220
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:140
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:1425
void SetPlacementCost90(int aCost)
Definition: footprint.h:582
void SetLocalSolderMaskMargin(int aMargin)
Definition: footprint.h:207
Container for design settings for a BOARD object.
void SetLocalSolderPasteMargin(int aMargin)
Definition: footprint.h:221