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  Bind( wxEVT_COMMAND_MENU_SELECTED, &LIB_EDIT_FRAME::OnEditSymbolLibTable, this,
299 
300  wxCommandEvent evt( wxEVT_COMMAND_MENU_SELECTED, ID_ZOOM_PAGE );
301  wxPostEvent( this, evt );
302 }
303 
304 
306 {
307  Unbind( wxEVT_COMMAND_MENU_SELECTED, &LIB_EDIT_FRAME::OnEditSymbolLibTable, this,
309 
310  m_drawItem = m_lastDrawItem = NULL;
311 
312  delete m_tempCopyComponent;
313  delete m_my_part;
314  m_my_part = NULL;
315  m_tempCopyComponent = NULL;
316 }
317 
318 
320 {
321  m_drawItem = drawItem;
322 }
323 
324 
325 void LIB_EDIT_FRAME::OnCloseWindow( wxCloseEvent& Event )
326 {
327  if( GetScreen()->IsModify() )
328  {
329  int ii = DisplayExitDialog( this, _( "Save the changes in the library before closing?" ) );
330 
331  switch( ii )
332  {
333  case wxID_NO:
334  break;
335 
336  case wxID_YES:
337  if ( this->SaveActiveLibrary( false ) )
338  break;
339 
340  // fall through: cancel the close because of an error
341 
342  case wxID_CANCEL:
343  Event.Veto();
344  return;
345  }
346  GetScreen()->ClrModify();
347  }
348 
349  PART_LIBS* libs = Prj().SchLibs();
350 
351  for( const PART_LIB& lib : *libs )
352  {
353  if( lib.IsModified() )
354  {
355  wxString msg = wxString::Format( _(
356  "Library '%s' was modified!\nDiscard changes?" ),
357  GetChars( lib.GetName() )
358  );
359 
360  if( !IsOK( this, msg ) )
361  {
362  Event.Veto();
363  return;
364  }
365  }
366  }
367 
368  Destroy();
369 }
370 
371 
373 {
374  /* Please, note: wxMSW before version 2.9 seems have
375  * problems with zoom values < 1 ( i.e. userscale > 1) and needs to be patched:
376  * edit file <wxWidgets>/src/msw/dc.cpp
377  * search for line static const int VIEWPORT_EXTENT = 1000;
378  * and replace by static const int VIEWPORT_EXTENT = 10000;
379  */
380  int dx, dy;
381 
382  LIB_PART* part = GetCurPart();
383 
384  if( part )
385  {
387 
388  dx = boundingBox.GetWidth();
389  dy = boundingBox.GetHeight();
390  SetScrollCenterPosition( wxPoint( 0, 0 ) );
391  }
392  else
393  {
394  const PAGE_INFO& pageInfo = GetScreen()->GetPageSettings();
395 
396  dx = pageInfo.GetSizeIU().x;
397  dy = pageInfo.GetSizeIU().y;
398 
399  SetScrollCenterPosition( wxPoint( 0, 0 ) );
400  }
401 
402  wxSize size = m_canvas->GetClientSize();
403 
404  // Reserve a 10% margin around component bounding box.
405  double margin_scale_factor = 0.8;
406  double zx =(double) dx / ( margin_scale_factor * (double)size.x );
407  double zy = (double) dy / ( margin_scale_factor * (double)size.y );
408 
409  double bestzoom = std::max( zx, zy );
410 
411  // keep it >= minimal existing zoom (can happen for very small components
412  // for instance when starting a new component
413  if( bestzoom < GetScreen()->m_ZoomList[0] )
414  bestzoom = GetScreen()->m_ZoomList[0];
415 
416  return bestzoom;
417 }
418 
419 
421 {
422  if( m_aliasSelectBox == NULL )
423  return;
424 
425  m_aliasSelectBox->Clear();
426 
427  LIB_PART* part = GetCurPart();
428 
429  if( !part )
430  return;
431 
432  m_aliasSelectBox->Append( part->GetAliasNames() );
433  m_aliasSelectBox->SetSelection( 0 );
434 
435  int index = m_aliasSelectBox->FindString( m_aliasName );
436 
437  if( index != wxNOT_FOUND )
438  m_aliasSelectBox->SetSelection( index );
439 }
440 
441 
443 {
444  if( m_partSelectBox == NULL )
445  return;
446 
447  if( m_partSelectBox->GetCount() != 0 )
448  m_partSelectBox->Clear();
449 
450  LIB_PART* part = GetCurPart();
451 
452  if( !part || part->GetUnitCount() <= 1 )
453  {
454  m_unit = 1;
455  m_partSelectBox->Append( wxEmptyString );
456  }
457  else
458  {
459  for( int i = 0; i < part->GetUnitCount(); i++ )
460  {
461  wxString sub = LIB_PART::SubReference( i+1, false );
462  wxString unit = wxString::Format( _( "Unit %s" ), GetChars( sub ) );
463  m_partSelectBox->Append( unit );
464  }
465  }
466 
467  // Ensure the current selected unit is compatible with
468  // the number of units of the current part:
469  if( part && part->GetUnitCount() < m_unit )
470  m_unit = 1;
471 
472  m_partSelectBox->SetSelection( ( m_unit > 0 ) ? m_unit - 1 : 0 );
473 }
474 
475 
476 void LIB_EDIT_FRAME::OnShowElectricalType( wxCommandEvent& event )
477 {
479  GetCanvas()->Refresh();
480 }
481 
482 
483 void LIB_EDIT_FRAME::OnUpdateSelectTool( wxUpdateUIEvent& aEvent )
484 {
485  aEvent.Check( GetToolId() == aEvent.GetId() );
486 }
487 
488 
489 void LIB_EDIT_FRAME::OnUpdateElectricalType( wxUpdateUIEvent& aEvent )
490 {
491  aEvent.Check( GetShowElectricalType() );
492 }
493 
494 
495 void LIB_EDIT_FRAME::OnUpdateEditingPart( wxUpdateUIEvent& aEvent )
496 {
497  LIB_PART* part = GetCurPart();
498 
499  aEvent.Enable( part != NULL );
500 
501  if( part && aEvent.GetEventObject() == m_drawToolBar )
502  aEvent.Check( GetToolId() == aEvent.GetId() );
503 }
504 
505 
506 void LIB_EDIT_FRAME::OnUpdateNotEditingPart( wxUpdateUIEvent& event )
507 {
508  event.Enable( !GetCurPart() );
509 }
510 
511 
512 void LIB_EDIT_FRAME::OnUpdateUndo( wxUpdateUIEvent& event )
513 {
514  event.Enable( GetCurPart() && GetScreen() &&
515  GetScreen()->GetUndoCommandCount() != 0 && !IsEditingDrawItem() );
516 }
517 
518 
519 void LIB_EDIT_FRAME::OnUpdateRedo( wxUpdateUIEvent& event )
520 {
521  event.Enable( GetCurPart() && GetScreen() &&
522  GetScreen()->GetRedoCommandCount() != 0 && !IsEditingDrawItem() );
523 }
524 
525 
526 void LIB_EDIT_FRAME::OnUpdateSaveCurrentLib( wxUpdateUIEvent& event )
527 {
528  PART_LIB* lib = GetCurLib();
529 
530  event.Enable( lib && !lib->IsReadOnly()
531  && ( lib->IsModified() || GetScreen()->IsModify() ) );
532 }
533 
534 
535 void LIB_EDIT_FRAME::OnUpdateViewDoc( wxUpdateUIEvent& event )
536 {
537  bool enable = false;
538 
539  PART_LIB* lib = GetCurLib();
540  LIB_PART* part = GetCurPart();
541 
542  if( part && lib )
543  {
544  LIB_ALIAS* alias = part->GetAlias( m_aliasName );
545 
546  wxCHECK_RET( alias != NULL, wxT( "Alias <" ) + m_aliasName + wxT( "> not found." ) );
547 
548  enable = !alias->GetDocFileName().IsEmpty();
549  }
550 
551  event.Enable( enable );
552 }
553 
554 
555 void LIB_EDIT_FRAME::OnUpdatePinByPin( wxUpdateUIEvent& event )
556 {
557  LIB_PART* part = GetCurPart();
558 
559  event.Enable( part && ( part->GetUnitCount() > 1 || m_showDeMorgan ) );
560 
561  event.Check( m_editPinsPerPartOrConvert );
562 }
563 
564 
565 void LIB_EDIT_FRAME::OnUpdatePinTable( wxUpdateUIEvent& event )
566 {
567  LIB_PART* part = GetCurPart();
568  event.Enable( part != NULL );
569 }
570 
571 
572 void LIB_EDIT_FRAME::OnUpdatePartNumber( wxUpdateUIEvent& event )
573 {
574  if( m_partSelectBox == NULL )
575  return;
576 
577  LIB_PART* part = GetCurPart();
578 
579  // Using the typical event.Enable() call doesn't seem to work with wxGTK
580  // so use the pointer to alias combobox to directly enable or disable.
581  m_partSelectBox->Enable( part && part->GetUnitCount() > 1 );
582 }
583 
584 
585 void LIB_EDIT_FRAME::OnUpdateDeMorganNormal( wxUpdateUIEvent& event )
586 {
587  if( m_mainToolBar == NULL )
588  return;
589 
590  LIB_PART* part = GetCurPart();
591 
592  event.Enable( GetShowDeMorgan() || ( part && part->HasConversion() ) );
593  event.Check( m_convert <= 1 );
594 }
595 
596 
597 void LIB_EDIT_FRAME::OnUpdateDeMorganConvert( wxUpdateUIEvent& event )
598 {
599  if( m_mainToolBar == NULL )
600  return;
601 
602  LIB_PART* part = GetCurPart();
603 
604  event.Enable( GetShowDeMorgan() || ( part && part->HasConversion() ) );
605  event.Check( m_convert > 1 );
606 }
607 
608 
609 void LIB_EDIT_FRAME::OnUpdateSelectAlias( wxUpdateUIEvent& event )
610 {
611  if( m_aliasSelectBox == NULL )
612  return;
613 
614  LIB_PART* part = GetCurPart();
615 
616  // Using the typical event.Enable() call doesn't seem to work with wxGTK
617  // so use the pointer to alias combobox to directly enable or disable.
618  m_aliasSelectBox->Enable( part && part->GetAliasCount() > 1 );
619 }
620 
621 
622 void LIB_EDIT_FRAME::OnSelectAlias( wxCommandEvent& event )
623 {
624  if( m_aliasSelectBox == NULL
625  || ( m_aliasSelectBox->GetStringSelection().CmpNoCase( m_aliasName ) == 0) )
626  return;
627 
628  m_lastDrawItem = NULL;
629  m_aliasName = m_aliasSelectBox->GetStringSelection();
630 
631  DisplayCmpDoc();
632  m_canvas->Refresh();
633 }
634 
635 
636 void LIB_EDIT_FRAME::OnSelectPart( wxCommandEvent& event )
637 {
638  int i = event.GetSelection();
639 
640  if( ( i == wxNOT_FOUND ) || ( ( i + 1 ) == m_unit ) )
641  return;
642 
643  m_lastDrawItem = NULL;
644  m_unit = i + 1;
645  m_canvas->Refresh();
646  DisplayCmpDoc();
647 }
648 
649 
650 void LIB_EDIT_FRAME::OnViewEntryDoc( wxCommandEvent& event )
651 {
652  LIB_PART* part = GetCurPart();
653 
654  if( !part )
655  return;
656 
657  wxString fileName;
658  LIB_ALIAS* alias = part->GetAlias( m_aliasName );
659 
660  wxCHECK_RET( alias != NULL, "Alias not found." );
661 
662  fileName = alias->GetDocFileName();
663 
664  if( !fileName.IsEmpty() )
665  {
666  SEARCH_STACK* lib_search = Prj().SchSearchS();
667 
668  GetAssociatedDocument( this, fileName, lib_search );
669  }
670 }
671 
672 
673 void LIB_EDIT_FRAME::OnSelectBodyStyle( wxCommandEvent& event )
674 {
675  m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor() );
676 
677  if( event.GetId() == ID_DE_MORGAN_NORMAL_BUTT )
678  m_convert = 1;
679  else
680  m_convert = 2;
681 
682  m_lastDrawItem = NULL;
683  m_canvas->Refresh();
684 }
685 
686 
687 void LIB_EDIT_FRAME::OnSaveCurrentPart( wxCommandEvent& aEvent )
688 {
689  LIB_PART* part = GetCurPart();
690 
691  if( !part )
692  {
693  DisplayError( this, _( "No part to save." ) );
694  return;
695  }
696 
697  PART_LIB* lib = GetCurLib();
698 
699  if( !lib )
701 
702  lib = GetCurLib();
703 
704  if( !lib )
705  {
706  DisplayError( this, _( "No library specified." ) );
707  return;
708  }
709 
710  try
711  {
712  SaveOnePart( lib );
713  }
714  catch( ... )
715  {
716  wxString msg;
717  msg.Printf( _( "Unexpected error occured saving symbol '%s' to symbol library '%s'." ),
718  part->GetName(), lib->GetName() );
719  DisplayError( this, msg );
720  return;
721  }
722 
724 }
725 
726 
727 void LIB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
728 {
729  int id = event.GetId();
730  wxPoint pos;
731 
733 
734  wxGetMousePosition( &pos.x, &pos.y );
735  pos.y += 20;
736 
737  switch( id ) // Stop placement commands before handling new command.
738  {
740  case ID_LIBEDIT_EDIT_PIN:
746  case ID_POPUP_ZOOM_BLOCK:
754  case ID_POPUP_LIBEDIT_DELETE_CURRENT_POLY_SEGMENT:
755  break;
756 
758  if( m_canvas->IsMouseCaptured() )
760  else
761  m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor() );
762  break;
763 
766  break;
767 
768  default:
769  m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor(),
770  wxEmptyString );
771  break;
772  }
773 
775 
776  switch( id )
777  {
779  break;
780 
781  case ID_LIBEDIT_SELECT_CURRENT_LIB:
783  break;
784 
785  case ID_LIBEDIT_EDIT_PIN_BY_PIN:
786  m_editPinsPerPartOrConvert = m_mainToolBar->GetToolToggled( ID_LIBEDIT_EDIT_PIN_BY_PIN );
787  break;
788 
791  if( m_drawItem )
792  {
793  EndDrawGraphicItem( &dc );
794  }
795  break;
796 
798  if( m_drawItem )
799  {
800  m_canvas->CrossHairOff( &dc );
801 
802  switch( m_drawItem->Type() )
803  {
804  case LIB_ARC_T:
805  case LIB_CIRCLE_T:
806  case LIB_RECTANGLE_T:
807  case LIB_POLYLINE_T:
809  break;
810 
811  case LIB_TEXT_T:
812  EditSymbolText( &dc, m_drawItem );
813  break;
814 
815  default:
816  ;
817  }
818 
819  m_canvas->CrossHairOn( &dc );
820  }
821  break;
822 
823  case ID_POPUP_LIBEDIT_DELETE_CURRENT_POLY_SEGMENT:
824  {
825  // Delete the last created segment, while creating a polyline draw item
826  if( m_drawItem == NULL )
827  break;
828 
830  STATUS_FLAGS oldFlags = m_drawItem->GetFlags();
832  m_drawItem->Draw( m_canvas, &dc, wxPoint( 0, 0 ), COLOR4D::UNSPECIFIED, g_XorMode, NULL,
834  ( (LIB_POLYLINE*) m_drawItem )->DeleteSegment( GetCrossHairPosition( true ) );
835  m_drawItem->Draw( m_canvas, &dc, wxPoint( 0, 0 ), COLOR4D::UNSPECIFIED, g_XorMode, NULL,
837  m_drawItem->SetFlags( oldFlags );
838  m_lastDrawItem = NULL;
839  }
840  break;
841 
843  if( m_drawItem )
844  deleteItem( &dc );
845 
846  break;
847 
849  if( m_drawItem == NULL )
850  break;
851 
852  if( m_drawItem->Type() == LIB_PIN_T )
853  StartMovePin( &dc );
854  else
855  StartMoveDrawSymbol( &dc );
856  break;
857 
859 
860  if( m_drawItem == NULL )
861  break;
862 
865  || m_drawItem->Type() == LIB_CIRCLE_T
867  || m_drawItem->Type() == LIB_ARC_T
868  )
869  {
870  StartModifyDrawSymbol( &dc );
871  }
872 
873  break;
874 
876  if( m_drawItem == NULL )
877  break;
878 
879  m_canvas->CrossHairOff( &dc );
880 
881  if( m_drawItem->Type() == LIB_FIELD_T )
882  {
884  }
885 
887  m_canvas->CrossHairOn( &dc );
888  break;
889 
893  {
894  if( !m_drawItem || m_drawItem->Type() != LIB_PIN_T )
895  break;
896 
897  LIB_PART* part = GetCurPart();
898 
899  SaveCopyInUndoList( part );
900 
901  GlobalSetPins( (LIB_PIN*) m_drawItem, id );
903  m_canvas->Refresh();
904  }
905  break;
906 
907  case ID_POPUP_ZOOM_BLOCK:
908  m_canvas->SetAutoPanRequest( false );
910  HandleBlockEnd( &dc );
911  break;
912 
914  m_canvas->SetAutoPanRequest( false );
917  HandleBlockEnd( &dc );
918  break;
919 
921  m_canvas->SetAutoPanRequest( false );
924  HandleBlockEnd( &dc );
925  break;
926 
928  m_canvas->SetAutoPanRequest( false );
931  HandleBlockEnd( &dc );
932  break;
933 
935  m_canvas->SetAutoPanRequest( false );
938  HandleBlockPlace( &dc );
939  break;
940 
942  m_canvas->SetAutoPanRequest( false );
945  HandleBlockPlace( &dc );
946  break;
947 
949  m_canvas->SetAutoPanRequest( false );
952  HandleBlockPlace( &dc );
953  break;
954 
956  m_canvas->SetAutoPanRequest( false );
958  HandleBlockPlace( &dc );
959  break;
960 
961  default:
962  DisplayError( this, "LIB_EDIT_FRAME::Process_Special_Functions error" );
963  break;
964  }
965 
966  m_canvas->SetIgnoreMouseEvents( false );
967 
968  if( GetToolId() == ID_NO_TOOL_SELECTED )
969  m_lastDrawItem = NULL;
970 }
971 
972 
973 void LIB_EDIT_FRAME::OnActivate( wxActivateEvent& event )
974 {
976 }
977 
978 
980 {
982 
983  if( !!name )
984  {
985  PART_LIB* lib = Prj().SchLibs()->FindLibrary( name );
986 
987  if( !lib )
988  Prj().SetRString( PROJECT::SCH_LIBEDIT_CUR_LIB, wxEmptyString );
989 
990  return lib;
991  }
992 
993  return NULL;
994 }
995 
996 
998 {
999  PART_LIB* old = GetCurLib();
1000 
1001  if( !aLib || !aLib->GetName() )
1002  Prj().SetRString( PROJECT::SCH_LIBEDIT_CUR_LIB, wxEmptyString );
1003  else
1005 
1006  return old;
1007 }
1008 
1009 
1011 {
1012  if( !m_my_part )
1013  {
1015  LIB_PART* part;
1016 
1017  if( !!name && ( part = Prj().SchLibs()->FindLibPart( LIB_ID( wxEmptyString, name ) ) ) )
1018  {
1019  // clone it from the PART_LIB and own it.
1020  m_my_part = new LIB_PART( *part );
1021  }
1022  else
1023  Prj().SetRString( PROJECT::SCH_LIBEDIT_CUR_PART, wxEmptyString );
1024  }
1025 
1026  return m_my_part;
1027 }
1028 
1029 
1031 {
1032  delete m_my_part;
1033  m_my_part = aPart; // take ownership here
1034 
1035  // retain in case this wxFrame is re-opened later on the same PROJECT
1037  aPart ? aPart->GetName() : wxString() );
1038 }
1039 
1040 
1042 {
1043  delete m_tempCopyComponent;
1044 
1045  if( LIB_PART* part = GetCurPart() )
1046  // clone it and own the clone.
1047  m_tempCopyComponent = new LIB_PART( *part );
1048  else
1049  // clear it, there was no CurPart
1050  m_tempCopyComponent = NULL;
1051 }
1052 
1053 
1055 {
1056  if( m_tempCopyComponent )
1057  {
1058  // transfer ownership to CurPart
1060  m_tempCopyComponent = NULL;
1061  }
1062 }
1063 
1064 
1066 {
1067  delete m_tempCopyComponent;
1068  m_tempCopyComponent = NULL;
1069 }
1070 
1071 
1072 void LIB_EDIT_FRAME::EditSymbolText( wxDC* DC, LIB_ITEM* DrawItem )
1073 {
1074  if ( ( DrawItem == NULL ) || ( DrawItem->Type() != LIB_TEXT_T ) )
1075  return;
1076 
1077  // Deleting old text
1078  if( DC && !DrawItem->InEditMode() )
1079  DrawItem->Draw( m_canvas, DC, wxPoint( 0, 0 ), COLOR4D::UNSPECIFIED, g_XorMode, NULL,
1080  DefaultTransform );
1081 
1082  DIALOG_LIB_EDIT_TEXT* frame = new DIALOG_LIB_EDIT_TEXT( this, (LIB_TEXT*) DrawItem );
1083  frame->ShowModal();
1084  frame->Destroy();
1085  OnModify();
1086 
1087  // Display new text
1088  if( DC && !DrawItem->InEditMode() )
1089  DrawItem->Draw( m_canvas, DC, wxPoint( 0, 0 ), COLOR4D::UNSPECIFIED, GR_DEFAULT_DRAWMODE,
1090  NULL, DefaultTransform );
1091 }
1092 
1093 
1094 void LIB_EDIT_FRAME::OnEditComponentProperties( wxCommandEvent& event )
1095 {
1096  bool partLocked = GetCurPart()->UnitsLocked();
1097 
1099 
1100  if( dlg.ShowModal() == wxID_CANCEL )
1101  return;
1102 
1103  if( partLocked != GetCurPart()->UnitsLocked() )
1104  {
1105  // m_editPinsPerPartOrConvert is set to the better value, if m_UnitSelectionLocked
1106  // has changed
1107  m_editPinsPerPartOrConvert = GetCurPart()->UnitsLocked() ? true : false;
1108  }
1109 
1112  DisplayLibInfos();
1113  DisplayCmpDoc();
1114  OnModify();
1115  m_canvas->Refresh();
1116 }
1117 
1118 
1119 void LIB_EDIT_FRAME::OnCreateNewPartFromExisting( wxCommandEvent& event )
1120 {
1121  LIB_PART* part = GetCurPart();
1122 
1123  wxCHECK_RET( part, "Cannot create new part from non-existent current part." );
1124 
1126  m_canvas->CrossHairOff( &dc );
1127 
1128  EditField( &part->GetValueField() );
1129 
1131  m_canvas->CrossHairOn( &dc );
1132 }
1133 
1134 
1135 void LIB_EDIT_FRAME::OnSelectTool( wxCommandEvent& aEvent )
1136 {
1137  int id = aEvent.GetId();
1138  int lastToolID = GetToolId();
1139 
1140  if( GetToolId() == ID_NO_TOOL_SELECTED || GetToolId() == ID_ZOOM_SELECTION )
1141  m_lastDrawItem = NULL;
1142 
1143  // Stop the current command and deselect the current tool.
1144  m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor() );
1145 
1146  LIB_PART* part = GetCurPart();
1147 
1148  switch( id )
1149  {
1150  case ID_NO_TOOL_SELECTED:
1151  SetToolID( id, m_canvas->GetDefaultCursor(), wxEmptyString );
1152  break;
1153 
1154  case ID_ZOOM_SELECTION:
1155  // This tool is located on the main toolbar: switch it on or off on click on it
1156  if( lastToolID != ID_ZOOM_SELECTION )
1157  SetToolID( ID_ZOOM_SELECTION, wxCURSOR_MAGNIFIER, _( "Zoom to selection" ) );
1158  else
1160  break;
1161 
1162  case ID_LIBEDIT_PIN_BUTT:
1163  if( part )
1164  {
1165  SetToolID( id, wxCURSOR_PENCIL, _( "Add pin" ) );
1166  }
1167  else
1168  {
1169  SetToolID( id, wxCURSOR_ARROW, _( "Set pin options" ) );
1170 
1171  wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
1172 
1173  cmd.SetId( ID_LIBEDIT_EDIT_PIN );
1174  GetEventHandler()->ProcessEvent( cmd );
1176  }
1177  break;
1178 
1180  SetToolID( id, wxCURSOR_PENCIL, _( "Add text" ) );
1181  break;
1182 
1184  SetToolID( id, wxCURSOR_PENCIL, _( "Add rectangle" ) );
1185  break;
1186 
1188  SetToolID( id, wxCURSOR_PENCIL, _( "Add circle" ) );
1189  break;
1190 
1192  SetToolID( id, wxCURSOR_PENCIL, _( "Add arc" ) );
1193  break;
1194 
1196  SetToolID( id, wxCURSOR_PENCIL, _( "Add line" ) );
1197  break;
1198 
1200  SetToolID( id, wxCURSOR_HAND, _( "Set anchor position" ) );
1201  break;
1202 
1204  SetToolID( id, m_canvas->GetDefaultCursor(), _( "Import" ) );
1205  LoadOneSymbol();
1207  break;
1208 
1210  SetToolID( id, m_canvas->GetDefaultCursor(), _( "Export" ) );
1211  SaveOneSymbol();
1213  break;
1214 
1215  case ID_LIBEDIT_DELETE_ITEM_BUTT:
1216  if( !part )
1217  {
1218  wxBell();
1219  break;
1220  }
1221 
1222  SetToolID( id, wxCURSOR_BULLSEYE, _( "Delete item" ) );
1223  break;
1224 
1225  default:
1226  break;
1227  }
1228 
1229  m_canvas->SetIgnoreMouseEvents( false );
1230 }
1231 
1232 
1233 void LIB_EDIT_FRAME::OnRotateItem( wxCommandEvent& aEvent )
1234 {
1235  if( m_drawItem == NULL )
1236  return;
1237 
1238  if( !m_drawItem->InEditMode() )
1239  {
1240  LIB_PART* part = GetCurPart();
1241 
1242  SaveCopyInUndoList( part );
1244  }
1245 
1246  m_drawItem->Rotate();
1247  OnModify();
1248 
1249  if( !m_drawItem->InEditMode() )
1251 
1252  m_canvas->Refresh();
1253 
1254  if( GetToolId() == ID_NO_TOOL_SELECTED )
1255  m_lastDrawItem = NULL;
1256 }
1257 
1258 
1259 void LIB_EDIT_FRAME::OnOrient( wxCommandEvent& aEvent )
1260 {
1262  SCH_SCREEN* screen = GetScreen();
1263  // Allows block rotate operation on hot key.
1264  if( screen->m_BlockLocate.GetState() != STATE_NO_BLOCK )
1265  {
1266  if( aEvent.GetId() == ID_LIBEDIT_MIRROR_X )
1267  {
1269  screen->m_BlockLocate.SetMessageBlock( this );
1271  HandleBlockEnd( &dc );
1272  }
1273  else if( aEvent.GetId() == ID_LIBEDIT_MIRROR_Y )
1274  {
1276  screen->m_BlockLocate.SetMessageBlock( this );
1278  HandleBlockEnd( &dc );
1279  }
1280  }
1281 }
1282 
1283 
1285  const KICAD_T aFilterList[] )
1286 {
1287  LIB_PART* part = GetCurPart();
1288 
1289  if( !part )
1290  return NULL;
1291 
1292  LIB_ITEM* item = locateItem( aPosition, aFilterList );
1293 
1294  wxPoint pos = GetNearestGridPosition( aPosition );
1295 
1296  if( item == NULL && aPosition != pos )
1297  item = locateItem( pos, aFilterList );
1298 
1299  return item;
1300 }
1301 
1302 
1303 LIB_ITEM* LIB_EDIT_FRAME::locateItem( const wxPoint& aPosition, const KICAD_T aFilterList[] )
1304 {
1305  LIB_PART* part = GetCurPart();
1306 
1307  if( !part )
1308  return NULL;
1309 
1310  LIB_ITEM* item = NULL;
1311 
1312  m_collectedItems.Collect( part->GetDrawItemList(), aFilterList, aPosition,
1313  m_unit, m_convert );
1314 
1315  if( m_collectedItems.GetCount() == 0 )
1316  {
1317  ClearMsgPanel();
1318  }
1319  else if( m_collectedItems.GetCount() == 1 )
1320  {
1321  item = m_collectedItems[0];
1322  }
1323  else
1324  {
1325  if( item == NULL )
1326  {
1327  wxASSERT_MSG( m_collectedItems.GetCount() <= MAX_SELECT_ITEM_IDS,
1328  "Select item clarification context menu size limit exceeded." );
1329 
1330  wxMenu selectMenu;
1331  AddMenuItem( &selectMenu, wxID_NONE, _( "Clarify Selection" ),
1332  KiBitmap( info_xpm ) );
1333 
1334  selectMenu.AppendSeparator();
1335 
1336  for( int i = 0; i < m_collectedItems.GetCount() && i < MAX_SELECT_ITEM_IDS; i++ )
1337  {
1338  wxString text = m_collectedItems[i]->GetSelectMenuText();
1339  BITMAP_DEF xpm = m_collectedItems[i]->GetMenuImage();
1340 
1341  AddMenuItem( &selectMenu, ID_SELECT_ITEM_START + i, text, KiBitmap( xpm ) );
1342  }
1343 
1344  // Set to NULL in case user aborts the clarification context menu.
1345  m_drawItem = NULL;
1346  m_canvas->SetAbortRequest( true ); // Changed to false if an item is selected
1347  PopupMenu( &selectMenu );
1349  item = m_drawItem;
1350  }
1351  }
1352 
1353  if( item )
1354  {
1355  MSG_PANEL_ITEMS items;
1356  item->GetMsgPanelInfo( items );
1357  SetMsgPanel( items );
1358  }
1359  else
1360  {
1361  ClearMsgPanel();
1362  }
1363 
1364  return item;
1365 }
1366 
1367 
1369 {
1370  wxCHECK_RET( m_drawItem != NULL, "No drawing item selected to delete." );
1371 
1372  m_canvas->CrossHairOff( aDC );
1373 
1374  LIB_PART* part = GetCurPart();
1375 
1376  SaveCopyInUndoList( part );
1377 
1378  if( m_drawItem->Type() == LIB_PIN_T )
1379  {
1380  LIB_PIN* pin = (LIB_PIN*) m_drawItem;
1381  wxPoint pos = pin->GetPosition();
1382 
1383  part->RemoveDrawItem( (LIB_ITEM*) pin, m_canvas, aDC );
1384 
1385  if( SynchronizePins() )
1386  {
1387  LIB_PIN* tmp = part->GetNextPin();
1388 
1389  while( tmp != NULL )
1390  {
1391  pin = tmp;
1392  tmp = part->GetNextPin( pin );
1393 
1394  if( pin->GetPosition() != pos )
1395  continue;
1396 
1397  part->RemoveDrawItem( (LIB_ITEM*) pin );
1398  }
1399  }
1400 
1401  m_canvas->Refresh();
1402  }
1403  else
1404  {
1405  if( m_canvas->IsMouseCaptured() )
1406  {
1407  m_canvas->CallEndMouseCapture( aDC );
1408  }
1409  else
1410  {
1411  part->RemoveDrawItem( m_drawItem, m_canvas, aDC );
1412  m_canvas->Refresh();
1413  }
1414  }
1415 
1416  m_drawItem = NULL;
1417  m_lastDrawItem = NULL;
1418  OnModify();
1419  m_canvas->CrossHairOn( aDC );
1420 }
1421 
1422 
1423 void LIB_EDIT_FRAME::OnSelectItem( wxCommandEvent& aEvent )
1424 {
1425  int id = aEvent.GetId();
1426  int index = id - ID_SELECT_ITEM_START;
1427 
1428  if( (id >= ID_SELECT_ITEM_START && id <= ID_SELECT_ITEM_END)
1429  && (index >= 0 && index < m_collectedItems.GetCount()) )
1430  {
1431  LIB_ITEM* item = m_collectedItems[index];
1432  m_canvas->SetAbortRequest( false );
1433  m_drawItem = item;
1434  }
1435 }
1436 
1437 
1438 void LIB_EDIT_FRAME::OnOpenPinTable( wxCommandEvent& aEvent )
1439 {
1440  LIB_PART* part = GetCurPart();
1441 
1442  DIALOG_LIB_EDIT_PIN_TABLE dlg( this, *part );
1443 
1444  if( dlg.ShowModal() == wxID_CANCEL )
1445  return;
1446 
1447  return;
1448 }
1449 
1450 
1452 {
1453  LIB_PART* part = GetCurPart();
1454 
1455  return !m_editPinsPerPartOrConvert && ( part &&
1456  ( part->HasConversion() || part->IsMulti() ) );
1457 }
1458 
1459 
1461 {
1462  // This is not the most effecient way to do this because the changed library may not have
1463  // any effect on the schematic symbol links. Since this is not called very often, take the
1464  // hit here rather than the myriad other places (including SCH_SCREEN::Draw()) where it was
1465  // being called.
1466  SCH_SCREENS schematic;
1467 
1468  schematic.UpdateSymbolLinks();
1469  schematic.TestDanglingEnds();
1470 
1471  // There may be no parent window so use KIWAY message to refresh the schematic editor
1472  // in case any symbols have changed.
1473  Kiway().ExpressMail( FRAME_SCH, MAIL_SCH_REFRESH, std::string( "" ), this );
1474 }
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
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
void OnEditSymbolLibTable(wxCommandEvent &aEvent)
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:311
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:67
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()
initializes or reinitializes the weak reference to the LIB_PART for each SCH_COMPONENT found in the f...
LIB_ITEMS_LIST & GetDrawItemList()
Return a reference to the draw item list.
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:706
void StartModifyDrawSymbol(wxDC *DC)
Definition: symbdraw.cpp:309
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:464
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:472
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:59
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:58
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:336
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 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:71
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:129
void Collect(LIB_ITEMS_LIST &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 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:288
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