KiCad PCB EDA Suite
dialog_exchange_footprints.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) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
6  * Copyright (C) 2013 Wayne Stambaugh <stambaughw@gmail.com>
7  * Copyright (C) 1992-2018 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 <bitmaps.h>
28 #include <board_commit.h>
29 #include <class_board.h>
30 #include <class_module.h>
32 #include <kicad_string.h>
33 #include <kiway.h>
34 #include <pcb_edit_frame.h>
35 #include <pcbnew_settings.h>
36 #include <project.h>
37 #include <wx_html_report_panel.h>
38 
39 
40 #define ID_MATCH_FP_ALL 4200
41 #define ID_MATCH_FP_SELECTED 4201
42 #define ID_MATCH_FP_REF 4202
43 #define ID_MATCH_FP_VAL 4203
44 #define ID_MATCH_FP_ID 4204
45 
46 
51 
52 bool g_removeExtraTextItems[2] = { false, false };
53 bool g_resetTextItemLayers[2] = { false, true };
54 bool g_resetTextItemEffects[2] = { false, true };
55 bool g_resetFabricationAttrs[2] = { false, true };
56 bool g_reset3DModels[2] = { false, true };
57 
58 
60  MODULE* aFootprint,
61  bool updateMode, bool selectedMode ) :
63  m_commit( aParent ),
64  m_parent( aParent ),
65  m_currentFootprint( aFootprint ),
66  m_updateMode( updateMode )
67 {
68  wxString title = updateMode ? _( "Update Footprints from Library" ) : _( "Change Footprints" );
69  wxString verb = updateMode ? _( "Update" ) : _( "Change" );
70  wxString reset = updateMode ? _( "Reset" ) : _( "Update" );
71  wxString label;
72 
73  SetTitle( title );
74 
75  if( m_updateMode )
76  {
77  label.Printf( m_matchAll->GetLabel(), verb );
78  m_matchAll->SetLabel( label );
79  m_changeSizer->Show( false );
80  }
81  else
82  {
83  m_upperSizer->FindItem( m_matchAll )->Show( false );
85  }
86 
87  if( m_currentFootprint )
88  {
89  label.Printf( m_matchSelected->GetLabel(), verb );
90  m_matchSelected->SetLabel( label );
91  m_newID->AppendText( FROM_UTF8( m_currentFootprint->GetFPID().Format().c_str() ) );
92  }
93  else
94  m_upperSizer->FindItem( m_matchSelected )->Show( false );
95 
96  label.Printf( m_matchSpecifiedRef->GetLabel(), verb );
97  m_matchSpecifiedRef->SetLabel( label );
98 
99  // Use ChangeValue() instead of SetValue() so we don't generate events.
100  if( m_currentFootprint )
102 
103  label.Printf( m_matchSpecifiedValue->GetLabel(), verb );
104  m_matchSpecifiedValue->SetLabel( label );
105 
106  if( m_currentFootprint )
107  m_specifiedValue->ChangeValue( m_currentFootprint->GetValue() );
108 
109  label.Printf( m_matchSpecifiedID->GetLabel(), verb );
110  m_matchSpecifiedID->SetLabel( label );
111 
112  if( m_currentFootprint )
113  m_specifiedID->ChangeValue( FROM_UTF8( m_currentFootprint->GetFPID().Format().c_str() ) );
114 
116 
117  m_upperSizer->SetEmptyCellSize( wxSize( 0, 0 ) );
118  // The upper sizer has its content modified: re-layout it:
119  m_upperSizer->Layout();
120 
121  // initialize match-mode
122  if( m_updateMode )
124  else
126 
127  wxCommandEvent event;
128  event.SetEventObject( this );
129 
130  switch( *m_matchMode )
131  {
132  case ID_MATCH_FP_ALL: OnMatchAllClicked( event ); break;
133  case ID_MATCH_FP_SELECTED: OnMatchSelectedClicked( event ); break;
134  case ID_MATCH_FP_REF: OnMatchRefClicked( event ); break;
135  case ID_MATCH_FP_VAL: OnMatchValueClicked( event ); break;
136  case ID_MATCH_FP_ID: OnMatchIDClicked( event ); break;
137  default: break;
138  }
139 
140  label.Printf( m_resetTextItemLayers->GetLabel(), reset );
141  m_resetTextItemLayers->SetLabel( label );
142 
143  label.Printf( m_resetTextItemEffects->GetLabel(), reset );
144  m_resetTextItemEffects->SetLabel( label );
145 
146  label.Printf( m_resetFabricationAttrs->GetLabel(), reset );
147  m_resetFabricationAttrs->SetLabel( label );
148 
149  label.Printf( m_reset3DModels->GetLabel(), reset );
150  m_reset3DModels->SetLabel( label );
151 
152  m_removeExtraBox->SetValue( g_removeExtraTextItems[ m_updateMode ? 0 : 1 ] );
156  m_reset3DModels->SetValue( g_reset3DModels[ m_updateMode ? 0 : 1 ] );
157 
159 
160  // DIALOG_SHIM needs a unique hash_key because classname is not sufficient
161  // because the update and change versions of this dialog have different controls.
162  m_hash_key = TO_UTF8( GetTitle() );
163 
164  // Ensure m_closeButton (with id = wxID_CANCEL) has the right label
165  // (to fix automatic renaming of button label )
166  m_sdbSizerCancel->SetLabel( _( "Close" ) );
167  m_sdbSizerOK->SetLabel( verb );
168  m_sdbSizerOK->SetDefault();
169 
170  // Now all widgets have the size fixed, call FinishDialogSettings
172 }
173 
174 
176 {
177  g_removeExtraTextItems[ m_updateMode ? 0 : 1 ] = m_removeExtraBox->GetValue();
181  g_reset3DModels[ m_updateMode ? 0 : 1 ] = m_reset3DModels->GetValue();
182 }
183 
184 
186 {
187  LIB_ID specifiedID;
188 
189  switch( *m_matchMode )
190  {
191  case ID_MATCH_FP_ALL:
192  return true;
194  return aFootprint == m_currentFootprint;
195  case ID_MATCH_FP_REF:
196  return WildCompareString( m_specifiedRef->GetValue(), aFootprint->GetReference(), false );
197  case ID_MATCH_FP_VAL:
198  return WildCompareString( m_specifiedValue->GetValue(), aFootprint->GetValue(), false );
199  case ID_MATCH_FP_ID:
200  specifiedID.Parse( m_specifiedID->GetValue(), LIB_ID::ID_PCB );
201  return aFootprint->GetFPID() == specifiedID;
202  default:
203  return false; // just to quiet compiler warnings....
204  }
205 }
206 
207 
209 {
210  switch( *m_matchMode )
211  {
212  case ID_MATCH_FP_ALL: return m_matchAll;
216  case ID_MATCH_FP_ID: return m_matchSpecifiedID;
217  default: return nullptr;
218  }
219 }
220 
221 
223 {
224  wxRadioButton* rb_button = getRadioButtonForMode();
225 
226  wxRadioButton* rb_butt_list[] =
227  {
228  m_matchAll,
233  nullptr // end of list
234  };
235 
236  // Ensure the button state is ok. Only one button can be checked
237  // Change button state only if its state is incorrect, otherwise
238  // we have issues depending on the platform.
239  for( int ii = 0; rb_butt_list[ii]; ++ii )
240  {
241  bool state = rb_butt_list[ii] == rb_button;
242 
243  if( rb_butt_list[ii]->GetValue() != state )
244  rb_butt_list[ii]->SetValue( state );
245  }
246 }
247 
248 
250 {
252 
253  if( event.GetEventObject() == this )
255  else
256  m_matchAll->SetFocus();
257 }
258 
259 
261 {
263 
264  if( event.GetEventObject() == this )
266  else
267  m_matchSelected->SetFocus();
268 }
269 
270 
272 {
274 
275  if( event.GetEventObject() == this )
277  else if( event.GetEventObject() != m_specifiedRef )
278  m_specifiedRef->SetFocus();
279 }
280 
281 
283 {
285 
286  if( event.GetEventObject() == this )
288  else if( event.GetEventObject() != m_specifiedValue )
289  m_specifiedValue->SetFocus();
290 }
291 
292 
293 void DIALOG_EXCHANGE_FOOTPRINTS::OnMatchIDClicked( wxCommandEvent& event )
294 {
296 
297  if( event.GetEventObject() == this )
299  else if( event.GetEventObject() != m_specifiedID )
300  m_specifiedID->SetFocus();
301 }
302 
303 
304 void DIALOG_EXCHANGE_FOOTPRINTS::OnOKClicked( wxCommandEvent& event )
305 {
306  wxBusyCursor dummy;
307 
309  m_MessageWindow->Flush( false );
310 
312  {
313  m_parent->Compile_Ratsnest( true );
314  m_parent->GetCanvas()->Refresh();
315  }
316 
317  m_MessageWindow->Flush( false );
318 
319  m_commit.Push( wxT( "Changed footprint" ) );
320 }
321 
322 
324 {
325  bool change = false;
326  LIB_ID newFPID;
327  wxString value;
328 
329  if( m_parent->GetBoard()->Modules().empty() )
330  return false;
331 
332  if( !m_updateMode )
333  {
334  newFPID.Parse( m_newID->GetValue(), LIB_ID::ID_PCB );
335 
336  if( !newFPID.IsValid() )
337  return false;
338  }
339 
340  /* The change is done from the last footprint because processFootprint() modifies the last
341  * item in the list.
342  */
343  for( auto it = m_parent->GetBoard()->Modules().rbegin();
344  it != m_parent->GetBoard()->Modules().rend(); it++ )
345  {
346  auto mod = *it;
347 
348  if( !isMatch( mod ) )
349  continue;
350 
351  if( m_updateMode )
352  {
353  if( processFootprint( mod, mod->GetFPID()) )
354  change = true;
355  }
356  else
357  {
358  if( processFootprint( mod, newFPID ) )
359  change = true;
360  }
361  }
362 
363  return change;
364 }
365 
366 
367 bool DIALOG_EXCHANGE_FOOTPRINTS::processFootprint( MODULE* aFootprint, const LIB_ID& aNewFPID )
368 {
369  LIB_ID oldFPID = aFootprint->GetFPID();
370  wxString msg;
371 
372  // Load new footprint.
373  msg.Printf( _( "%s footprint \"%s\" (from \"%s\") to \"%s\"" ),
374  m_updateMode ? _( "Update" ) : _( "Change" ),
375  aFootprint->GetReference(),
376  oldFPID.Format().c_str(),
377  aNewFPID.Format().c_str() );
378 
379  MODULE* newFootprint = m_parent->LoadFootprint( aNewFPID );
380 
381  if( !newFootprint )
382  {
383  msg << ": " << _( "*** footprint not found ***" );
385  return false;
386  }
387 
388  m_parent->ExchangeFootprint( aFootprint, newFootprint, m_commit,
389  m_removeExtraBox->GetValue(),
390  m_resetTextItemLayers->GetValue(),
391  m_resetTextItemEffects->GetValue(),
392  m_resetFabricationAttrs->GetValue(),
393  m_reset3DModels->GetValue());
394 
395  if( aFootprint == m_currentFootprint )
396  m_currentFootprint = newFootprint;
397 
398  msg += ": OK";
400 
401  return true;
402 }
403 
404 
405 void processTextItem( const FP_TEXT& aSrc, FP_TEXT& aDest,
406  bool resetText, bool resetTextLayers, bool resetTextEffects )
407 {
408  if( !resetText )
409  aDest.SetText( aSrc.GetText() );
410 
411  if( !resetTextLayers )
412  {
413  aDest.SetLayer( aSrc.GetLayer() );
414  aDest.SetVisible( aSrc.IsVisible() );
415  }
416 
417  if( !resetTextEffects )
418  {
419  // Careful: the visible bit is also in Effects
420  bool visible = aDest.IsVisible();
421  aDest.SetEffects( aSrc );
422  aDest.SetVisible( visible );
423  }
424 }
425 
426 
427 FP_TEXT* getMatchingTextItem( FP_TEXT* aRefItem, MODULE* aFootprint )
428 {
429  std::vector<FP_TEXT*> candidates;
430 
431  for( BOARD_ITEM* item : aFootprint->GraphicalItems() )
432  {
433  FP_TEXT* candidate = dyn_cast<FP_TEXT*>( item );
434 
435  if( candidate && candidate->GetText() == aRefItem->GetText() )
436  candidates.push_back( candidate );
437  }
438 
439  if( candidates.size() == 0 )
440  return nullptr;
441 
442  if( candidates.size() == 1 )
443  return candidates[0];
444 
445  // Try refining the match by layer
446  std::vector<FP_TEXT*> candidatesOnSameLayer;
447 
448  for( FP_TEXT* candidate : candidates )
449  {
450  if( candidate->GetLayer() == aRefItem->GetLayer() )
451  candidatesOnSameLayer.push_back( candidate );
452  }
453 
454  if( candidatesOnSameLayer.size() == 1 )
455  return candidatesOnSameLayer[0];
456 
457  // Last ditch effort: refine by position
458  std::vector<FP_TEXT*> candidatesAtSamePos;
459 
460  for( FP_TEXT* candidate : candidatesOnSameLayer.size() ? candidatesOnSameLayer : candidates )
461  {
462  if( candidate->GetPos0() == aRefItem->GetPos0() )
463  candidatesAtSamePos.push_back( candidate );
464  }
465 
466  if( candidatesAtSamePos.size() > 0 )
467  return candidatesAtSamePos[0];
468  else if( candidatesOnSameLayer.size() > 0 )
469  return candidatesOnSameLayer[0];
470  else
471  return candidates[0];
472 }
473 
474 
476  bool deleteExtraTexts, bool resetTextLayers,
477  bool resetTextEffects, bool resetFabricationAttrs,
478  bool reset3DModels )
479 {
480  PCB_GROUP* parentGroup = aExisting->GetParentGroup();
481 
482  if( parentGroup )
483  {
484  parentGroup->RemoveItem( aExisting );
485  parentGroup->AddItem( aNew );
486  }
487 
488  aNew->SetParent( GetBoard() );
489 
490  PlaceModule( aNew, false );
491 
492  // PlaceModule will move the footprint to the cursor position, which we don't want. Copy
493  // the original position across.
494  aNew->SetPosition( aExisting->GetPosition() );
495 
496  if( aNew->GetLayer() != aExisting->GetLayer() )
497  aNew->Flip( aNew->GetPosition(), m_settings->m_FlipLeftRight );
498 
499  if( aNew->GetOrientation() != aExisting->GetOrientation() )
500  aNew->SetOrientation( aExisting->GetOrientation() );
501 
502  aNew->SetLocked( aExisting->IsLocked() );
503 
504  for( D_PAD* pad : aNew->Pads() )
505  {
506  D_PAD* oldPad = aExisting->FindPadByName( pad->GetName() );
507 
508  if( oldPad )
509  {
511  pad->SetNetCode( oldPad->GetNetCode() );
512  pad->SetPinFunction( oldPad->GetPinFunction() );
513  }
514  }
515 
516  // Copy reference
517  processTextItem( aExisting->Reference(), aNew->Reference(),
518  // never reset reference text
519  false,
520  resetTextLayers, resetTextEffects );
521 
522  // Copy value
523  processTextItem( aExisting->Value(), aNew->Value(),
524  // reset value text only when it is a proxy for the footprint ID
525  // (cf replacing value "MountingHole-2.5mm" with "MountingHole-4.0mm")
526  aExisting->GetValue() == aExisting->GetFPID().GetLibItemName(),
527  resetTextLayers, resetTextEffects );
528 
529  // Copy fields in accordance with the reset* flags
530  for( BOARD_ITEM* item : aExisting->GraphicalItems() )
531  {
532  FP_TEXT* srcItem = dyn_cast<FP_TEXT*>( item );
533 
534  if( srcItem )
535  {
536  FP_TEXT* destItem = getMatchingTextItem( srcItem, aNew );
537 
538  if( destItem )
539  processTextItem( *srcItem, *destItem, false, resetTextLayers, resetTextEffects );
540  else if( !deleteExtraTexts )
541  aNew->Add( new FP_TEXT( *srcItem ) );
542  }
543  }
544 
545  if( !resetFabricationAttrs )
546  aNew->SetAttributes( aExisting->GetAttributes() );
547 
548  // Copy 3D model settings in accordance with the reset* flag
549  if( !reset3DModels )
550  aNew->Models() = aExisting->Models(); // Linked list of 3D models.
551 
552  // Updating other parameters
553  const_cast<KIID&>( aNew->m_Uuid ) = aExisting->m_Uuid;
554  aNew->SetProperties( aExisting->GetProperties() );
555  aNew->SetPath( aExisting->GetPath() );
556  aNew->CalculateBoundingBox();
557 
558  aCommit.Remove( aExisting );
559  aCommit.Add( aNew );
560 
561  aNew->ClearFlags();
562 }
563 
564 
566 {
567  wxString newname = m_newID->GetValue();
568 
570 
571  if( frame->ShowModal( &newname, this ) )
572  {
573  if( event.GetEventObject() == m_newIDBrowseButton )
574  m_newID->SetValue( newname );
575  else
576  m_specifiedID->SetValue( newname );
577  }
578 
579  frame->Destroy();
580 }
581 
582 
PCB_GROUP * GetParentGroup() const
FP_TEXT * getMatchingTextItem(FP_TEXT *aRefItem, MODULE *aFootprint)
bool AddItem(BOARD_ITEM *aItem)
Adds item to group.
int GetAttributes() const
Definition: class_module.h:251
void SetLazyUpdate(bool aLazyUpdate)
Sets the lasy update.
double GetOrientation() const
Definition: class_module.h:206
KIWAY_PLAYER is a wxFrame capable of the OpenProjectFiles function, meaning it can load a portion of ...
Definition: kiway_player.h:61
const UTF8 & GetLibItemName() const
Definition: lib_id.h:114
void OnMatchIDClicked(wxCommandEvent &event) override
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_holder.h:56
int GetNetCode() const
Function GetNetCode.
static wxString FROM_UTF8(const char *cstring)
function FROM_UTF8 converts a UTF8 encoded C string to a wxString for all wxWidgets build modes.
Definition: macros.h:109
void Compile_Ratsnest(bool aDisplayStatus)
Function Compile_Ratsnest Create the entire board ratsnest.
virtual void SetLayer(PCB_LAYER_ID aLayer)
Function SetLayer sets the layer this item is on.
BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
std::string m_hash_key
Definition: dialog_shim.h:199
COMMIT & Add(EDA_ITEM *aItem)
Adds a new item to the model
Definition: commit.h:78
FP_TEXT & Value()
read/write accessors:
Definition: class_module.h:475
PCB_GROUP is a set of BOARD_ITEMs (i.e., without duplicates)
void CalculateBoundingBox()
Function CalculateBoundingBox calculates the bounding box in board coordinates.
bool IsVisible() const
Definition: eda_text.h:192
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
void Flush(bool aSort=false)
Forces updating the HTML page, after the report is built in lazy mode If aSort = true,...
void FinishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
void SetVisible(bool aVisible)
Definition: eda_text.h:191
PADS & Pads()
Definition: class_module.h:182
const wxString GetValue() const
Function GetValue.
Definition: class_module.h:460
bool GetLocalRatsnestVisible() const
const LIB_ID & GetFPID() const
Definition: class_module.h:210
void SetLocalRatsnestVisible(bool aVisible)
const KIID_PATH & GetPath() const
Definition: class_module.h:219
DRAWINGS & GraphicalItems()
Definition: class_module.h:185
const wxString & GetPinFunction() const
Definition: class_pad.h:138
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
bool IsValid() const
Definition: lib_id.h:171
PCBNEW_SETTINGS * m_settings
void SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
Definition: dialog_shim.h:115
void ExchangeFootprint(MODULE *aExisting, MODULE *aNew, BOARD_COMMIT &aCommit, bool deleteExtraTexts=true, bool resetTextLayers=true, bool resetTextEffects=true, bool resetFabricationAttrs=true, bool reset3DModels=true)
Function Exchange_Module Replaces OldModule by NewModule, using OldModule settings: position,...
virtual void SetParent(EDA_ITEM *aParent)
Definition: eda_item.h:185
DIALOG_EXCHANGE_FOOTPRINTS(PCB_EDIT_FRAME *aParent, MODULE *aFootprint, bool updateMode, bool selectedMode)
const wxString GetReference() const
Function GetReference.
Definition: class_module.h:435
const char * c_str() const
Definition: utf8.h:107
int g_matchModeForUpdateSelected
FP_TEXT & Reference()
Definition: class_module.h:476
void OnMatchAllClicked(wxCommandEvent &event) override
bool g_resetTextItemEffects[2]
#define TO_UTF8(wxstring)
Macro TO_UTF8 converts a wxString to a UTF8 encoded C string for all wxWidgets build modes.
Definition: macros.h:95
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:82
D_PAD * FindPadByName(const wxString &aPadName) const
Function FindPadByName returns a D_PAD* with a matching name.
#define ID_MATCH_FP_ID
virtual void SetText(const wxString &aText)
Definition: eda_text.cpp:120
Class DIALOG_EXCHANGE_FOOTPRINTS_BASE.
VTBL_ENTRY KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=NULL)
Function Player returns the KIWAY_PLAYER* given a FRAME_T.
Definition: kiway.cpp:343
#define ID_MATCH_FP_ALL
MODULES & Modules()
Definition: class_board.h:284
bool WildCompareString(const wxString &pattern, const wxString &string_to_tst, bool case_sensitive)
Compare a string against wild card (* and ?) pattern using the usual rules.
Definition: string.cpp:488
void Flip(const wxPoint &aCentre, bool aFlipLeftRight) override
Function Flip Flip this object, i.e.
bool g_resetFabricationAttrs[2]
void OnMatchSelectedClicked(wxCommandEvent &event) override
bool g_reset3DModels[2]
bool RemoveItem(BOARD_ITEM *aItem)
Removes item from group.
bool g_removeExtraTextItems[2]
#define ID_MATCH_FP_SELECTED
COMMIT & Remove(EDA_ITEM *aItem)
Removes a new item from the model
Definition: commit.h:90
void SetPosition(const wxPoint &aPos) override
const BITMAP_OPAQUE small_library_xpm[1]
#define ID_MATCH_FP_REF
int g_matchModeForExchangeSelected
bool IsLocked() const override
Function IsLocked.
Definition: class_module.h:293
UTF8 Format() const
Definition: lib_id.cpp:237
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT) override
void Report(const wxString &aText, SEVERITY aSeverity, REPORTER::LOCATION aLocation=REPORTER::LOC_BODY)
Reports the string.
void SetEffects(const FP_TEXT &aSrc)
Function SetEffects sets the text effects from another instance.
Definition: fp_text.h:149
void SetOrientation(double aNewAngle)
void processTextItem(const FP_TEXT &aSrc, FP_TEXT &aDest, bool resetText, bool resetTextLayers, bool resetTextEffects)
const KIID m_Uuid
Definition: eda_item.h:151
void updateMatchModeRadioButtons(wxUpdateUIEvent &event) override
const wxPoint & GetPos0() const
Definition: fp_text.h:170
bool g_resetTextItemLayers[2]
std::list< MODULE_3D_SETTINGS > & Models()
Definition: class_module.h:196
MODULE * LoadFootprint(const LIB_ID &aFootprintId)
Function LoadFootprint attempts to load aFootprintId from the footprint library table.
void SetLocked(bool isLocked) override
Function SetLocked sets the MODULE_is_LOCKED bit in the m_ModuleStatus.
Definition: class_module.h:303
void Clear()
clears the report panel
static LIB_PART * dummy()
Used to draw a dummy shape when a LIB_PART is not found in library.
void SetProperties(const std::map< wxString, wxString > &aProps)
Definition: class_module.h:483
#define _(s)
Definition: 3d_actions.cpp:33
void OnMatchRefClicked(wxCommandEvent &event) override
#define ID_MATCH_FP_VAL
PCB_EDIT_FRAME is the main frame for Pcbnew.
virtual void Push(const wxString &aMessage=wxT("A commit"), bool aCreateUndoEntry=true, bool aSetDirtyBit=true) override
Executes the changes.
bool Destroy() override
Our version of Destroy() which is virtual from wxWidgets.
void ViewAndSelectFootprint(wxCommandEvent &event) override
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: eda_item.h:222
const std::map< wxString, wxString > & GetProperties() const
Definition: class_module.h:482
wxPoint GetPosition() const override
Definition: class_module.h:201
void SetPath(const KIID_PATH &aPath)
Definition: class_module.h:220
BOARD * GetBoard() const
void PlaceModule(MODULE *aModule, bool aRecreateRatsnest=true)
Function PlaceModule places aModule at the current cursor position and updates module coordinates wit...
bool processFootprint(MODULE *aFootprint, const LIB_ID &aNewFPID)
int Parse(const UTF8 &aId, LIB_ID_TYPE aType, bool aFix=false)
Parse LIB_ID with the information from aId.
Definition: lib_id.cpp:122
int g_matchModeForExchange
void OnMatchValueClicked(wxCommandEvent &event) override
virtual PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
virtual bool ShowModal(wxString *aResult=NULL, wxWindow *aResultantFocusWindow=NULL)
Function ShowModal puts up this wxFrame as if it were a modal dialog, with all other instantiated wxF...
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:133
void OnOKClicked(wxCommandEvent &event) override
void SetAttributes(int aAttributes)
Definition: class_module.h:252
int g_matchModeForUpdate