KiCad PCB EDA Suite
footprint_viewer_frame.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) 2012-2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 2008-2016 Wayne Stambaugh <stambaughw@verizon.net>
6  * Copyright (C) 2004-2019 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 
27 #include <bitmaps.h>
28 #include <board_commit.h>
29 #include <class_board.h>
30 #include <class_module.h>
31 #include <confirm.h>
32 #include <dialog_helpers.h>
33 #include <eda_pattern_match.h>
34 #include <fctsys.h>
35 #include <footprint_info.h>
36 #include <footprint_viewer_frame.h>
37 #include <fp_lib_table.h>
38 #include <kiway.h>
39 #include <msgpanel.h>
40 #include <pcb_draw_panel_gal.h>
41 #include <pcb_painter.h>
42 #include <pcbnew_id.h>
44 #include <pgm_base.h>
46 #include <tool/action_toolbar.h>
47 #include <tool/common_control.h>
48 #include <tool/common_tools.h>
49 #include <tool/tool_dispatcher.h>
50 #include <tool/tool_manager.h>
51 #include <tool/zoom_tool.h>
52 #include <tools/pcb_viewer_tools.h>
53 #include <tools/pcb_actions.h>
54 #include <tools/pcbnew_control.h>
56 #include <tools/selection_tool.h>
58 #include <wx/tokenzr.h>
59 
60 using namespace std::placeholders;
61 
62 
63 #define NEXT_PART 1
64 #define NEW_PART 0
65 #define PREVIOUS_PART -1
66 
67 
68 BEGIN_EVENT_TABLE( FOOTPRINT_VIEWER_FRAME, EDA_DRAW_FRAME )
69  // Window events
73 
74  EVT_MENU( wxID_EXIT, FOOTPRINT_VIEWER_FRAME::OnExitKiCad )
75  EVT_MENU( wxID_CLOSE, FOOTPRINT_VIEWER_FRAME::CloseFootprintViewer )
76 
77  // Toolbar events
83 
85 
88 
89  // listbox events
93 
94 END_EVENT_TABLE()
95 
96 
97 /*
98  * Note: FOOTPRINT_VIEWER_FRAME can be created in "modal mode", or as a usual frame.
99  */
100 #define PARENT_STYLE ( KICAD_DEFAULT_DRAWFRAME_STYLE | wxFRAME_FLOAT_ON_PARENT )
101 #define MODAL_STYLE ( KICAD_DEFAULT_DRAWFRAME_STYLE | wxSTAY_ON_TOP )
102 #define NONMODAL_STYLE ( KICAD_DEFAULT_DRAWFRAME_STYLE )
103 
104 
106  FRAME_T aFrameType ) :
107  PCB_BASE_FRAME( aKiway, aParent, aFrameType, _( "Footprint Library Browser" ),
108  wxDefaultPosition, wxDefaultSize,
109  aFrameType == FRAME_FOOTPRINT_VIEWER_MODAL ? ( aParent ? PARENT_STYLE : MODAL_STYLE )
110  : NONMODAL_STYLE,
113 {
114  wxASSERT( aFrameType == FRAME_FOOTPRINT_VIEWER_MODAL || aFrameType == FRAME_FOOTPRINT_VIEWER );
115 
116  if( aFrameType == FRAME_FOOTPRINT_VIEWER_MODAL )
117  SetModal( true );
118 
119  m_AboutTitle = "Footprint Library Viewer";
120 
121  // Force the items to always snap
124  m_magneticItems.graphics = true;
125 
126  // Force the frame name used in config. the footprint viewer frame has a name
127  // depending on aFrameType (needed to identify the frame by wxWidgets),
128  // but only one configuration is preferable.
130 
131  // Give an icon
132  wxIcon icon;
133  icon.CopyFromBitmap( KiBitmap( modview_icon_xpm ) );
134  SetIcon( icon );
135 
136  wxPanel* libPanel = new wxPanel( this );
137  wxSizer* libSizer = new wxBoxSizer( wxVERTICAL );
138 
139  m_libFilter = new wxTextCtrl( libPanel, ID_MODVIEW_LIB_FILTER, wxEmptyString,
140  wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
141  m_libFilter->SetHint( _( "Filter" ) );
142  libSizer->Add( m_libFilter, 0, wxEXPAND, 5 );
143 
144  m_libList = new wxListBox( libPanel, ID_MODVIEW_LIB_LIST, wxDefaultPosition, wxDefaultSize,
145  0, NULL, wxLB_HSCROLL | wxNO_BORDER );
146  libSizer->Add( m_libList, 1, wxEXPAND, 5 );
147 
148  libPanel->SetSizer( libSizer );
149  libPanel->Fit();
150 
151  wxPanel* fpPanel = new wxPanel( this );
152  wxSizer* fpSizer = new wxBoxSizer( wxVERTICAL );
153 
154  m_fpFilter = new wxTextCtrl( fpPanel, ID_MODVIEW_FOOTPRINT_FILTER, wxEmptyString,
155  wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
156  m_fpFilter->SetHint( _( "Filter" ) );
157  m_fpFilter->SetToolTip(
158  _( "Filter on footprint name, keywords, description and pad count.\n"
159  "Search terms are separated by spaces. All search terms must match.\n"
160  "A term which is a number will also match against the pad count." ) );
161  fpSizer->Add( m_fpFilter, 0, wxEXPAND, 5 );
162 
163  m_fpList = new wxListBox( fpPanel, ID_MODVIEW_FOOTPRINT_LIST, wxDefaultPosition, wxDefaultSize,
164  0, NULL, wxLB_HSCROLL | wxNO_BORDER );
165  fpSizer->Add( m_fpList, 1, wxEXPAND, 5 );
166 
167  fpPanel->SetSizer( fpSizer );
168  fpPanel->Fit();
169 
170  SetBoard( new BOARD() );
171  // In viewer, the default net clearance is not known (it depends on the actual board).
172  // So we do not show the default clearance, by setting it to 0
173  // The footprint or pad specific clearance will be shown
175 
176  // Don't show the default board solder mask clearance in the footprint viewer. Only the
177  // footprint or pad clearance setting should be shown if it is not 0.
179 
180  // Ensure all layers and items are visible:
182  SetScreen( new PCB_SCREEN( GetPageSizeIU() ) );
183 
184  GetScreen()->m_Center = true; // Center coordinate origins on screen.
185  LoadSettings( config() );
187 
188  // Create GAL canvas
190  auto drawPanel = new PCB_DRAW_PANEL_GAL( this, -1, wxPoint( 0, 0 ), m_FrameSize,
192  SetCanvas( drawPanel );
193 
194  // Create the manager and dispatcher & route draw panel events to the dispatcher
196  m_toolManager->SetEnvironment( GetBoard(), drawPanel->GetView(),
197  drawPanel->GetViewControls(), config(), this );
198  m_actions = new PCB_ACTIONS();
200  drawPanel->SetEventDispatcher( m_toolDispatcher );
201 
204  m_toolManager->RegisterTool( new COMMON_TOOLS ); // for std context menus (zoom & grid)
206  m_toolManager->RegisterTool( new PCBNEW_PICKER_TOOL ); // for setting grid origin
209 
210  m_toolManager->GetTool<PCB_VIEWER_TOOLS>()->SetFootprintFrame( true );
211 
213  m_toolManager->InvokeTool( "pcbnew.InteractiveSelection" );
214 
215  ReCreateMenuBar();
219 
221  UpdateTitle();
222 
223  // If a footprint was previously loaded, reload it
224  if( getCurNickname().size() && getCurFootprintName().size() )
225  {
226  LIB_ID id;
227 
229  id.SetLibItemName( getCurFootprintName() );
230  GetBoard()->Add( loadFootprint( id ) );
231  }
232 
233  drawPanel->DisplayBoard( m_Pcb );
234 
235  m_auimgr.SetManagedWindow( this );
236 
237  // Horizontal items; layers 4 - 6
238  m_auimgr.AddPane( m_mainToolBar, EDA_PANE().VToolbar().Name( "MainToolbar" ).Top().Layer(6) );
239  m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( "OptToolbar" ).Left().Layer(3) );
240  m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" ).Bottom().Layer(6) );
241 
242  // Vertical items; layers 1 - 3
243  m_auimgr.AddPane( libPanel, EDA_PANE().Palette().Name( "Libraries" ).Left().Layer(2)
244  .CaptionVisible( false ).MinSize( 100, -1 ).BestSize( 200, -1 ) );
245  m_auimgr.AddPane( fpPanel, EDA_PANE().Palette().Name( "Footprints" ).Left().Layer( 1)
246  .CaptionVisible( false ).MinSize( 100, -1 ).BestSize( 300, -1 ) );
247 
248  m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" ).Center() );
249 
250  // after changing something to the aui manager call Update() to reflect the changes
251  m_auimgr.Update();
252 
253  // The canvas should not steal the focus from the list boxes
254  GetCanvas()->SetCanFocus( false );
255  GetCanvas()->GetGAL()->SetAxesEnabled( true );
257 
258  // Restore last zoom. (If auto-zooming we'll adjust when we load the footprint.)
260  wxASSERT( cfg );
262 
263  updateView();
264  InitExitKey();
265 
266  if( !IsModal() ) // For modal mode, calling ShowModal() will show this frame
267  {
269  Raise(); // On some window managers, this is needed
270  Show( true );
271  }
272 }
273 
274 
276 {
277  // Shutdown all running tools
278  if( m_toolManager )
280 
281  GetCanvas()->StopDrawing();
282  GetCanvas()->GetView()->Clear();
283  // Be sure any event cannot be fired after frame deletion:
284  GetCanvas()->SetEvtHandlerEnabled( false );
285 }
286 
287 
288 void FOOTPRINT_VIEWER_FRAME::OnCloseWindow( wxCloseEvent& Event )
289 {
290  // A workaround to avoid flicker, in modal mode when modview frame is destroyed,
291  // when the aui toolbar is not docked (i.e. shown in a miniframe)
292  // (useful on windows only)
293  m_mainToolBar->SetFocus();
294 
295  GetCanvas()->StopDrawing();
296 
297  if( IsModal() )
298  {
299  // Only dismiss a modal frame once, so that the return values set by
300  // the prior DismissModal() are not bashed for ShowModal().
301  if( !IsDismissed() )
302  DismissModal( false );
303 
304  // window to be destroyed by the caller of KIWAY_PLAYER::ShowModal()
305  }
306  else
307  Destroy();
308 }
309 
310 
311 void FOOTPRINT_VIEWER_FRAME::OnSize( wxSizeEvent& SizeEv )
312 {
313  if( m_auimgr.GetManagedWindow() )
314  m_auimgr.Update();
315 
316  SizeEv.Skip();
317 }
318 
319 
321 {
322  m_libList->Clear();
323 
324  std::vector<wxString> nicknames = Prj().PcbFootprintLibs()->GetLogicalLibs();
325  std::set<wxString> excludes;
326 
327  if( !m_libFilter->GetValue().IsEmpty() )
328  {
329  wxStringTokenizer tokenizer( m_libFilter->GetValue() );
330 
331  while( tokenizer.HasMoreTokens() )
332  {
333  const wxString term = tokenizer.GetNextToken().Lower();
334  EDA_COMBINED_MATCHER matcher( term );
335  int matches, position;
336 
337  for( const wxString& nickname : nicknames )
338  {
339  if( !matcher.Find( nickname.Lower(), matches, position ) )
340  excludes.insert( nickname );
341  }
342  }
343  }
344 
345  for( const wxString& nickname : nicknames )
346  {
347  if( !excludes.count( nickname ) )
348  m_libList->Append( nickname );
349  }
350 
351  // Search for a previous selection:
352  int index = m_libList->FindString( getCurNickname(), true );
353 
354  if( index == wxNOT_FOUND )
355  {
356  if( m_libList->GetCount() > 0 )
357  {
358  m_libList->SetSelection( 0 );
359  wxCommandEvent dummy;
361  }
362  else
363  {
364  setCurNickname( wxEmptyString );
365  setCurFootprintName( wxEmptyString );
366  }
367  }
368  else
369  {
370  m_libList->SetSelection( index, true );
371  wxCommandEvent dummy;
373  }
374 
375  GetCanvas()->Refresh();
376 }
377 
378 
380 {
381  m_fpList->Clear();
382 
383  if( !getCurNickname() )
384  setCurFootprintName( wxEmptyString );
385 
386  auto fp_info_list = FOOTPRINT_LIST::GetInstance( Kiway() );
387 
388  wxString nickname = getCurNickname();
389 
390  fp_info_list->ReadFootprintFiles( Prj().PcbFootprintLibs(), !nickname ? NULL : &nickname );
391 
392  if( fp_info_list->GetErrorCount() )
393  {
394  fp_info_list->DisplayErrors( this );
395 
396  // For footprint libraries that support one footprint per file, there may have been
397  // valid footprints read so show the footprints that loaded properly.
398  if( fp_info_list->GetList().empty() )
399  return;
400  }
401 
402  std::set<wxString> excludes;
403 
404  if( !m_fpFilter->GetValue().IsEmpty() )
405  {
406  wxStringTokenizer tokenizer( m_fpFilter->GetValue() );
407 
408  while( tokenizer.HasMoreTokens() )
409  {
410  const wxString term = tokenizer.GetNextToken().Lower();
411  EDA_COMBINED_MATCHER matcher( term );
412  int matches, position;
413 
414  for( const std::unique_ptr<FOOTPRINT_INFO>& footprint : fp_info_list->GetList() )
415  {
416  wxString search = footprint->GetFootprintName() + " " + footprint->GetSearchText();
417  bool matched = matcher.Find( search.Lower(), matches, position );
418 
419  if( !matched && term.IsNumber() )
420  matched = ( wxAtoi( term ) == (int)footprint->GetPadCount() );
421 
422  if( !matched )
423  excludes.insert( footprint->GetFootprintName() );
424  }
425  }
426  }
427 
428  for( const std::unique_ptr<FOOTPRINT_INFO>& footprint : fp_info_list->GetList() )
429  {
430  if( !excludes.count( footprint->GetFootprintName() ) )
431  m_fpList->Append( footprint->GetFootprintName() );
432  }
433 
434  int index = m_fpList->FindString( getCurFootprintName(), true );
435 
436  if( index == wxNOT_FOUND )
437  {
438  if( m_fpList->GetCount() > 0 )
439  {
440  m_fpList->SetSelection( 0 );
441  m_fpList->EnsureVisible( 0 );
442 
443  wxCommandEvent dummy;
445  }
446  else
447  setCurFootprintName( wxEmptyString );
448  }
449  else
450  {
451  m_fpList->SetSelection( index, true );
452  m_fpList->EnsureVisible( index );
453  }
454 }
455 
456 
457 void FOOTPRINT_VIEWER_FRAME::OnLibFilter( wxCommandEvent& aEvent )
458 {
460 
461  // Required to avoid interaction with SetHint()
462  // See documentation for wxTextEntry::SetHint
463  aEvent.Skip();
464 }
465 
466 
467 void FOOTPRINT_VIEWER_FRAME::OnFPFilter( wxCommandEvent& aEvent )
468 {
470 
471  // Required to avoid interaction with SetHint()
472  // See documentation for wxTextEntry::SetHint
473  aEvent.Skip();
474 }
475 
476 
477 void FOOTPRINT_VIEWER_FRAME::OnCharHook( wxKeyEvent& aEvent )
478 {
479  if( aEvent.GetKeyCode() == WXK_UP )
480  {
481  wxWindow* focused = FindFocus();
482 
483  if( m_libFilter->HasFocus() || m_libList->HasFocus() )
485  else
486  selectPrev( m_fpList );
487 
488  // Need to reset the focus after selection due to GTK mouse-refresh
489  // that captures the mouse into the canvas to update scrollbars
490  if( focused )
491  focused->SetFocus();
492  }
493  else if( aEvent.GetKeyCode() == WXK_DOWN )
494  {
495  wxWindow* focused = FindFocus();
496 
497  if( m_libFilter->HasFocus() || m_libList->HasFocus() )
499  else
500  selectNext( m_fpList );
501 
502  // Need to reset the focus after selection due to GTK mouse-refresh
503  // that captures the mouse into the canvas to update scrollbars
504  if( focused )
505  focused->SetFocus();
506  }
507  else if( aEvent.GetKeyCode() == WXK_TAB && m_libFilter->HasFocus() )
508  {
509  if( !aEvent.ShiftDown() )
510  m_fpFilter->SetFocus();
511  else
512  aEvent.Skip();
513  }
514  else if( aEvent.GetKeyCode() == WXK_TAB && m_fpFilter->HasFocus() )
515  {
516  if( aEvent.ShiftDown() )
517  m_libFilter->SetFocus();
518  else
519  aEvent.Skip();
520  }
521  else if( aEvent.GetKeyCode() == WXK_RETURN && m_fpList->GetSelection() >= 0 )
522  {
523  wxCommandEvent dummy;
525  }
526  else
527  aEvent.Skip();
528 }
529 
530 
531 void FOOTPRINT_VIEWER_FRAME::selectPrev( wxListBox* aListBox )
532 {
533  int prev = aListBox->GetSelection() - 1;
534 
535  if( prev >= 0 )
536  {
537  aListBox->SetSelection( prev );
538  aListBox->EnsureVisible( prev );
539 
540  wxCommandEvent dummy;
541 
542  if( aListBox == m_libList )
544  else
546  }
547 }
548 
549 
550 void FOOTPRINT_VIEWER_FRAME::selectNext( wxListBox* aListBox )
551 {
552  int next = aListBox->GetSelection() + 1;
553 
554  if( next < (int)aListBox->GetCount() )
555  {
556  aListBox->SetSelection( next );
557  aListBox->EnsureVisible( next );
558 
559  wxCommandEvent dummy;
560 
561  if( aListBox == m_libList )
563  else
565  }
566 }
567 
568 
569 void FOOTPRINT_VIEWER_FRAME::ClickOnLibList( wxCommandEvent& aEvent )
570 {
571  int ii = m_libList->GetSelection();
572 
573  if( ii < 0 )
574  return;
575 
576  wxString name = m_libList->GetString( ii );
577 
578  if( getCurNickname() == name )
579  return;
580 
581  setCurNickname( name );
582 
584  UpdateTitle();
585 
586  // The m_libList has now the focus, in order to be able to use arrow keys
587  // to navigate inside the list.
588  // the gal canvas must not steal the focus to allow navigation
589  GetCanvas()->SetStealsFocus( false );
590  m_libList->SetFocus();
591 }
592 
593 
594 void FOOTPRINT_VIEWER_FRAME::ClickOnFootprintList( wxCommandEvent& aEvent )
595 {
596  if( m_fpList->GetCount() == 0 )
597  return;
598 
599  int ii = m_fpList->GetSelection();
600 
601  if( ii < 0 )
602  return;
603 
604  wxString name = m_fpList->GetString( ii );
605 
606  if( getCurFootprintName().CmpNoCase( name ) != 0 )
607  {
609 
610  // Delete the current footprint (MUST reset tools first)
612 
614 
615  LIB_ID id;
617  id.SetLibItemName( getCurFootprintName() );
618 
619  try
620  {
621  GetBoard()->Add( loadFootprint( id ) );
622  }
623  catch( const IO_ERROR& ioe )
624  {
625  wxString msg = wxString::Format( _( "Could not load footprint '%s' from library '%s'."
626  "\n\n%s" ),
628  getCurNickname(),
629  ioe.Problem() );
630  DisplayError( this, msg );
631  }
632 
633  UpdateTitle();
634 
635  updateView();
636 
637  GetCanvas()->Refresh();
638  Update3DView( true );
639  }
640 
641  // The m_fpList has now the focus, in order to be able to use arrow keys
642  // to navigate inside the list.
643  // the gal canvas must not steal the focus to allow navigation
644  GetCanvas()->SetStealsFocus( false );
645  m_fpList->SetFocus();
646 }
647 
648 
649 void FOOTPRINT_VIEWER_FRAME::DClickOnFootprintList( wxCommandEvent& aEvent )
650 {
651  AddFootprintToPCB( aEvent );
652 }
653 
654 
655 void FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB( wxCommandEvent& aEvent )
656 {
657  if( IsModal() )
658  {
659  if( m_fpList->GetSelection() >= 0 )
660  {
661  LIB_ID fpid( getCurNickname(), m_fpList->GetStringSelection() );
662  DismissModal( true, fpid.Format() );
663  }
664  else
665  {
666  DismissModal( false );
667  }
668 
669  Close( true );
670  }
671  else if( GetBoard()->GetFirstModule() )
672  {
673  PCB_EDIT_FRAME* pcbframe = (PCB_EDIT_FRAME*) Kiway().Player( FRAME_PCB_EDITOR, false );
674 
675  if( pcbframe == NULL ) // happens when the board editor is not active (or closed)
676  {
677  DisplayErrorMessage( this, _( "No board currently open." ) );
678  return;
679  }
680 
682  BOARD_COMMIT commit( pcbframe );
683 
684  // Create the "new" module
685  MODULE* newmodule = (MODULE*) GetBoard()->GetFirstModule()->Duplicate();
686  newmodule->SetParent( pcbframe->GetBoard() );
687  newmodule->SetLink( 0 );
688 
689  KIGFX::VIEW_CONTROLS* viewControls = pcbframe->GetCanvas()->GetViewControls();
690  VECTOR2D cursorPos = viewControls->GetCursorPosition();
691 
692  commit.Add( newmodule );
693  viewControls->SetCrossHairCursorPosition( VECTOR2D( 0, 0 ), false );
694  pcbframe->PlaceModule( newmodule );
695  newmodule->SetPosition( wxPoint( 0, 0 ) );
696  viewControls->SetCrossHairCursorPosition( cursorPos, false );
697  commit.Push( wxT( "Insert module" ) );
698 
699  pcbframe->Raise();
700  pcbframe->GetToolManager()->RunAction( PCB_ACTIONS::placeModule, true, newmodule );
701 
702  newmodule->ClearFlags();
703  }
704 }
705 
706 
708 {
709  auto cfg = dynamic_cast<PCBNEW_SETTINGS*>( aCfg );
710  wxCHECK( cfg, /*void*/ );
711 
712  // We don't allow people to change this right now, so make sure it's on
714 
716 
717  // Fetch grid settings from Footprint Editor
718  auto fpedit = Pgm().GetSettingsManager().GetAppSettings<FOOTPRINT_EDITOR_SETTINGS>();
719 
720  GetGalDisplayOptions().ReadWindowSettings( fpedit->m_Window );
721 }
722 
723 
725 {
726  auto cfg = dynamic_cast<PCBNEW_SETTINGS*>( aCfg );
727  wxCHECK( cfg, /*void*/ );
728 
729  // We don't want to store anything other than the window settings
731 
732  cfg->m_FootprintViewerZoom = GetCanvas()->GetView()->GetScale();
733 }
734 
735 
737 {
738  auto cfg = dynamic_cast<PCBNEW_SETTINGS*>( aCfg );
739  wxCHECK_MSG( cfg, nullptr, "config not existing" );
740 
741  return &cfg->m_FootprintViewer;
742 }
743 
744 
746 {
747  auto* settings = Pgm().GetSettingsManager().GetAppSettings<FOOTPRINT_EDITOR_SETTINGS>();
748 
749  if( settings )
750  return Pgm().GetSettingsManager().GetColorSettings( settings->m_ColorTheme );
751  else
752  return Pgm().GetSettingsManager().GetColorSettings();
753 }
754 
755 
757 {
758  // It is stored in pcbnew's settings
760  wxCHECK( cfg, false );
761  return cfg->m_FootprintViewerAutoZoom;
762 }
763 
764 
766 {
767  // It is stored in pcbnew's settings
769  wxASSERT( cfg );
770  cfg->m_FootprintViewerAutoZoom = aAutoZoom;
771 }
772 
773 
775 {
776  PCB_BASE_FRAME::CommonSettingsChanged( aEnvVarsChanged );
777 
778  if( aEnvVarsChanged )
780 }
781 
782 
784 {
786 }
787 
788 
789 void FOOTPRINT_VIEWER_FRAME::setCurNickname( const wxString& aNickname )
790 {
792 }
793 
794 
796 {
798 }
799 
800 
801 void FOOTPRINT_VIEWER_FRAME::setCurFootprintName( const wxString& aName )
802 {
804 }
805 
806 
807 void FOOTPRINT_VIEWER_FRAME::OnActivate( wxActivateEvent& event )
808 {
809  if( event.GetActive() )
810  {
811  // Ensure we have the right library list:
812  std::vector< wxString > libNicknames = Prj().PcbFootprintLibs()->GetLogicalLibs();
813  bool stale = false;
814 
815  if( libNicknames.size() != m_libList->GetCount() )
816  stale = true;
817  else
818  {
819  for( unsigned ii = 0; ii < libNicknames.size(); ii++ )
820  {
821  if( libNicknames[ii] != m_libList->GetString( ii ) )
822  {
823  stale = true;
824  break;
825  }
826  }
827  }
828 
829  if( stale )
830  {
832  UpdateTitle();
833  }
834  }
835 
836  event.Skip(); // required under wxMAC
837 }
838 
839 
840 void FOOTPRINT_VIEWER_FRAME::OnUpdateFootprintButton( wxUpdateUIEvent& aEvent )
841 {
842  aEvent.Enable( GetBoard()->GetFirstModule() != nullptr );
843 }
844 
845 
846 bool FOOTPRINT_VIEWER_FRAME::ShowModal( wxString* aFootprint, wxWindow* aParent )
847 {
848  if( aFootprint && !aFootprint->IsEmpty() )
849  {
850  wxString msg;
851  LIB_TABLE* fpTable = Prj().PcbFootprintLibs();
852  LIB_ID fpid;
853 
854  fpid.Parse( *aFootprint, LIB_ID::ID_PCB, true );
855 
856  if( fpid.IsValid() )
857  {
858  wxString nickname = fpid.GetLibNickname();
859 
860  if( !fpTable->HasLibrary( fpid.GetLibNickname(), false ) )
861  {
862  msg.sprintf( _( "The current configuration does not include a library with the\n"
863  "nickname \"%s\". Use Manage Footprint Libraries\n"
864  "to edit the configuration." ), nickname );
865  DisplayErrorMessage( aParent, _( "Footprint library not found." ), msg );
866  }
867  else if ( !fpTable->HasLibrary( fpid.GetLibNickname(), true ) )
868  {
869  msg.sprintf( _( "The library with the nickname \"%s\" is not enabled\n"
870  "in the current configuration. Use Manage Footprint Libraries to\n"
871  "edit the configuration." ), nickname );
872  DisplayErrorMessage( aParent, _( "Footprint library not enabled." ), msg );
873  }
874  else
875  {
876  // Update last selection:
877  setCurNickname( nickname );
879  m_libList->SetStringSelection( nickname );
880  }
881  }
882  }
883 
884  // Rebuild the fp list from the last selected library,
885  // and show the last selected footprint
888 
889  bool retval = KIWAY_PLAYER::ShowModal( aFootprint, aParent );
890 
891  m_libFilter->SetFocus();
892  return retval;
893 }
894 
895 
896 void FOOTPRINT_VIEWER_FRAME::Update3DView( bool aForceReload, const wxString* aTitle )
897 {
898  wxString title = wxString::Format( _( "3D Viewer" ) + wxT( " \u2014 %s" ),
900  PCB_BASE_FRAME::Update3DView( aForceReload, &title );
901 }
902 
903 
905 {
906  return GetColorSettings()->GetColor( LAYER_GRID );
907 }
908 
909 
911 {
912  switch( event.GetId() )
913  {
914  case ID_MODVIEW_NEXT:
916  break;
917 
918  case ID_MODVIEW_PREVIOUS:
920  break;
921 
922  default:
923  wxString id = wxString::Format( "%i", event.GetId() );
924  wxFAIL_MSG( "FOOTPRINT_VIEWER_FRAME::OnIterateFootprintList error: id = " + id );
925  }
926 }
927 
928 
930 {
931  wxString title;
932  wxString path;
933 
934  title.Printf( _( "Footprint Library Browser" ) + L" \u2014 %s",
935  getCurNickname().IsEmpty() ? _( "no library selected" ) : getCurNickname() );
936 
937  // Now, add the full path, for info
938  if( !getCurNickname().IsEmpty() )
939  {
940  FP_LIB_TABLE* libtable = Prj().PcbFootprintLibs();
941  const LIB_TABLE_ROW* row = libtable->FindRow( getCurNickname() );
942 
943  if( row )
944  title << L" \u2014 " << row->GetFullURI( true );
945  }
946 
947  SetTitle( title );
948 }
949 
950 
952 {
953  if( !getCurNickname() )
954  return;
955 
956  int selection = m_fpList->FindString( getCurFootprintName(), true );
957 
958  if( aMode == NEXT_PART )
959  {
960  if( selection != wxNOT_FOUND && selection < (int)m_fpList->GetCount() - 1 )
961  selection++;
962  }
963 
964  if( aMode == PREVIOUS_PART )
965  {
966  if( selection != wxNOT_FOUND && selection > 0 )
967  selection--;
968  }
969 
970  if( selection != wxNOT_FOUND )
971  {
972  m_fpList->SetSelection( selection );
973  m_fpList->EnsureVisible( selection );
974 
975  setCurFootprintName( m_fpList->GetString((unsigned) selection ) );
976 
977  // Delete the current footprint
979 
982 
983  if( footprint )
984  GetBoard()->Add( footprint, ADD_MODE::APPEND );
985 
986  Update3DView( true );
987 
988  updateView();
989  }
990 
991  UpdateTitle();
992 
993  GetCanvas()->Refresh();
994 }
995 
996 
998 {
999  GetCanvas()->UpdateColors();
1001 
1003 
1004  if( GetAutoZoom() )
1006  else
1008 
1009  UpdateMsgPanel();
1010 }
1011 
1012 
1013 void FOOTPRINT_VIEWER_FRAME::OnExitKiCad( wxCommandEvent& event )
1014 {
1015  Kiway().OnKiCadExit();
1016 }
1017 
1018 
1020 {
1021  Close( false );
1022 }
1023 
1024 
1026 {
1027  return GetBoard()->GetFirstModule();
1028 }
1029 
void ShutdownAllTools()
Shutdown all tools with a currently registered event loop in this tool manager by waking them up with...
static TOOL_ACTION selectionClear
Clears the current selection.
Definition: pcb_actions.h:62
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:239
CITER next(CITER it)
Definition: ptree.cpp:130
void SetLink(const KIID &aLink)
Definition: class_module.h:547
int m_SolderMaskMargin
Solder mask margin.
static TOOL_ACTION placeModule
Definition: pcb_actions.h:153
virtual void SetBoard(BOARD *aBoard)
Function SetBoard sets the m_Pcb member in such as way as to ensure deleting any previous BOARD.
void DClickOnFootprintList(wxCommandEvent &aEvent)
const UTF8 & GetLibItemName() const
Definition: lib_id.h:114
const BITMAP_OPAQUE modview_icon_xpm[1]
void OnKiCadExit()
Definition: kiway.cpp:523
#define PREVIOUS_PART
void OnExitKiCad(wxCommandEvent &event)
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_holder.h:56
bool ShowModal(wxString *aFootprint, wxWindow *aParent) override
Function ShowModal.
bool HasLibrary(const wxString &aNickname, bool aCheckEnabled=false) const
Test for the existence of aNickname in the library table.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:104
KIGFX::VIEW_CONTROLS * GetViewControls() const
Function GetViewControls() Returns a pointer to the VIEW_CONTROLS instance used in the panel.
void UpdateTitle()
Function UpdateTitle updates the window title with current library information.
Hold a record identifying a library accessed by the appropriate plug in object in the LIB_TABLE.
#define FOOTPRINT_VIEWER_FRAME_NAME_MODAL
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
Definition: confirm.cpp:252
KIGFX::GAL_DISPLAY_OPTIONS & GetGalDisplayOptions()
Return a reference to the gal rendering options used by GAL for rendering.
virtual APP_SETTINGS_BASE * config() const
Returns the settings object used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME.
Model changes (required full reload)
Definition: tool_base.h:82
This file is part of the common library.
WINDOW_SETTINGS * GetWindowSettings(APP_SETTINGS_BASE *aCfg) override
Returns a pointer to the window settings for this frame.
bool IsDismissed()
Function IsDismissed returns false only if both the frame is acting in modal mode and it has not been...
ACTION_TOOLBAR * m_optionsToolBar
COMMIT & Add(EDA_ITEM *aItem)
Adds a new item to the model
Definition: commit.h:78
virtual void SetScreen(BASE_SCREEN *aScreen)
FRAME_T
Enum FRAME_T is the set of EDA_BASE_FRAME derivatives, typically stored in EDA_BASE_FRAME::m_Ident.
Definition: frame_type.h:34
EDA_DRAW_PANEL_GAL::GAL_TYPE m_canvasType
The current canvas type.
void setCurFootprintName(const wxString &aName)
SELECTION_TOOL.
void OnCloseWindow(wxCloseEvent &Event) override
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
MODULE * FootprintLoad(const wxString &aNickname, const wxString &aFootprintName)
Function FootprintLoad.
Component library viewer main window.
bool GetAutoZoom() override
Always returns false.
void CommonSettingsChanged(bool aEnvVarsChanged) override
Notification event that some of the common (suite-wide) settings have changed.
FOOTPRINT_VIEWER_FRAME(KIWAY *aKiway, wxWindow *aParent, FRAME_T aFrameType)
static TOOL_ACTION zoomFitScreen
Definition: actions.h:93
void selectNext(wxListBox *aListBox)
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:140
wxString m_AboutTitle
EDA_DRAW_PANEL_GAL::GAL_TYPE LoadCanvasTypeSetting()
Returns the canvas type stored in the application settings.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:551
void SetVisibleAlls()
Function SetVisibleAlls changes the bit-mask of visible element categories and layers.
wxAuiManager m_auimgr
void SetAutoZoom(bool aAutoZoom) override
Does nothing.
#define PARENT_STYLE
ACTION_TOOLBAR * m_mainToolBar
double m_FootprintViewerZoom
The last zoom level in the footprint viewer.
PCBNEW_SETTINGS * GetPcbNewSettings()
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
void LoadSettings(APP_SETTINGS_BASE *aCfg) override
Load common frame parameters from a configuration file.
The base class for create windows for drawing purpose.
void OnSize(wxSizeEvent &event) override
Recalculate the size of toolbars and display panel when the frame size changes.
bool IsValid() const
Definition: lib_id.h:171
void setCurNickname(const wxString &aNickname)
void OnUpdateFootprintButton(wxUpdateUIEvent &aEvent)
Update the ID_ADD_FOOTPRINT_TO_BOARD tool state in main toolbar.
virtual const wxString Problem() const
what was the problem?
Definition: exceptions.cpp:49
bool always_show_cursor
Definition: app_settings.h:42
#define NEW_PART
bool InvokeTool(TOOL_ID aToolId)
Function InvokeTool() Calls a tool by sending a tool activation event to tool of given ID.
virtual void SetParent(EDA_ITEM *aParent)
Definition: base_struct.h:196
void SaveSettings(APP_SETTINGS_BASE *aCfg) override
Saves common frame parameters to a configuration data file.
PCBNEW_CONTROL.
Abstract pattern-matching tool and implementations.
COLOR_SETTINGS * GetColorSettings() override
Helper to retrieve the current color settings.
bool m_axesEnabled
Whether or not to draw the coordinate system axes
void ClickOnLibList(wxCommandEvent &aEvent)
const wxString GetFullURI(bool aSubstituted=false) const
Return the full location specifying URI for the LIB, either in original UI form or in environment var...
TOOL_MANAGER.
Definition: tool_manager.h:51
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:80
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT) override
Adds an item to the container.
Stores the common settings that are saved and loaded for each window / frame.
Definition: app_settings.h:68
static FOOTPRINT_LIST * GetInstance(KIWAY &aKiway)
Factory function to return a FOOTPRINT_LIST via Kiway.
static TOOL_ACTION centerContents
Definition: actions.h:96
void SelectAndViewFootprint(int aMode)
Function SelectAndViewFootprint Select and load the next or the previous footprint if no current foot...
Generic tool for picking a point.
void LoadSettings(APP_SETTINGS_BASE *aCfg) override
Load common frame parameters from a configuration file.
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
Definition: app_settings.h:91
CURSOR_SETTINGS cursor
Definition: app_settings.h:80
virtual void ActivateGalCanvas() override
#define NULL
VECTOR2< double > VECTOR2D
Definition: vector2d.h:593
VTBL_ENTRY KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=NULL)
Function Player returns the KIWAY_PLAYER* given a FRAME_T.
Definition: kiway.cpp:342
void DisplayBoard(BOARD *aBoard)
Function DisplayBoard adds all items from the current board to the VIEW, so they can be displayed by ...
void Clear()
Function Clear() Removes all items from the view.
Definition: view.cpp:1111
void SetClearance(int aClearance)
Definition: netclass.h:166
bool m_Center
Center on screen.
Definition: base_screen.h:71
#define NEXT_PART
EDA_MSG_PANEL * m_messagePanel
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
void SetStealsFocus(bool aStealsFocus)
Set whether focus is taken on certain events (mouseover, keys, etc).
void OnCharHook(wxKeyEvent &aEvent) override
Capture the key event before it is sent to the GUI.
ACTIONS * m_actions
Definition: tools_holder.h:49
bool Find(const wxString &aTerm, int &aMatchersTriggered, int &aPosition)
MODULE * GetFirstModule() const
Gets the first module in the list (used in footprint viewer/editor) or NULL if none.
Definition: class_board.h:330
Definition of file extensions used in Kicad.
Helper dialog and control classes.
void ResetTools(TOOL_BASE::RESET_REASON aReason)
Function ResetTools() Resets all tools (i.e.
KIWAY is a minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the s...
Definition: kiway.h:273
VIEW_CONTROLS is an interface for classes handling user events controlling the view behaviour (such a...
KIGFX::GAL * GetGAL() const
Function GetGAL() Returns a pointer to the GAL instance used in the panel.
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Definition: lib_id.h:97
void OnActivate(wxActivateEvent &event)
Function OnActivate is called when the frame frame is activate to reload the libraries and component ...
virtual void SetCrossHairCursorPosition(const VECTOR2D &aPosition, bool aWarpView=true)=0
Moves the graphic crosshair cursor to the requested position expressed in world coordinates.
#define MODAL_STYLE
void SetPosition(const wxPoint &aPos) override
void CommonSettingsChanged(bool aEnvVarsChanged) override
Notification event that some of the common (suite-wide) settings have changed.
#define FOOTPRINT_VIEWER_FRAME_NAME
void InitExitKey()
Sets the common key-pair for exiting the application (Ctrl-Q) and ties it to the wxID_EXIT event id.
void OnFPFilter(wxCommandEvent &aEvent)
COMMON_CONTROL.
void selectPrev(wxListBox *aListBox)
void SetAxesEnabled(bool aAxesEnabled)
Enables drawing the axes.
virtual KIGFX::PCB_VIEW * GetView() const override
Function GetView() Returns a pointer to the VIEW instance used in the panel.
Specialization of the wxAuiPaneInfo class for KiCad panels.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
TOOL_DISPATCHER * m_toolDispatcher
Definition: tools_holder.h:50
COMMON_TOOLS.
Definition: common_tools.h:38
void UpdateColors()
Updates the color settings in the painter and GAL.
TOOL_DISPATCHER.
void SetModal(bool aIsModal)
Definition: kiway_player.h:177
void SaveSettings(APP_SETTINGS_BASE *aCfg) override
Saves common frame parameters to a configuration data file.
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:206
#define NONMODAL_STYLE
VTBL_ENTRY FP_LIB_TABLE * PcbFootprintLibs(KIWAY &aKiway)
Return the table of footprint libraries.
Definition: project.cpp:284
int SetLibNickname(const UTF8 &aNickname)
Override the logical library name portion of the LIB_ID to aNickname.
Definition: lib_id.cpp:193
virtual void SetScale(double aScale, VECTOR2D aAnchor={ 0, 0 })
Function SetScale() Sets the scaling factor, zooming around a given anchor point.
Definition: view.cpp:578
const FP_LIB_TABLE_ROW * FindRow(const wxString &aNickName)
Function FindRow.
void SetCanvas(EDA_DRAW_PANEL_GAL *aPanel)
COLOR4D GetColor(int aLayer) const
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:221
PCB_ACTIONS.
Definition: pcb_actions.h:51
TOOL_MANAGER * m_toolManager
Definition: tools_holder.h:48
see class PGM_BASE
void OnSelectGrid(wxCommandEvent &event)
Command event handler for selecting grid sizes.
Declaration of the eda_3d_viewer class.
const char * name
Definition: DXF_plotter.cpp:60
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
void CloseFootprintViewer(wxCommandEvent &event)
void AddFootprintToPCB(wxCommandEvent &aEvent)
Function AddFootprintToPCB exports the current footprint name and close the library browser.
void ReCreateMenuBar() override
Recreates the menu bar.
static LIB_PART * dummy()
Used to draw a dummy shape when a LIB_PART is not found in library.
void ClickOnFootprintList(wxCommandEvent &aEvent)
void DismissModal(bool aRetVal, const wxString &aResult=wxEmptyString)
BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:180
void SetEnvironment(EDA_ITEM *aModel, KIGFX::VIEW *aView, KIGFX::VIEW_CONTROLS *aViewControls, APP_SETTINGS_BASE *aSettings, TOOLS_HOLDER *aFrame)
Sets the work environment (model, view, view controls and the parent window).
#define _(s)
Definition: 3d_actions.cpp:33
bool IsModal() const
Definition: kiway_player.h:176
void ReCreateLibraryList()
Function ReCreateLibraryList.
GERBVIEW_FRAME::OnZipFileHistory GERBVIEW_FRAME::OnToggleShowLayerManager GERBVIEW_FRAME::OnSelectHighlightChoice EVT_UPDATE_UI(ID_TOOLBARH_GERBVIEW_SELECT_ACTIVE_LAYER, GERBVIEW_FRAME::OnUpdateLayerSelectBox) EVT_UPDATE_UI_RANGE(ID_TB_OPTIONS_SHOW_GBR_MODE_0
NETCLASS * GetDefault() const
Function GetDefault.
MAGNETIC_OPTIONS pads
PCB_EDIT_FRAME is the main frame for Pcbnew.
void OnLibFilter(wxCommandEvent &aEvent)
virtual void Push(const wxString &aMessage=wxT("A commit"), bool aCreateUndoEntry=true, bool aSetDirtyBit=true) override
Executes the changes.
PCB_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
PCB_VIEWER_TOOLS.
const wxSize GetPageSizeIU() const override
Works off of GetPageSettings() to return the size of the paper page in the internal units of this par...
bool Destroy() override
Our version of Destroy() which is virtual from wxWidgets.
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:233
MAGNETIC_SETTINGS m_magneticItems
Color settings are a bit different than most of the settings objects in that there can be more than o...
void DeleteAllModules()
Removes all modules from the deque and frees the memory associated with them.
Definition: class_board.h:338
BOARD_ITEM_CONTAINER * GetModel() const override
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
Definition: tools_holder.h:74
void OnIterateFootprintList(wxCommandEvent &event)
void InitTools()
Function InitTools() Initializes all registered tools.
Abstract interface for BOARD_ITEMs capable of storing other items inside.
BOARD * GetBoard() const
void PlaceModule(MODULE *aModule, bool aRecreateRatsnest=true)
Function PlaceModule places aModule at the current cursor position and updates module coordinates wit...
virtual void Update3DView(bool aForceReload, const wxString *aTitle=nullptr)
Update the 3D view, if the viewer is opened by this frame.
double GetScale() const
Function GetScale()
Definition: view.h:257
int Parse(const UTF8 &aId, LIB_ID_TYPE aType, bool aFix=false)
Parse LIB_ID with the information from aId.
Definition: lib_id.cpp:122
Message panel definition file.
bool m_FootprintViewerAutoZoom
Should the footprint viewer auto zoom on select.
virtual COLOR4D GetGridColor() override
void Update3DView(bool aForceReload, const wxString *aTitle=nullptr) override
Function Update3DView must be called after a footprint selection Updates the 3D view and 3D frame tit...
Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions con...
Definition: ki_exception.h:76
MODULE * loadFootprint(const LIB_ID &aFootprintId)
Function loadFootprint attempts to load aFootprintId from the footprint library table.
virtual bool ShowModal(wxString *aResult=NULL, wxWindow *aResultantFocusWindow=NULL)
Function ShowModal puts up this wxFrame as if it were a modal dialog, with all other instantiated wxF...
PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
void StopDrawing()
Function StopDrawing() Prevents the GAL canvas from further drawing till it is recreated or StartDraw...
virtual void OnSelectZoom(wxCommandEvent &event)
Set the zoom factor when selected by the zoom list box in the main tool bar.
VECTOR2D GetCursorPosition() const
Returns the current cursor position in world coordinates.
wxString m_configName
MAGNETIC_OPTIONS tracks
BOARD_ITEM * Duplicate() const
Function Duplicate creates a copy of a BOARD_ITEM.
void RegisterTool(TOOL_BASE *aTool)
Function RegisterTool() Adds a tool to the manager set and sets it up.
std::vector< wxString > GetLogicalLibs()
Return the logical library names, all of them that are pertinent to a look up done on this LIB_TABLE.
virtual void UpdateMsgPanel()
Redraw the message panel.
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:99
void ReadWindowSettings(WINDOW_SETTINGS &aCfg)
Read GAL config options from applicaton-level config.
Manage LIB_TABLE_ROW records (rows), and can be searched based on library nickname.