KiCad PCB EDA Suite
libeditframe.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) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 2008-2017 Wayne Stambaugh <stambaughw@verizon.net>
6  * Copyright (C) 2004-2017 KiCad Developers, see AUTHORS.txt for contributors.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, you may find one here:
20  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21  * or you may search the http://www.gnu.org website for the version 2 license,
22  * or you may write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24  */
25 
31 #include <fctsys.h>
32 #include <pgm_base.h>
33 #include <kiface_i.h>
34 #include <class_drawpanel.h>
35 #include <confirm.h>
36 #include <eda_doc.h>
37 #include <gr_basic.h>
38 #include <schframe.h>
39 #include <msgpanel.h>
40 
41 #include <general.h>
42 #include <eeschema_id.h>
43 #include <libeditframe.h>
44 #include <class_library.h>
45 #include <lib_polyline.h>
46 #include <lib_pin.h>
47 
48 #include <kicad_device_context.h>
49 #include <hotkeys.h>
50 
54 
55 #include <menus_helpers.h>
56 
57 
58 /* This method guarantees unique IDs for the library this run of Eeschema
59  * which prevents ID conflicts and eliminates the need to recompile every
60  * source file in the project when adding IDs to include/id.h. */
61 int ExportPartId = ::wxNewId();
62 int ImportPartId = ::wxNewId();
63 int CreateNewLibAndSavePartId = ::wxNewId();
64 
65 
72 wxSize LIB_EDIT_FRAME:: m_clientSize = wxSize( -1, -1 );
76 
77 // these values are overridden when reading the config
81 
83 
84 
85 BEGIN_EVENT_TABLE( LIB_EDIT_FRAME, EDA_DRAW_FRAME )
86  EVT_CLOSE( LIB_EDIT_FRAME::OnCloseWindow )
87  EVT_SIZE( LIB_EDIT_FRAME::OnSize )
88  EVT_ACTIVATE( LIB_EDIT_FRAME::OnActivate )
89 
90  // Main horizontal toolbar.
91  EVT_TOOL( ID_LIBEDIT_SAVE_CURRENT_LIB, LIB_EDIT_FRAME::OnSaveActiveLibrary )
92  EVT_TOOL( ID_LIBEDIT_SELECT_CURRENT_LIB, LIB_EDIT_FRAME::Process_Special_Functions )
94  EVT_TOOL( ID_TO_LIBVIEW, LIB_EDIT_FRAME::OnOpenLibraryViewer )
95  EVT_TOOL( ID_LIBEDIT_NEW_PART, LIB_EDIT_FRAME::CreateNewLibraryPart )
96  EVT_TOOL( ID_LIBEDIT_NEW_PART_FROM_EXISTING, LIB_EDIT_FRAME::OnCreateNewPartFromExisting )
97 
98  EVT_TOOL( ID_LIBEDIT_SELECT_PART, LIB_EDIT_FRAME::LoadOneLibraryPart )
99  EVT_TOOL( wxID_UNDO, LIB_EDIT_FRAME::GetComponentFromUndoList )
100  EVT_TOOL( wxID_REDO, LIB_EDIT_FRAME::GetComponentFromRedoList )
101  EVT_TOOL( ID_LIBEDIT_GET_FRAME_EDIT_PART, LIB_EDIT_FRAME::OnEditComponentProperties )
102  EVT_TOOL( ID_LIBEDIT_GET_FRAME_EDIT_FIELDS, LIB_EDIT_FRAME::InstallFieldsEditorDialog )
103  EVT_TOOL( ID_LIBEDIT_CHECK_PART, LIB_EDIT_FRAME::OnCheckComponent )
104  EVT_TOOL( ID_DE_MORGAN_NORMAL_BUTT, LIB_EDIT_FRAME::OnSelectBodyStyle )
105  EVT_TOOL( ID_DE_MORGAN_CONVERT_BUTT, LIB_EDIT_FRAME::OnSelectBodyStyle )
106  EVT_TOOL( ID_LIBEDIT_VIEW_DOC, LIB_EDIT_FRAME::OnViewEntryDoc )
107  EVT_TOOL( ID_LIBEDIT_EDIT_PIN_BY_PIN, LIB_EDIT_FRAME::Process_Special_Functions )
109  EVT_TOOL( ExportPartId, LIB_EDIT_FRAME::OnExportPart )
111  EVT_TOOL( ImportPartId, LIB_EDIT_FRAME::OnImportPart )
113 
114  EVT_COMBOBOX( ID_LIBEDIT_SELECT_PART_NUMBER, LIB_EDIT_FRAME::OnSelectPart )
115  EVT_COMBOBOX( ID_LIBEDIT_SELECT_ALIAS, LIB_EDIT_FRAME::OnSelectAlias )
116 
117  // Right vertical toolbar.
119  EVT_TOOL( ID_ZOOM_SELECTION, LIB_EDIT_FRAME::OnSelectTool )
121  LIB_EDIT_FRAME::OnSelectTool )
122 
123  // Left vertical toolbar (option toolbar).
125 
126  // menubar commands
127  EVT_MENU( wxID_EXIT, LIB_EDIT_FRAME::CloseWindow )
129  EVT_MENU( ID_LIBEDIT_GEN_PNG_FILE, LIB_EDIT_FRAME::OnPlotCurrentComponent )
130  EVT_MENU( ID_LIBEDIT_GEN_SVG_FILE, LIB_EDIT_FRAME::OnPlotCurrentComponent )
131  EVT_MENU( wxID_HELP, EDA_DRAW_FRAME::GetKicadHelp )
132  EVT_MENU( wxID_INDEX, EDA_DRAW_FRAME::GetKicadHelp )
133  EVT_MENU( ID_HELP_GET_INVOLVED, EDA_DRAW_FRAME::GetKicadContribute )
134  EVT_MENU( wxID_ABOUT, EDA_BASE_FRAME::GetKicadAbout )
135 
136  EVT_MENU( wxID_PREFERENCES, LIB_EDIT_FRAME::OnPreferencesOptions )
137  EVT_MENU( ID_CONFIG_REQ, LIB_EDIT_FRAME::InstallConfigFrame )
138 
139  // Multiple item selection context menu commands.
141 
143  LIB_EDIT_FRAME::Process_Config )
144 
145  // Context menu events and commands.
148 
151  LIB_EDIT_FRAME::Process_Special_Functions )
152 
154  LIB_EDIT_FRAME::Process_Special_Functions )
155 
157  LIB_EDIT_FRAME::OnOrient )
158  // Update user interface elements.
159  EVT_UPDATE_UI( ExportPartId, LIB_EDIT_FRAME::OnUpdateEditingPart )
160  EVT_UPDATE_UI( CreateNewLibAndSavePartId, LIB_EDIT_FRAME::OnUpdateEditingPart )
161  EVT_UPDATE_UI( ID_LIBEDIT_SAVE_CURRENT_PART, LIB_EDIT_FRAME::OnUpdateEditingPart )
162  EVT_UPDATE_UI( ID_LIBEDIT_GET_FRAME_EDIT_FIELDS, LIB_EDIT_FRAME::OnUpdateEditingPart )
163  EVT_UPDATE_UI( ID_LIBEDIT_CHECK_PART, LIB_EDIT_FRAME::OnUpdateEditingPart )
164  EVT_UPDATE_UI( ID_LIBEDIT_GET_FRAME_EDIT_PART, LIB_EDIT_FRAME::OnUpdateEditingPart )
165  EVT_UPDATE_UI( ID_LIBEDIT_NEW_PART_FROM_EXISTING, LIB_EDIT_FRAME::OnUpdateEditingPart )
166  EVT_UPDATE_UI( wxID_UNDO, LIB_EDIT_FRAME::OnUpdateUndo )
167  EVT_UPDATE_UI( wxID_REDO, LIB_EDIT_FRAME::OnUpdateRedo )
168  EVT_UPDATE_UI( ID_LIBEDIT_SAVE_CURRENT_LIB, LIB_EDIT_FRAME::OnUpdateSaveCurrentLib )
169  EVT_UPDATE_UI( ID_LIBEDIT_SAVE_CURRENT_LIB_AS, LIB_EDIT_FRAME::OnUpdateSaveCurrentLib )
170  EVT_UPDATE_UI( ID_LIBEDIT_VIEW_DOC, LIB_EDIT_FRAME::OnUpdateViewDoc )
171  EVT_UPDATE_UI( ID_LIBEDIT_EDIT_PIN_BY_PIN, LIB_EDIT_FRAME::OnUpdatePinByPin )
172  EVT_UPDATE_UI( ID_LIBEDIT_EDIT_PIN_BY_TABLE, LIB_EDIT_FRAME::OnUpdatePinTable )
173  EVT_UPDATE_UI( ID_LIBEDIT_SELECT_PART_NUMBER, LIB_EDIT_FRAME::OnUpdatePartNumber )
174  EVT_UPDATE_UI( ID_LIBEDIT_SELECT_ALIAS, LIB_EDIT_FRAME::OnUpdateSelectAlias )
175  EVT_UPDATE_UI( ID_DE_MORGAN_NORMAL_BUTT, LIB_EDIT_FRAME::OnUpdateDeMorganNormal )
176  EVT_UPDATE_UI( ID_DE_MORGAN_CONVERT_BUTT, LIB_EDIT_FRAME::OnUpdateDeMorganConvert )
177  EVT_UPDATE_UI( ID_NO_TOOL_SELECTED, LIB_EDIT_FRAME::OnUpdateSelectTool )
178  EVT_UPDATE_UI( ID_ZOOM_SELECTION, LIB_EDIT_FRAME::OnUpdateSelectTool )
179  EVT_UPDATE_UI_RANGE( ID_LIBEDIT_PIN_BUTT, ID_LIBEDIT_DELETE_ITEM_BUTT,
180  LIB_EDIT_FRAME::OnUpdateEditingPart )
181  EVT_UPDATE_UI( ID_LIBEDIT_SHOW_ELECTRICAL_TYPE, LIB_EDIT_FRAME::OnUpdateElectricalType )
182 
183 END_EVENT_TABLE()
184 
185 #define LIB_EDIT_FRAME_NAME wxT( "LibeditFrame" )
186 
187 LIB_EDIT_FRAME::LIB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
188  SCH_BASE_FRAME( aKiway, aParent, FRAME_SCH_LIB_EDITOR, _( "Library Editor" ),
189  wxDefaultPosition, wxDefaultSize, KICAD_DEFAULT_DRAWFRAME_STYLE, LIB_EDIT_FRAME_NAME )
190 {
191  m_showAxis = true; // true to draw axis
192  SetShowDeMorgan( false );
193  m_drawSpecificConvert = true;
194  m_drawSpecificUnit = false;
198  SetShowElectricalType( true );
199 
200  m_my_part = NULL;
201  m_tempCopyComponent = NULL;
202 
203  // Delayed initialization
204  if( m_textSize == -1 )
206 
207  // Initialize grid id to the default value 50 mils:
209 
210  wxIcon icon;
211  icon.CopyFromBitmap( KiBitmap( icon_libedit_xpm ) );
212  SetIcon( icon );
213 
214  LoadSettings( config() );
215 
216  SetScreen( new SCH_SCREEN( aKiway ) );
217  GetScreen()->m_Center = true;
219 
220  SetCrossHairPosition( wxPoint( 0, 0 ) );
221 
222  // Ensure m_LastGridSizeId is an offset inside the allowed schematic range
223  if( m_LastGridSizeId < ID_POPUP_GRID_LEVEL_50 - ID_POPUP_GRID_LEVEL_1000 )
225 
226  if( m_LastGridSizeId > ID_POPUP_GRID_LEVEL_1 - ID_POPUP_GRID_LEVEL_1000 )
228 
229  SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
230 
231  GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId );
232 
233  if( m_canvas )
235 
236  ReCreateMenuBar();
239 
240  // Ensure the current alias name is valid if a part is loaded
241  // Sometimes it is not valid. This is the case
242  // when a part value (the part lib name), or the alias list was modified
243  // during a previous session and the modifications not saved in lib.
244  // Reopen libedit in a new session gives a non valid m_aliasName
245  // because the curr part is reloaded from the library (and this is the unmodified part)
246  // and the old alias name (from the previous edition) can be invalid
247  LIB_PART* part = GetCurPart();
248 
249  if( part == NULL )
250  m_aliasName.Empty();
251  else if( m_aliasName != part->GetName() )
252  {
253  LIB_ALIAS* alias = part->GetAlias( m_aliasName );
254 
255  if( !alias )
256  m_aliasName = part->GetName();
257  }
258 
259 
261  DisplayLibInfos();
262  DisplayCmpDoc();
265 
266  m_auimgr.SetManagedWindow( this );
267 
268  EDA_PANEINFO horiz;
269  horiz.HorizontalToolbarPane();
270 
271  EDA_PANEINFO vert;
272  vert.VerticalToolbarPane();
273 
274  EDA_PANEINFO mesg;
275  mesg.MessageToolbarPane();
276 
277  m_auimgr.AddPane( m_mainToolBar,
278  wxAuiPaneInfo( horiz ).Name( "m_mainToolBar" ).Top().Row( 0 ) );
279 
280  m_auimgr.AddPane( m_drawToolBar,
281  wxAuiPaneInfo( vert ).Name( "m_VToolBar" ).Right() );
282 
283  m_auimgr.AddPane( m_optionsToolBar,
284  wxAuiPaneInfo( vert ).Name( "m_optionsToolBar" ).Left() );
285 
286  m_auimgr.AddPane( m_canvas,
287  wxAuiPaneInfo().Name( "DrawFrame" ).CentrePane() );
288 
289  m_auimgr.AddPane( m_messagePanel,
290  wxAuiPaneInfo( mesg ).Name( "MsgPanel" ).Bottom().Layer(10) );
291 
292  m_auimgr.Update();
293 
294  Raise();
295  Show( true );
296 
297  wxCommandEvent evt( wxEVT_COMMAND_MENU_SELECTED, ID_ZOOM_PAGE );
298  wxPostEvent( this, evt );
299 }
300 
301 
303 {
304  m_drawItem = m_lastDrawItem = NULL;
305 
306  delete m_tempCopyComponent;
307  delete m_my_part;
308  m_my_part = NULL;
309  m_tempCopyComponent = NULL;
310 }
311 
312 
314 {
315  m_drawItem = drawItem;
316 }
317 
318 
319 void LIB_EDIT_FRAME::OnCloseWindow( wxCloseEvent& Event )
320 {
321  if( GetScreen()->IsModify() )
322  {
323  int ii = DisplayExitDialog( this, _( "Save the changes in the library before closing?" ) );
324 
325  switch( ii )
326  {
327  case wxID_NO:
328  break;
329 
330  case wxID_YES:
331  if ( this->SaveActiveLibrary( false ) )
332  break;
333 
334  // fall through: cancel the close because of an error
335 
336  case wxID_CANCEL:
337  Event.Veto();
338  return;
339  }
340  GetScreen()->ClrModify();
341  }
342 
343  PART_LIBS* libs = Prj().SchLibs();
344 
345  for( const PART_LIB& lib : *libs )
346  {
347  if( lib.IsModified() )
348  {
349  wxString msg = wxString::Format( _(
350  "Library '%s' was modified!\nDiscard changes?" ),
351  GetChars( lib.GetName() )
352  );
353 
354  if( !IsOK( this, msg ) )
355  {
356  Event.Veto();
357  return;
358  }
359  }
360  }
361 
362  Destroy();
363 }
364 
365 
367 {
368  /* Please, note: wxMSW before version 2.9 seems have
369  * problems with zoom values < 1 ( i.e. userscale > 1) and needs to be patched:
370  * edit file <wxWidgets>/src/msw/dc.cpp
371  * search for line static const int VIEWPORT_EXTENT = 1000;
372  * and replace by static const int VIEWPORT_EXTENT = 10000;
373  */
374  int dx, dy;
375 
376  LIB_PART* part = GetCurPart();
377 
378  if( part )
379  {
381 
382  dx = boundingBox.GetWidth();
383  dy = boundingBox.GetHeight();
384  SetScrollCenterPosition( wxPoint( 0, 0 ) );
385  }
386  else
387  {
388  const PAGE_INFO& pageInfo = GetScreen()->GetPageSettings();
389 
390  dx = pageInfo.GetSizeIU().x;
391  dy = pageInfo.GetSizeIU().y;
392 
393  SetScrollCenterPosition( wxPoint( 0, 0 ) );
394  }
395 
396  wxSize size = m_canvas->GetClientSize();
397 
398  // Reserve a 10% margin around component bounding box.
399  double margin_scale_factor = 0.8;
400  double zx =(double) dx / ( margin_scale_factor * (double)size.x );
401  double zy = (double) dy / ( margin_scale_factor * (double)size.y );
402 
403  double bestzoom = std::max( zx, zy );
404 
405  // keep it >= minimal existing zoom (can happen for very small components
406  // for instance when starting a new component
407  if( bestzoom < GetScreen()->m_ZoomList[0] )
408  bestzoom = GetScreen()->m_ZoomList[0];
409 
410  return bestzoom;
411 }
412 
413 
415 {
416  if( m_aliasSelectBox == NULL )
417  return;
418 
419  m_aliasSelectBox->Clear();
420 
421  LIB_PART* part = GetCurPart();
422 
423  if( !part )
424  return;
425 
426  m_aliasSelectBox->Append( part->GetAliasNames() );
427  m_aliasSelectBox->SetSelection( 0 );
428 
429  int index = m_aliasSelectBox->FindString( m_aliasName );
430 
431  if( index != wxNOT_FOUND )
432  m_aliasSelectBox->SetSelection( index );
433 }
434 
435 
437 {
438  if( m_partSelectBox == NULL )
439  return;
440 
441  if( m_partSelectBox->GetCount() != 0 )
442  m_partSelectBox->Clear();
443 
444  LIB_PART* part = GetCurPart();
445 
446  if( !part || part->GetUnitCount() <= 1 )
447  {
448  m_unit = 1;
449  m_partSelectBox->Append( wxEmptyString );
450  }
451  else
452  {
453  for( int i = 0; i < part->GetUnitCount(); i++ )
454  {
455  wxString sub = LIB_PART::SubReference( i+1, false );
456  wxString unit = wxString::Format( _( "Unit %s" ), GetChars( sub ) );
457  m_partSelectBox->Append( unit );
458  }
459  }
460 
461  // Ensure the current selected unit is compatible with
462  // the number of units of the current part:
463  if( part && part->GetUnitCount() < m_unit )
464  m_unit = 1;
465 
466  m_partSelectBox->SetSelection( ( m_unit > 0 ) ? m_unit - 1 : 0 );
467 }
468 
469 
470 void LIB_EDIT_FRAME::OnShowElectricalType( wxCommandEvent& event )
471 {
473  GetCanvas()->Refresh();
474 }
475 
476 
477 void LIB_EDIT_FRAME::OnUpdateSelectTool( wxUpdateUIEvent& aEvent )
478 {
479  aEvent.Check( GetToolId() == aEvent.GetId() );
480 }
481 
482 
483 void LIB_EDIT_FRAME::OnUpdateElectricalType( wxUpdateUIEvent& aEvent )
484 {
485  aEvent.Check( GetShowElectricalType() );
486 }
487 
488 
489 void LIB_EDIT_FRAME::OnUpdateEditingPart( wxUpdateUIEvent& aEvent )
490 {
491  LIB_PART* part = GetCurPart();
492 
493  aEvent.Enable( part != NULL );
494 
495  if( part && aEvent.GetEventObject() == m_drawToolBar )
496  aEvent.Check( GetToolId() == aEvent.GetId() );
497 }
498 
499 
500 void LIB_EDIT_FRAME::OnUpdateNotEditingPart( wxUpdateUIEvent& event )
501 {
502  event.Enable( !GetCurPart() );
503 }
504 
505 
506 void LIB_EDIT_FRAME::OnUpdateUndo( wxUpdateUIEvent& event )
507 {
508  event.Enable( GetCurPart() && GetScreen() &&
509  GetScreen()->GetUndoCommandCount() != 0 && !IsEditingDrawItem() );
510 }
511 
512 
513 void LIB_EDIT_FRAME::OnUpdateRedo( wxUpdateUIEvent& event )
514 {
515  event.Enable( GetCurPart() && GetScreen() &&
516  GetScreen()->GetRedoCommandCount() != 0 && !IsEditingDrawItem() );
517 }
518 
519 
520 void LIB_EDIT_FRAME::OnUpdateSaveCurrentLib( wxUpdateUIEvent& event )
521 {
522  PART_LIB* lib = GetCurLib();
523 
524  event.Enable( lib && !lib->IsReadOnly()
525  && ( lib->IsModified() || GetScreen()->IsModify() ) );
526 }
527 
528 
529 void LIB_EDIT_FRAME::OnUpdateViewDoc( wxUpdateUIEvent& event )
530 {
531  bool enable = false;
532 
533  PART_LIB* lib = GetCurLib();
534  LIB_PART* part = GetCurPart();
535 
536  if( part && lib )
537  {
538  LIB_ALIAS* alias = part->GetAlias( m_aliasName );
539 
540  wxCHECK_RET( alias != NULL, wxT( "Alias <" ) + m_aliasName + wxT( "> not found." ) );
541 
542  enable = !alias->GetDocFileName().IsEmpty();
543  }
544 
545  event.Enable( enable );
546 }
547 
548 
549 void LIB_EDIT_FRAME::OnUpdatePinByPin( wxUpdateUIEvent& event )
550 {
551  LIB_PART* part = GetCurPart();
552 
553  event.Enable( part && ( part->GetUnitCount() > 1 || m_showDeMorgan ) );
554 
555  event.Check( m_editPinsPerPartOrConvert );
556 }
557 
558 
559 void LIB_EDIT_FRAME::OnUpdatePinTable( wxUpdateUIEvent& event )
560 {
561  LIB_PART* part = GetCurPart();
562  event.Enable( part != NULL );
563 }
564 
565 
566 void LIB_EDIT_FRAME::OnUpdatePartNumber( wxUpdateUIEvent& event )
567 {
568  if( m_partSelectBox == NULL )
569  return;
570 
571  LIB_PART* part = GetCurPart();
572 
573  // Using the typical event.Enable() call doesn't seem to work with wxGTK
574  // so use the pointer to alias combobox to directly enable or disable.
575  m_partSelectBox->Enable( part && part->GetUnitCount() > 1 );
576 }
577 
578 
579 void LIB_EDIT_FRAME::OnUpdateDeMorganNormal( wxUpdateUIEvent& event )
580 {
581  if( m_mainToolBar == NULL )
582  return;
583 
584  LIB_PART* part = GetCurPart();
585 
586  event.Enable( GetShowDeMorgan() || ( part && part->HasConversion() ) );
587  event.Check( m_convert <= 1 );
588 }
589 
590 
591 void LIB_EDIT_FRAME::OnUpdateDeMorganConvert( wxUpdateUIEvent& event )
592 {
593  if( m_mainToolBar == NULL )
594  return;
595 
596  LIB_PART* part = GetCurPart();
597 
598  event.Enable( GetShowDeMorgan() || ( part && part->HasConversion() ) );
599  event.Check( m_convert > 1 );
600 }
601 
602 
603 void LIB_EDIT_FRAME::OnUpdateSelectAlias( wxUpdateUIEvent& event )
604 {
605  if( m_aliasSelectBox == NULL )
606  return;
607 
608  LIB_PART* part = GetCurPart();
609 
610  // Using the typical event.Enable() call doesn't seem to work with wxGTK
611  // so use the pointer to alias combobox to directly enable or disable.
612  m_aliasSelectBox->Enable( part && part->GetAliasCount() > 1 );
613 }
614 
615 
616 void LIB_EDIT_FRAME::OnSelectAlias( wxCommandEvent& event )
617 {
618  if( m_aliasSelectBox == NULL
619  || ( m_aliasSelectBox->GetStringSelection().CmpNoCase( m_aliasName ) == 0) )
620  return;
621 
622  m_lastDrawItem = NULL;
623  m_aliasName = m_aliasSelectBox->GetStringSelection();
624 
625  DisplayCmpDoc();
626  m_canvas->Refresh();
627 }
628 
629 
630 void LIB_EDIT_FRAME::OnSelectPart( wxCommandEvent& event )
631 {
632  int i = event.GetSelection();
633 
634  if( ( i == wxNOT_FOUND ) || ( ( i + 1 ) == m_unit ) )
635  return;
636 
637  m_lastDrawItem = NULL;
638  m_unit = i + 1;
639  m_canvas->Refresh();
640  DisplayCmpDoc();
641 }
642 
643 
644 void LIB_EDIT_FRAME::OnViewEntryDoc( wxCommandEvent& event )
645 {
646  LIB_PART* part = GetCurPart();
647 
648  if( !part )
649  return;
650 
651  wxString fileName;
652  LIB_ALIAS* alias = part->GetAlias( m_aliasName );
653 
654  wxCHECK_RET( alias != NULL, "Alias not found." );
655 
656  fileName = alias->GetDocFileName();
657 
658  if( !fileName.IsEmpty() )
659  {
660  SEARCH_STACK* lib_search = Prj().SchSearchS();
661 
662  GetAssociatedDocument( this, fileName, lib_search );
663  }
664 }
665 
666 
667 void LIB_EDIT_FRAME::OnSelectBodyStyle( wxCommandEvent& event )
668 {
669  m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor() );
670 
671  if( event.GetId() == ID_DE_MORGAN_NORMAL_BUTT )
672  m_convert = 1;
673  else
674  m_convert = 2;
675 
676  m_lastDrawItem = NULL;
677  m_canvas->Refresh();
678 }
679 
680 
681 void LIB_EDIT_FRAME::OnSaveCurrentPart( wxCommandEvent& aEvent )
682 {
683  LIB_PART* part = GetCurPart();
684 
685  if( !part )
686  {
687  DisplayError( this, _( "No part to save." ) );
688  return;
689  }
690 
691  PART_LIB* lib = GetCurLib();
692 
693  if( !lib )
695 
696  lib = GetCurLib();
697 
698  if( !lib )
699  {
700  DisplayError( this, _( "No library specified." ) );
701  return;
702  }
703 
704  try
705  {
706  SaveOnePart( lib );
707  }
708  catch( ... )
709  {
710  wxString msg;
711  msg.Printf( _( "Unexpected error occured saving symbol '%s' to symbol library '%s'." ),
712  part->GetName(), lib->GetName() );
713  DisplayError( this, msg );
714  return;
715  }
716 
718 }
719 
720 
721 void LIB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
722 {
723  int id = event.GetId();
724  wxPoint pos;
725 
727 
728  wxGetMousePosition( &pos.x, &pos.y );
729  pos.y += 20;
730 
731  switch( id ) // Stop placement commands before handling new command.
732  {
734  case ID_LIBEDIT_EDIT_PIN:
740  case ID_POPUP_ZOOM_BLOCK:
742  case ID_POPUP_COPY_BLOCK:
748  case ID_POPUP_LIBEDIT_DELETE_CURRENT_POLY_SEGMENT:
749  break;
750 
752  if( m_canvas->IsMouseCaptured() )
754  else
755  m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor() );
756  break;
757 
760  break;
761 
762  default:
763  m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor(),
764  wxEmptyString );
765  break;
766  }
767 
769 
770  switch( id )
771  {
773  break;
774 
775  case ID_LIBEDIT_SELECT_CURRENT_LIB:
777  break;
778 
779  case ID_LIBEDIT_EDIT_PIN_BY_PIN:
780  m_editPinsPerPartOrConvert = m_mainToolBar->GetToolToggled( ID_LIBEDIT_EDIT_PIN_BY_PIN );
781  break;
782 
785  if( m_drawItem )
786  {
787  EndDrawGraphicItem( &dc );
788  }
789  break;
790 
792  if( m_drawItem )
793  {
794  m_canvas->CrossHairOff( &dc );
795 
796  switch( m_drawItem->Type() )
797  {
798  case LIB_ARC_T:
799  case LIB_CIRCLE_T:
800  case LIB_RECTANGLE_T:
801  case LIB_POLYLINE_T:
803  break;
804 
805  case LIB_TEXT_T:
806  EditSymbolText( &dc, m_drawItem );
807  break;
808 
809  default:
810  ;
811  }
812 
813  m_canvas->CrossHairOn( &dc );
814  }
815  break;
816 
817  case ID_POPUP_LIBEDIT_DELETE_CURRENT_POLY_SEGMENT:
818  {
819  // Delete the last created segment, while creating a polyline draw item
820  if( m_drawItem == NULL )
821  break;
822 
824  STATUS_FLAGS oldFlags = m_drawItem->GetFlags();
826  m_drawItem->Draw( m_canvas, &dc, wxPoint( 0, 0 ), COLOR4D::UNSPECIFIED, g_XorMode, NULL,
828  ( (LIB_POLYLINE*) m_drawItem )->DeleteSegment( GetCrossHairPosition( true ) );
829  m_drawItem->Draw( m_canvas, &dc, wxPoint( 0, 0 ), COLOR4D::UNSPECIFIED, g_XorMode, NULL,
831  m_drawItem->SetFlags( oldFlags );
832  m_lastDrawItem = NULL;
833  }
834  break;
835 
837  if( m_drawItem )
838  deleteItem( &dc );
839 
840  break;
841 
843  if( m_drawItem == NULL )
844  break;
845 
846  if( m_drawItem->Type() == LIB_PIN_T )
847  StartMovePin( &dc );
848  else
849  StartMoveDrawSymbol( &dc );
850  break;
851 
853 
854  if( m_drawItem == NULL )
855  break;
856 
859  || m_drawItem->Type() == LIB_CIRCLE_T
861  || m_drawItem->Type() == LIB_ARC_T
862  )
863  {
864  StartModifyDrawSymbol( &dc );
865  }
866 
867  break;
868 
870  if( m_drawItem == NULL )
871  break;
872 
873  m_canvas->CrossHairOff( &dc );
874 
875  if( m_drawItem->Type() == LIB_FIELD_T )
876  {
878  }
879 
881  m_canvas->CrossHairOn( &dc );
882  break;
883 
887  {
888  if( !m_drawItem || m_drawItem->Type() != LIB_PIN_T )
889  break;
890 
891  LIB_PART* part = GetCurPart();
892 
893  SaveCopyInUndoList( part );
894 
895  GlobalSetPins( (LIB_PIN*) m_drawItem, id );
897  m_canvas->Refresh();
898  }
899  break;
900 
901  case ID_POPUP_ZOOM_BLOCK:
902  m_canvas->SetAutoPanRequest( false );
904  HandleBlockEnd( &dc );
905  break;
906 
908  m_canvas->SetAutoPanRequest( false );
911  HandleBlockEnd( &dc );
912  break;
913 
914  case ID_POPUP_COPY_BLOCK:
915  m_canvas->SetAutoPanRequest( false );
918  HandleBlockEnd( &dc );
919  break;
920 
922  m_canvas->SetAutoPanRequest( false );
925  HandleBlockEnd( &dc );
926  break;
927 
929  m_canvas->SetAutoPanRequest( false );
932  HandleBlockPlace( &dc );
933  break;
934 
936  m_canvas->SetAutoPanRequest( false );
939  HandleBlockPlace( &dc );
940  break;
941 
943  m_canvas->SetAutoPanRequest( false );
946  HandleBlockPlace( &dc );
947  break;
948 
950  m_canvas->SetAutoPanRequest( false );
952  HandleBlockPlace( &dc );
953  break;
954 
955  default:
956  DisplayError( this, "LIB_EDIT_FRAME::Process_Special_Functions error" );
957  break;
958  }
959 
960  m_canvas->SetIgnoreMouseEvents( false );
961 
962  if( GetToolId() == ID_NO_TOOL_SELECTED )
963  m_lastDrawItem = NULL;
964 }
965 
966 
967 void LIB_EDIT_FRAME::OnActivate( wxActivateEvent& event )
968 {
970 }
971 
972 
974 {
976 
977  if( !!name )
978  {
979  PART_LIB* lib = Prj().SchLibs()->FindLibrary( name );
980 
981  if( !lib )
982  Prj().SetRString( PROJECT::SCH_LIBEDIT_CUR_LIB, wxEmptyString );
983 
984  return lib;
985  }
986 
987  return NULL;
988 }
989 
990 
992 {
993  PART_LIB* old = GetCurLib();
994 
995  if( !aLib || !aLib->GetName() )
996  Prj().SetRString( PROJECT::SCH_LIBEDIT_CUR_LIB, wxEmptyString );
997  else
999 
1000  return old;
1001 }
1002 
1003 
1005 {
1006  if( !m_my_part )
1007  {
1009  LIB_PART* part;
1010 
1011  if( !!name && ( part = Prj().SchLibs()->FindLibPart( LIB_ID( wxEmptyString, name ) ) ) )
1012  {
1013  // clone it from the PART_LIB and own it.
1014  m_my_part = new LIB_PART( *part );
1015  }
1016  else
1017  Prj().SetRString( PROJECT::SCH_LIBEDIT_CUR_PART, wxEmptyString );
1018  }
1019 
1020  return m_my_part;
1021 }
1022 
1023 
1025 {
1026  delete m_my_part;
1027  m_my_part = aPart; // take ownership here
1028 
1029  // retain in case this wxFrame is re-opened later on the same PROJECT
1031  aPart ? aPart->GetName() : wxString() );
1032 }
1033 
1034 
1036 {
1037  delete m_tempCopyComponent;
1038 
1039  if( LIB_PART* part = GetCurPart() )
1040  // clone it and own the clone.
1041  m_tempCopyComponent = new LIB_PART( *part );
1042  else
1043  // clear it, there was no CurPart
1044  m_tempCopyComponent = NULL;
1045 }
1046 
1047 
1049 {
1050  if( m_tempCopyComponent )
1051  {
1052  // transfer ownership to CurPart
1054  m_tempCopyComponent = NULL;
1055  }
1056 }
1057 
1058 
1060 {
1061  delete m_tempCopyComponent;
1062  m_tempCopyComponent = NULL;
1063 }
1064 
1065 
1066 void LIB_EDIT_FRAME::EditSymbolText( wxDC* DC, LIB_ITEM* DrawItem )
1067 {
1068  if ( ( DrawItem == NULL ) || ( DrawItem->Type() != LIB_TEXT_T ) )
1069  return;
1070 
1071  // Deleting old text
1072  if( DC && !DrawItem->InEditMode() )
1073  DrawItem->Draw( m_canvas, DC, wxPoint( 0, 0 ), COLOR4D::UNSPECIFIED, g_XorMode, NULL,
1074  DefaultTransform );
1075 
1076  DIALOG_LIB_EDIT_TEXT* frame = new DIALOG_LIB_EDIT_TEXT( this, (LIB_TEXT*) DrawItem );
1077  frame->ShowModal();
1078  frame->Destroy();
1079  OnModify();
1080 
1081  // Display new text
1082  if( DC && !DrawItem->InEditMode() )
1083  DrawItem->Draw( m_canvas, DC, wxPoint( 0, 0 ), COLOR4D::UNSPECIFIED, GR_DEFAULT_DRAWMODE,
1084  NULL, DefaultTransform );
1085 }
1086 
1087 
1088 void LIB_EDIT_FRAME::OnEditComponentProperties( wxCommandEvent& event )
1089 {
1090  bool partLocked = GetCurPart()->UnitsLocked();
1091 
1093 
1094  if( dlg.ShowModal() == wxID_CANCEL )
1095  return;
1096 
1097  if( partLocked != GetCurPart()->UnitsLocked() )
1098  {
1099  // m_editPinsPerPartOrConvert is set to the better value, if m_UnitSelectionLocked
1100  // has changed
1101  m_editPinsPerPartOrConvert = GetCurPart()->UnitsLocked() ? true : false;
1102  }
1103 
1106  DisplayLibInfos();
1107  DisplayCmpDoc();
1108  OnModify();
1109  m_canvas->Refresh();
1110 }
1111 
1112 
1113 void LIB_EDIT_FRAME::OnCreateNewPartFromExisting( wxCommandEvent& event )
1114 {
1115  LIB_PART* part = GetCurPart();
1116 
1117  wxCHECK_RET( part, "Cannot create new part from non-existent current part." );
1118 
1120  m_canvas->CrossHairOff( &dc );
1121 
1122  EditField( &part->GetValueField() );
1123 
1125  m_canvas->CrossHairOn( &dc );
1126 }
1127 
1128 
1129 void LIB_EDIT_FRAME::OnSelectTool( wxCommandEvent& aEvent )
1130 {
1131  int id = aEvent.GetId();
1132  int lastToolID = GetToolId();
1133 
1134  if( GetToolId() == ID_NO_TOOL_SELECTED || GetToolId() == ID_ZOOM_SELECTION )
1135  m_lastDrawItem = NULL;
1136 
1137  // Stop the current command and deselect the current tool.
1138  m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor() );
1139 
1140  LIB_PART* part = GetCurPart();
1141 
1142  switch( id )
1143  {
1144  case ID_NO_TOOL_SELECTED:
1145  SetToolID( id, m_canvas->GetDefaultCursor(), wxEmptyString );
1146  break;
1147 
1148  case ID_ZOOM_SELECTION:
1149  // This tool is located on the main toolbar: switch it on or off on click on it
1150  if( lastToolID != ID_ZOOM_SELECTION )
1151  SetToolID( ID_ZOOM_SELECTION, wxCURSOR_MAGNIFIER, _( "Zoom to selection" ) );
1152  else
1154  break;
1155 
1156  case ID_LIBEDIT_PIN_BUTT:
1157  if( part )
1158  {
1159  SetToolID( id, wxCURSOR_PENCIL, _( "Add pin" ) );
1160  }
1161  else
1162  {
1163  SetToolID( id, wxCURSOR_ARROW, _( "Set pin options" ) );
1164 
1165  wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
1166 
1167  cmd.SetId( ID_LIBEDIT_EDIT_PIN );
1168  GetEventHandler()->ProcessEvent( cmd );
1170  }
1171  break;
1172 
1174  SetToolID( id, wxCURSOR_PENCIL, _( "Add text" ) );
1175  break;
1176 
1178  SetToolID( id, wxCURSOR_PENCIL, _( "Add rectangle" ) );
1179  break;
1180 
1182  SetToolID( id, wxCURSOR_PENCIL, _( "Add circle" ) );
1183  break;
1184 
1186  SetToolID( id, wxCURSOR_PENCIL, _( "Add arc" ) );
1187  break;
1188 
1190  SetToolID( id, wxCURSOR_PENCIL, _( "Add line" ) );
1191  break;
1192 
1194  SetToolID( id, wxCURSOR_HAND, _( "Set anchor position" ) );
1195  break;
1196 
1198  SetToolID( id, m_canvas->GetDefaultCursor(), _( "Import" ) );
1199  LoadOneSymbol();
1201  break;
1202 
1204  SetToolID( id, m_canvas->GetDefaultCursor(), _( "Export" ) );
1205  SaveOneSymbol();
1207  break;
1208 
1209  case ID_LIBEDIT_DELETE_ITEM_BUTT:
1210  if( !part )
1211  {
1212  wxBell();
1213  break;
1214  }
1215 
1216  SetToolID( id, wxCURSOR_BULLSEYE, _( "Delete item" ) );
1217  break;
1218 
1219  default:
1220  break;
1221  }
1222 
1223  m_canvas->SetIgnoreMouseEvents( false );
1224 }
1225 
1226 
1227 void LIB_EDIT_FRAME::OnRotateItem( wxCommandEvent& aEvent )
1228 {
1229  if( m_drawItem == NULL )
1230  return;
1231 
1232  if( !m_drawItem->InEditMode() )
1233  {
1234  LIB_PART* part = GetCurPart();
1235 
1236  SaveCopyInUndoList( part );
1238  }
1239 
1240  m_drawItem->Rotate();
1241  OnModify();
1242 
1243  if( !m_drawItem->InEditMode() )
1245 
1246  m_canvas->Refresh();
1247 
1248  if( GetToolId() == ID_NO_TOOL_SELECTED )
1249  m_lastDrawItem = NULL;
1250 }
1251 
1252 
1253 void LIB_EDIT_FRAME::OnOrient( wxCommandEvent& aEvent )
1254 {
1256  SCH_SCREEN* screen = GetScreen();
1257  // Allows block rotate operation on hot key.
1258  if( screen->m_BlockLocate.GetState() != STATE_NO_BLOCK )
1259  {
1260  if( aEvent.GetId() == ID_LIBEDIT_MIRROR_X )
1261  {
1263  screen->m_BlockLocate.SetMessageBlock( this );
1265  HandleBlockEnd( &dc );
1266  }
1267  else if( aEvent.GetId() == ID_LIBEDIT_MIRROR_Y )
1268  {
1270  screen->m_BlockLocate.SetMessageBlock( this );
1272  HandleBlockEnd( &dc );
1273  }
1274  }
1275 }
1276 
1277 
1279  const KICAD_T aFilterList[] )
1280 {
1281  LIB_PART* part = GetCurPart();
1282 
1283  if( !part )
1284  return NULL;
1285 
1286  LIB_ITEM* item = locateItem( aPosition, aFilterList );
1287 
1288  wxPoint pos = GetNearestGridPosition( aPosition );
1289 
1290  if( item == NULL && aPosition != pos )
1291  item = locateItem( pos, aFilterList );
1292 
1293  return item;
1294 }
1295 
1296 
1297 LIB_ITEM* LIB_EDIT_FRAME::locateItem( const wxPoint& aPosition, const KICAD_T aFilterList[] )
1298 {
1299  LIB_PART* part = GetCurPart();
1300 
1301  if( !part )
1302  return NULL;
1303 
1304  LIB_ITEM* item = NULL;
1305 
1306  m_collectedItems.Collect( part->GetDrawItemList(), aFilterList, aPosition,
1307  m_unit, m_convert );
1308 
1309  if( m_collectedItems.GetCount() == 0 )
1310  {
1311  ClearMsgPanel();
1312  }
1313  else if( m_collectedItems.GetCount() == 1 )
1314  {
1315  item = m_collectedItems[0];
1316  }
1317  else
1318  {
1319  if( item == NULL )
1320  {
1321  wxASSERT_MSG( m_collectedItems.GetCount() <= MAX_SELECT_ITEM_IDS,
1322  "Select item clarification context menu size limit exceeded." );
1323 
1324  wxMenu selectMenu;
1325  AddMenuItem( &selectMenu, wxID_NONE, _( "Clarify Selection" ),
1326  KiBitmap( info_xpm ) );
1327 
1328  selectMenu.AppendSeparator();
1329 
1330  for( int i = 0; i < m_collectedItems.GetCount() && i < MAX_SELECT_ITEM_IDS; i++ )
1331  {
1332  wxString text = m_collectedItems[i]->GetSelectMenuText();
1333  BITMAP_DEF xpm = m_collectedItems[i]->GetMenuImage();
1334 
1335  AddMenuItem( &selectMenu, ID_SELECT_ITEM_START + i, text, KiBitmap( xpm ) );
1336  }
1337 
1338  // Set to NULL in case user aborts the clarification context menu.
1339  m_drawItem = NULL;
1340  m_canvas->SetAbortRequest( true ); // Changed to false if an item is selected
1341  PopupMenu( &selectMenu );
1343  item = m_drawItem;
1344  }
1345  }
1346 
1347  if( item )
1348  {
1349  MSG_PANEL_ITEMS items;
1350  item->GetMsgPanelInfo( items );
1351  SetMsgPanel( items );
1352  }
1353  else
1354  {
1355  ClearMsgPanel();
1356  }
1357 
1358  return item;
1359 }
1360 
1361 
1363 {
1364  wxCHECK_RET( m_drawItem != NULL, "No drawing item selected to delete." );
1365 
1366  m_canvas->CrossHairOff( aDC );
1367 
1368  LIB_PART* part = GetCurPart();
1369 
1370  SaveCopyInUndoList( part );
1371 
1372  if( m_drawItem->Type() == LIB_PIN_T )
1373  {
1374  LIB_PIN* pin = (LIB_PIN*) m_drawItem;
1375  wxPoint pos = pin->GetPosition();
1376 
1377  part->RemoveDrawItem( (LIB_ITEM*) pin, m_canvas, aDC );
1378 
1379  if( SynchronizePins() )
1380  {
1381  LIB_PIN* tmp = part->GetNextPin();
1382 
1383  while( tmp != NULL )
1384  {
1385  pin = tmp;
1386  tmp = part->GetNextPin( pin );
1387 
1388  if( pin->GetPosition() != pos )
1389  continue;
1390 
1391  part->RemoveDrawItem( (LIB_ITEM*) pin );
1392  }
1393  }
1394 
1395  m_canvas->Refresh();
1396  }
1397  else
1398  {
1399  if( m_canvas->IsMouseCaptured() )
1400  {
1401  m_canvas->CallEndMouseCapture( aDC );
1402  }
1403  else
1404  {
1405  part->RemoveDrawItem( m_drawItem, m_canvas, aDC );
1406  m_canvas->Refresh();
1407  }
1408  }
1409 
1410  m_drawItem = NULL;
1411  m_lastDrawItem = NULL;
1412  OnModify();
1413  m_canvas->CrossHairOn( aDC );
1414 }
1415 
1416 
1417 void LIB_EDIT_FRAME::OnSelectItem( wxCommandEvent& aEvent )
1418 {
1419  int id = aEvent.GetId();
1420  int index = id - ID_SELECT_ITEM_START;
1421 
1422  if( (id >= ID_SELECT_ITEM_START && id <= ID_SELECT_ITEM_END)
1423  && (index >= 0 && index < m_collectedItems.GetCount()) )
1424  {
1425  LIB_ITEM* item = m_collectedItems[index];
1426  m_canvas->SetAbortRequest( false );
1427  m_drawItem = item;
1428  }
1429 }
1430 
1431 
1432 void LIB_EDIT_FRAME::OnOpenPinTable( wxCommandEvent& aEvent )
1433 {
1434  LIB_PART* part = GetCurPart();
1435 
1436  DIALOG_LIB_EDIT_PIN_TABLE dlg( this, *part );
1437 
1438  if( dlg.ShowModal() == wxID_CANCEL )
1439  return;
1440 
1441  return;
1442 }
1443 
1444 
1446 {
1447  LIB_PART* part = GetCurPart();
1448 
1449  return !m_editPinsPerPartOrConvert && ( part &&
1450  ( part->HasConversion() || part->IsMulti() ) );
1451 }
1452 
1453 
1455 {
1456  // This is not the most effecient way to do this because the changed library may not have
1457  // any effect on the schematic symbol links. Since this is not called very often, take the
1458  // hit here rather than the myriad other places (including SCH_SCREEN::Draw()) where it was
1459  // being called.
1460  SCH_SCREENS schematic;
1461 
1462  schematic.UpdateSymbolLinks();
1463  schematic.TestDanglingEnds();
1464 
1465  // There may be no parent window so use KIWAY message to refresh the schematic editor
1466  // in case any symbols have changed.
1467  Kiway().ExpressMail( FRAME_SCH, MAIL_SCH_REFRESH, std::string( "" ), this );
1468 }
void OnViewEntryDoc(wxCommandEvent &event)
EDA_PANEINFO & HorizontalToolbarPane()
Function HorizontalToolbarPane Change *this to a horizontal toolbar for KiCad.
Definition: wxstruct.h:475
GR_DRAWMODE g_XorMode
Definition: gr_basic.cpp:51
int GetCount() const
Function GetCount returns the number of objects in the list.
KICAD_T Type() const
Function Type()
Definition: base_struct.h:198
#define TEXT_ANGLE_HORIZ
Frequent text rotations, used with {Set,Get}TextAngle(), in 0.1 degrees for now, hoping to migrate to...
Definition: common.h:91
#define KICAD_DEFAULT_DRAWFRAME_STYLE
Definition: wxstruct.h:55
void OnUpdateEditingPart(wxUpdateUIEvent &event)
bool UnitsLocked() const
void OnUpdatePartNumber(wxUpdateUIEvent &event)
#define DEFAULTPINLENGTH
The default pin number size when creating pins(can be changed in preference menu) ...
Definition: general.h:62
STATUS_FLAGS GetFlags() const
Definition: base_struct.h:255
void SaveOneSymbol()
Function SaveOneSymbol saves the current component to a symbol file.
Definition: symbedit.cpp:142
const EDA_RECT GetUnitBoundingBox(int aUnit, int aConvert) const
Function GetBoundingBox.
static double m_current_text_angle
Current text angle setting.
Definition: libeditframe.h:112
Part library alias object definition.
bool IsMulti() const
Function IsMulti.
KICAD_MANAGER_FRAME::Process_Config KICAD_MANAGER_FRAME::OnUpdatePreferredPdfBrowser EVT_UPDATE_UI_RANGE(ID_TO_SCH, ID_TO_PCB_FP_EDITOR, KICAD_MANAGER_FRAME::OnUpdateRequiresProject) enum hotkey_id_commnand
BLOCK_SELECTOR m_BlockLocate
Block description for block commands.
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_player.h:60
void StartMovePin(wxDC *DC)
Prepare the displacement of a pin.
Definition: pinedit.cpp:327
LIB_ITEMS & GetDrawItemList()
Return a reference to the draw item list.
PNG memory record (file in memory).
Definition: bitmap_types.h:38
PART_LIB * GetCurLib()
The current library being edited, or NULL if none.
#define MAX_SELECT_ITEM_IDS
The maximum number of items in the clarify selection context menu.
Definition: eeschema_id.h:41
bool HasConversion() const
Test if part has more than one body conversion type (DeMorgan).
static int m_convert
Definition: libeditframe.h:99
bool m_showAxis
True shows the X and Y axis indicators.
Definition: draw_frame.h:102
void RestoreComponent()
Function RestoreComponent Restore the current edited component from its temporary copy...
LIB_ALIAS * GetAlias(size_t aIndex)
virtual void Refresh(bool eraseBackground=true, const wxRect *rect=NULL) override
Definition: draw_panel.cpp:326
int ExportPartId
This file is part of the common library.
bool SaveActiveLibrary(bool newFile)
Function SaveActiveLibrary saves the changes to the current library.
Definition: libedit.cpp:302
EDA_DRAW_PANEL * GetCanvas()
Definition: draw_frame.h:299
static LIB_ITEM * m_drawItem
Definition: libeditframe.h:91
Class LIB_TEXT defines a component library graphical text item.
Definition: lib_text.h:45
void ClearTempCopyComponent()
Function ClearTempCopyComponent delete temporary copy of the current component and clear pointer...
wxMenuItem * AddMenuItem(wxMenu *aMenu, int aId, const wxString &aText, const wxBitmap &aImage, wxItemKind aType=wxITEM_NORMAL)
Function AddMenuItem is an inline helper function to create and insert a menu item with an icon into ...
Definition: bitmap.cpp:55
double BestZoom() override
Return the zoom level which displays the full page on screen.
This file is part of the common library.
void SetScreen(BASE_SCREEN *aScreen)
Definition: draw_frame.h:140
void SetScrollCenterPosition(const wxPoint &aPoint)
Class LIB_FIELD is used in symbol libraries.
Definition: lib_field.h:60
virtual void OnActivate(wxActivateEvent &event) override
Function OnActivate is called when the frame is activated.
void SetMessageBlock(EDA_DRAW_FRAME *frame)
Function SetMessageBlock Displays the type of block command in the status bar of the window...
void OnCloseWindow(wxCloseEvent &Event)
void OnUpdateUndo(wxUpdateUIEvent &event)
struct EDA_HOTKEY_CONFIG g_Libedit_Hokeys_Descr[]
SCH_SCREEN * GetScreen() const override
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
int ImportPartId
void OnUpdateSaveCurrentLib(wxUpdateUIEvent &event)
int GetHeight() const
void GlobalSetPins(LIB_PIN *aMasterPin, int aId)
Function GlobalSetPins.
Definition: pinedit.cpp:560
void EndMouseCapture(int aId=-1, int aCursorId=-1, const wxString &aTitle=wxEmptyString, bool aCallEndFunc=true)
Function EndMouseCapture ends mouse a capture.
bool InEditMode() const
Return the draw item editing mode status.
void OnUpdateRedo(wxUpdateUIEvent &event)
LIB_FIELD & GetValueField()
Return reference to the value field.
bool GetAssociatedDocument(wxWindow *aParent, const wxString &aDocName, const wxPathList *aPaths)
Function GetAssociatedDocument open a document (file) with the suitable browser.
Definition: eda_doc.cpp:86
virtual wxConfigBase * config()
Function config returns the wxConfigBase used in SaveSettings(), and is overloaded in KICAD_MANAGER_F...
Definition: basicframe.cpp:361
void OnModify()
Function OnModify Must be called after a schematic change in order to set the "modify" flag of the cu...
Definition: libeditframe.h:369
bool IsModify() const
void OnSelectBodyStyle(wxCommandEvent &event)
void OnUpdateDeMorganNormal(wxUpdateUIEvent &event)
void LoadOneSymbol()
Function LoadOneSymbol read a component symbol file (*.sym ) and add graphic items to the current com...
Definition: symbedit.cpp:46
Class SEARCH_STACK looks for files in a number of places.
Definition: search_stack.h:41
#define DEFAULT_REPEAT_OFFSET_PIN
the default value (overwritten by the eeschema config)
Definition: general.h:50
wxAuiManager m_auimgr
Definition: wxstruct.h:140
Class LIB_ID.
Definition: lib_id.h:56
size_t GetAliasCount() const
Class EDA_DRAW_FRAME is the base class for create windows for drawing purpose.
Definition: draw_frame.h:53
void MoveCursorToCrossHair()
Function MoveCursorToCrossHair warps the cursor to the current cross hair position.
Definition: draw_panel.cpp:348
void OnUpdateDeMorganConvert(wxUpdateUIEvent &event)
void UpdateAliasSelectList()
void SelectActiveLibrary(PART_LIB *aLibrary=NULL)
Function SelectActiveLibrary sets the current active library to aLibrary.
Definition: libedit.cpp:66
void CallEndMouseCapture(wxDC *aDC)
Function CallEndMouseCapture calls the end mouse capture callback.
LIB_PART * m_my_part
a part I own, it is not in any library, but a copy could be.
Definition: libeditframe.h:53
Specialization of the wxAuiPaneInfo class for KiCad panels.
Definition: wxstruct.h:466
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:90
virtual bool HandleBlockEnd(wxDC *DC) override
Function HandleBlockEnd performs a block end command.
Class LIB_ITEM is the base class for drawable items used by schematic library components.
Definition: lib_draw_item.h:77
void SetShowDeMorgan(bool show)
Definition: libeditframe.h:405
EVT_MENU(ID_SELECT_PREFERED_PDF_BROWSER_NAME, KICAD_MANAGER_FRAME::OnSelectPreferredPdfBrowser) EVT_MENU_RANGE(ID_PREFERENCES_HOTKEY_START
void OnOrient(wxCommandEvent &aEvent)
Function OnOrient Handles the ID_LIBEDIT_MIRROR_X and ID_LIBEDIT_MIRROR_Y events. ...
void DisplayLibInfos()
Function DisplayLibInfos updates the main window title bar with the current library name and read onl...
Definition: libedit.cpp:55
void OnEditComponentProperties(wxCommandEvent &event)
FOOTPRINT_EDIT_FRAME::Process_Special_Functions FOOTPRINT_EDIT_FRAME::ProcessPreferences FOOTPRINT_EDIT_FRAME::ProcessPreferences FOOTPRINT_EDIT_FRAME::ProcessPreferences FOOTPRINT_EDIT_FRAME::ProcessPreferences FOOTPRINT_EDIT_FRAME::Process_Special_Functions FOOTPRINT_EDIT_FRAME::Process_Special_Functions FOOTPRINT_EDIT_FRAME::Process_Special_Functions EVT_UPDATE_UI(ID_MODEDIT_CREATE_NEW_LIB_AND_SAVE_CURRENT_PART, FOOTPRINT_EDIT_FRAME::OnUpdateModuleSelected) EVT_UPDATE_UI(ID_MODEDIT_LOAD_MODULE_FROM_BOARD
BOX2I boundingBox(T aObject)
boundingBox template method
Definition: shape_index.h:59
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:36
EDA_PANEINFO & VerticalToolbarPane()
Function VerticalToolbarPane Change *this to a vertical toolbar for KiCad.
Definition: wxstruct.h:493
a helper to handle the real device context used in KiCad
wxAuiToolBar * m_optionsToolBar
The options tool bar typcially located on the left edge of the main window.
Definition: draw_frame.h:125
LIB_EDIT_FRAME(KIWAY *aKiway, wxWindow *aParent)
void SetFlags(STATUS_FLAGS aMask)
Definition: base_struct.h:253
EDA_HOTKEY_CONFIG * m_hotkeysDescrList
Definition: draw_frame.h:76
void LoadSettings(wxConfigBase *aCfg) override
Function LoadSettings loads common frame parameters from a configuration file.
void ReCreateMenuBar() override
(Re)Create the menubar for the component editor frame
void SetDrawItem(LIB_ITEM *drawItem)
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Function SetMsgPanel clears the message panel and populates it with the contents of aList...
Definition: draw_frame.cpp:773
LIB_COLLECTOR m_collectedItems
Used for hit testing.
Definition: libeditframe.h:55
bool m_Center
Center on screen.
bool IsMouseCaptured() const
EDA_MSG_PANEL * m_messagePanel
Panel used to display information at the bottom of the main window.
Definition: draw_frame.h:128
void OnUpdateSelectAlias(wxUpdateUIEvent &event)
const wxString & GetName() const
Class PAGE_INFO describes the page size and margins of a paper page on which to eventually print or p...
void deleteItem(wxDC *aDC)
Function deleteItem deletes the currently selected draw item.
void OnUpdateViewDoc(wxUpdateUIEvent &event)
void OnUpdatePinTable(wxUpdateUIEvent &event)
void UpdateSymbolLinks()
wxComboBox * m_partSelectBox
a Box to select a part to edit (if any)
Definition: libeditframe.h:56
virtual void Rotate(const wxPoint &aCenter, bool aRotateCCW=true)=0
Function Rotate rotates the object about aCenter point.
LIB_ITEM * locateItem(const wxPoint &aPosition, const KICAD_T aFilterList[])
const wxString GetName() const
Return the file name without path or extension.
#define LIB_EDIT_FRAME_NAME
void TempCopyComponent()
Function TempCopyComponent create a temporary copy of the current edited component Used to prepare an...
Class LIB_PART defines a library part object.
unsigned STATUS_FLAGS
Definition: base_struct.h:144
Class KIWAY is a minimalistic software bus for communications between various DLLs/DSOs (DSOs) within...
Definition: kiway.h:257
static int m_textPinNumDefaultSize
The default pin num text size setting.
Definition: libeditframe.h:115
wxPoint m_FramePos
Definition: wxstruct.h:130
static LIB_ITEM * m_lastDrawItem
Definition: libeditframe.h:90
void OnUpdatePinByPin(wxUpdateUIEvent &event)
LIB_EDIT_FRAME::Process_Config LIB_EDIT_FRAME::Process_Special_Functions ID_LIBEDIT_DELETE_ITEM_BUTT
int m_UndoRedoCountMax
default Undo/Redo command Max depth, to be handed
Definition: draw_frame.h:88
EVT_TOOL(ID_FOOTPRINT_WIZARD_SELECT_WIZARD, FOOTPRINT_WIZARD_FRAME::SelectCurrentWizard) EVT_TOOL(ID_FOOTPRINT_WIZARD_RESET_TO_DEFAULT
static int m_textSize
The current text size setting.
Definition: libeditframe.h:109
void SetAutoPanRequest(bool aEnable)
virtual void SetToolID(int aId, int aCursor, const wxString &aToolMsg)
Function SetToolID sets the tool command ID to aId and sets the cursor to aCursor.
Definition: draw_frame.cpp:535
void OnSelectTool(wxCommandEvent &aEvent)
bool IsModified() const
void OnShowElectricalType(wxCommandEvent &event)
From Option toolbar: option to show the electrical pin type name.
int m_LastGridSizeId
Definition: draw_frame.h:77
bool SaveOnePart(PART_LIB *aLib, bool aPromptUser=true)
Function SaveOnePart saves the current LIB_PART into the provided PART_LIB.
Definition: libedit.cpp:697
void StartModifyDrawSymbol(wxDC *DC)
Definition: symbdraw.cpp:312
void CrossHairOff(wxDC *DC)
Definition: draw_panel.cpp:253
The the schematic editor to refresh the display.
Definition: mail_type.h:47
friend class DIALOG_LIB_EDIT_TEXT
Definition: libeditframe.h:128
wxAuiToolBar * m_drawToolBar
The tool bar that contains the buttons for quick access to the application draw tools.
Definition: draw_frame.h:122
wxAuiToolBar * m_mainToolBar
Standard horizontal Toolbar.
Definition: wxstruct.h:136
void OnRotateItem(wxCommandEvent &aEvent)
Function OnRotateItem rotates the current item.
void Process_Special_Functions(wxCommandEvent &event)
void SetAbortRequest(bool aAbortRequest)
void CreateOptionToolbar()
Definition: tool_lib.cpp:224
EVT_TOOL_RANGE(ID_LIBEDIT_PIN_BUTT, ID_LIBEDIT_DELETE_ITEM_BUTT, LIB_EDIT_FRAME::OnSelectTool) EVT_MENU_RANGE(ID_PREFERENCES_HOTKEY_START
void DisplayCmpDoc()
Function DisplayCmpDoc displays the documentation of the selected component.
Definition: libedit.cpp:455
VTBL_ENTRY void SetRString(RSTRING_T aStringId, const wxString &aString)
Function SetRString stores a "retained string", which is any session and project specific string iden...
Definition: project.cpp:162
void SetShowElectricalType(bool aShow)
Definition: libeditframe.h:409
wxPoint GetPosition() const override
Function GetPosition returns the current draw object position.
Definition: lib_pin.h:471
int GetUnitCount() const
ID_PREFERENCES_HOTKEY_END
LIB_PIN * GetNextPin(LIB_PIN *aItem=NULL)
Return the next pin object from the draw list.
static int m_textPinNameDefaultSize
The default pin name text size setting.
Definition: libeditframe.h:118
void EditSymbolText(wxDC *DC, LIB_ITEM *DrawItem)
Class PART_LIBS is a collection of PART_LIBs.
virtual void SetNoToolSelected()
Select the ID_NO_TOOL_SELECTED id tool (Idle tool)
Definition: draw_frame.cpp:560
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:92
void OnSelectItem(wxCommandEvent &aEvent)
void OnOpenPinTable(wxCommandEvent &aEvent)
void SetUnit(int aUnit)
wxString GetDocFileName() const
#define GR_DEFAULT_DRAWMODE
Definition: general.h:70
void OnUpdateSelectTool(wxUpdateUIEvent &aEvent)
VTBL_ENTRY const wxString & GetRString(RSTRING_T aStringId)
Function GetRString returns a "retained string", which is any session and project specific string ide...
Definition: project.cpp:177
LIB_ITEM * LocateItemUsingCursor(const wxPoint &aPosition, const KICAD_T aFilterList[]=LIB_COLLECTOR::AllItems)
EDA_PANEINFO & MessageToolbarPane()
Function MessageToolbarPane Change *this to a message pane for KiCad.
Definition: wxstruct.h:512
int DisplayExitDialog(wxWindow *parent, const wxString &aMessage)
Function DisplayExitDialog displays a dialog with 3 buttons: Save and Exit Cancel Exit without save...
Definition: confirm.cpp:58
void CrossHairOn(wxDC *DC)
Definition: draw_panel.cpp:260
virtual void GetMsgPanelInfo(std::vector< MSG_PANEL_ITEM > &aList) override
Function GetMsgPanelInfo displays basic info (type, part and convert) about the current item in messa...
void OnSaveCurrentPart(wxCommandEvent &aEvent)
PART_LIB * SetCurLib(PART_LIB *aLib)
Sets the current library and return the old.
wxPoint GetNearestGridPosition(const wxPoint &aPosition, wxRealPoint *aGridSize=NULL) const
Function GetNearestGridPosition returns the nearest aGridSize location to aPosition.
The component library editor main window.
Definition: libeditframe.h:51
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
see class PGM_BASE
TRANSFORM DefaultTransform
Definition: eeschema.cpp:57
void ReCreateHToolbar() override
Definition: tool_lib.cpp:99
void OnCreateNewPartFromExisting(wxCommandEvent &event)
static wxString m_aliasName
Definition: libeditframe.h:92
bool GetShowDeMorgan()
Definition: libeditframe.h:403
virtual void Draw(EDA_DRAW_PANEL *aPanel, wxDC *aDC, const wxPoint &aOffset, COLOR4D aColor, GR_DRAWMODE aDrawMode, void *aData, const TRANSFORM &aTransform)
Draw an item.
static int m_unit
Definition: libeditframe.h:95
void TestDanglingEnds()
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
BLOCK_STATE_T GetState() const
void SetCurPart(LIB_PART *aPart)
Function SetCurPart takes ownership over aPart and notes that it is the one currently being edited...
void OnSelectAlias(wxCommandEvent &event)
#define max(a, b)
Definition: auxiliary.h:86
VTBL_ENTRY void ExpressMail(FRAME_T aDestination, MAIL_T aCommand, const std::string &aPayload, wxWindow *aSource=NULL)
Function ExpressMail send aPayload to aDestination from aSource.
Definition: kiway.cpp:387
#define INSTALL_UNBUFFERED_DC(name, parent)
void OnUpdateNotEditingPart(wxUpdateUIEvent &event)
virtual void HandleBlockPlace(wxDC *DC) override
Function HandleBlockPlace handles the block place command.
int GetToolId() const
Definition: draw_frame.h:419
static FILL_T m_drawFillStyle
The current draw or edit graphic item fill style.
Definition: libeditframe.h:85
Class EDA_BASE_FRAME is the base frame for deriving all KiCad main window classes.
Definition: wxstruct.h:113
wxArrayString GetAliasNames(bool aIncludeRoot=true) const
void EndDrawGraphicItem(wxDC *DC)
Definition: symbdraw.cpp:339
void SetIgnoreMouseEvents(bool aIgnore)
Class EDA_RECT handles the component boundary box.
static wxString SubReference(int aUnit, bool aAddSeparator=true)
Function SubReference.
LIB_PART * GetCurPart()
Function GetCurPart returns the current part being edited, or NULL if none selected.
void Collect(LIB_ITEMS &aItem, const KICAD_T aFilterList[], const wxPoint &aPosition, int aUnit=0, int aConvert=0)
Function Collect scans a SCH_ITEM using this class's Inspector method, which does the collection...
void SetMaxUndoItems(int aMax)
void RemoveDrawItem(LIB_ITEM *aItem, EDA_DRAW_PANEL *aPanel=NULL, wxDC *aDc=NULL)
Remove draw aItem from list.
static int m_defaultPinLength
Default pin length.
Definition: libeditframe.h:121
void EditGraphicSymbol(wxDC *DC, LIB_ITEM *DrawItem)
Definition: symbdraw.cpp:58
int GetWidth() const
std::vector< MSG_PANEL_ITEM > MSG_PANEL_ITEMS
Definition: msgpanel.h:102
#define DEFAULTPINNAMESIZE
Definition: general.h:68
const char * name
void SetEnableBlockCommands(bool aEnable)
int m_repeatPinStep
Default repeat offset for pins in repeat place pin.
Definition: libeditframe.h:124
bool Destroy() override
Our version of Destroy() which is virtual from wxWidgets.
FILL_T
Enum FILL_T is the set of fill types used in plotting or drawing enclosed areas.
Definition: base_struct.h:56
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:254
bool SynchronizePins()
Function SycnronizePins.
int CreateNewLibAndSavePartId
void OnUpdateElectricalType(wxUpdateUIEvent &aEvent)
bool IsEditingDrawItem()
Definition: libeditframe.h:439
const PAGE_INFO & GetPageSettings() const
LIB_EDIT_FRAME::Process_Config ID_POPUP_GENERAL_END_RANGE
void EditField(LIB_FIELD *Field)
Definition: libfield.cpp:39
bool IsReadOnly() const
Function IsReadOnly.
static int m_drawLineWidth
Default line width for drawing or editing graphic items.
Definition: libeditframe.h:88
bool m_drawSpecificConvert
Convert of the item currently being drawn.
Definition: libeditframe.h:60
LIB_EDIT_FRAME::Process_Config EVT_MENU_RANGE(ID_POPUP_LIBEDIT_PIN_GLOBAL_CHANGE_ITEM, ID_POPUP_LIBEDIT_DELETE_CURRENT_POLY_SEGMENT, LIB_EDIT_FRAME::Process_Special_Functions) EVT_MENU_RANGE(ID_POPUP_GENERAL_START_RANGE
wxSize m_FrameSize
Definition: wxstruct.h:131
Definition for part library class.
#define DEFAULTPINNUMSIZE
The default pin name size when creating pins(can be changed in preference menu)
Definition: general.h:65
static bool m_showDeMorgan
Definition: libeditframe.h:106
void SetCrossHairPosition(const wxPoint &aPosition, bool aSnapToGrid=true)
Function SetCrossHairPosition sets the screen cross hair position to aPosition in logical (drawing) u...
int SetGrid(const wxRealPoint &size)
set the current grid size m_Grid.
bool m_drawSpecificUnit
Specify which component parts the current draw item applies to.
Definition: libeditframe.h:68
Message panel definition file.
void OnSelectPart(wxCommandEvent &event)
int GetDefaultCursor() const
Function GetDefaultCursor.
Class SCH_BASE_FRAME is a shim class between EDA_DRAW_FRAME and several derived classes: LIB_EDIT_FRA...
Class PART_LIB is used to load, save, search, and otherwise manipulate part library files...
bool m_editPinsPerPartOrConvert
Set to true to not synchronize pins at the same position when editing components with multiple parts ...
Definition: libeditframe.h:77
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:69
wxPoint GetCrossHairPosition(bool aInvertY=false) const
Function GetCrossHairPosition return the current cross hair position in logical (drawing) coordinates...
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Function IsOK displays a yes/no dialog with aMessage and returns the user response.
Definition: confirm.cpp:111
void UpdatePartSelectList()
virtual void OnActivate(wxActivateEvent &event)
Function OnActivate (virtual) is called when activating the frame.
Definition: draw_frame.cpp:257
void StartMoveDrawSymbol(wxDC *DC)
Definition: symbdraw.cpp:291
void ClearMsgPanel(void)
Clear all messages from the message panel.
Definition: draw_frame.cpp:764
static wxSize m_clientSize
Definition: libeditframe.h:126
Definition of class LIB_EDIT_FRAME.
Class SCH_SCREENS is a container class that holds multiple SCH_SCREENs in a hierarchy.
bool GetShowElectricalType()
Definition: libeditframe.h:407
std::vector< double > m_ZoomList
standard zoom (i.e. scale) coefficients.
int GetDefaultTextSize()
Default size for text in general.
void SetCommand(BLOCK_COMMAND_T aCommand)
wxComboBox * m_aliasSelectBox
a box to select the alias to edit (if any)
Definition: libeditframe.h:57
LIB_PART * m_tempCopyComponent
temp copy of a part during edit, I own it here.
Definition: libeditframe.h:54
void SaveCopyInUndoList(EDA_ITEM *ItemToCopy)
Function SaveCopyInUndoList.
void ReCreateVToolbar() override
Definition: tool_lib.cpp:53