KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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 <[email protected]>
6 * Copyright The 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, see <https://www.gnu.org/licenses/>.
20 */
21
23#include <bitmaps.h>
24#include <board_commit.h>
25#include <board.h>
28#include <footprint.h>
29#include <confirm.h>
30#include <eda_pattern_match.h>
31#include <footprint_info.h>
34#include <kiway.h>
35#include <kiway_mail.h>
37#include <widgets/kistatusbar.h>
38#include <widgets/msgpanel.h>
39#include <widgets/wx_listbox.h>
42#include <pad.h>
43#include <pcb_draw_panel_gal.h>
44#include <pcb_painter.h>
45#include <pcbnew_id.h>
47#include <pgm_base.h>
48#include <pcbnew_settings.h>
49#include <project_pcb.h>
50#include <trace_helpers.h>
54#include <tool/action_toolbar.h>
55#include <tool/common_control.h>
56#include <tool/common_tools.h>
57#include <tool/selection.h>
59#include <tool/tool_manager.h>
60#include <tool/zoom_tool.h>
62#include <tools/pcb_actions.h>
64#include <tools/pcb_control.h>
70#include <wx/srchctrl.h>
71#include <wx/tokenzr.h>
72#include <wx/choice.h>
73#include <wx/hyperlink.h>
74
75#include "invoke_pcb_dialog.h"
76
77using namespace std::placeholders;
78
79BEGIN_EVENT_TABLE( FOOTPRINT_VIEWER_FRAME, PCB_BASE_FRAME )
80 // Window events
83
86
87 // Toolbar events
90
93
94 // listbox events
97
98END_EVENT_TABLE()
99
100
102 PCB_BASE_FRAME( aKiway, aParent, FRAME_FOOTPRINT_VIEWER, _( "Footprint Library Browser" ),
103 wxDefaultPosition, wxDefaultSize, KICAD_DEFAULT_DRAWFRAME_STYLE,
105 m_comp( LIB_ID(), wxEmptyString, wxEmptyString, KIID_PATH(), {} )
106{
107 m_aboutTitle = _HKI( "KiCad Footprint Library Browser" );
108
109 // Force the items to always snap
110 m_magneticItems.pads = MAGNETIC_OPTIONS::CAPTURE_ALWAYS;
111 m_magneticItems.tracks = MAGNETIC_OPTIONS::CAPTURE_ALWAYS;
112 m_magneticItems.graphics = true;
113
114 // Force the frame name used in config. the footprint viewer frame has a name
115 // depending on aFrameType (needed to identify the frame by wxWidgets),
116 // but only one configuration is preferable.
117 m_configName = FOOTPRINT_VIEWER_FRAME_NAME;
118
119 // Give an icon
120 wxIcon icon;
121 icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_footprint_browser ) );
122 SetIcon( icon );
123
124 m_libListWidth = 200;
125 m_fpListWidth = 300;
126
127 wxPanel* libPanel = new wxPanel( this );
128 wxSizer* libSizer = new wxBoxSizer( wxVERTICAL );
129
130 m_libFilter = new wxSearchCtrl( libPanel, ID_MODVIEW_LIB_FILTER, wxEmptyString,
131 wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
132 m_libFilter->SetDescriptiveText( _( "Filter" ) );
133 libSizer->Add( m_libFilter, 0, wxEXPAND, 5 );
134
135 m_libList = new WX_LISTBOX( libPanel, ID_MODVIEW_LIB_LIST, wxDefaultPosition, wxDefaultSize,
136 0, nullptr, wxLB_HSCROLL | wxNO_BORDER );
137 libSizer->Add( m_libList, 1, wxEXPAND, 5 );
138
139 libPanel->SetSizer( libSizer );
140 libPanel->Fit();
141
142 wxPanel* fpPanel = new wxPanel( this );
143 wxSizer* fpSizer = new wxBoxSizer( wxVERTICAL );
144
145 m_fpFilter = new wxSearchCtrl( fpPanel, ID_MODVIEW_FOOTPRINT_FILTER, wxEmptyString,
146 wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
147 m_fpFilter->SetDescriptiveText( _( "Filter" ) );
148 m_fpFilter->SetToolTip(
149 _( "Filter on footprint name, keywords, description and pad count.\n"
150 "Search terms are separated by spaces. All search terms must match.\n"
151 "A term which is a number will also match against the pad count." ) );
152 fpSizer->Add( m_fpFilter, 0, wxEXPAND, 5 );
153
154#ifdef __WXGTK__
155 // wxSearchCtrl vertical height is not calculated correctly on some GTK setups
156 // See https://gitlab.com/kicad/code/kicad/-/issues/9019
157 m_libFilter->SetMinSize( wxSize( -1, GetTextExtent( wxT( "qb" ) ).y + 10 ) );
158 m_fpFilter->SetMinSize( wxSize( -1, GetTextExtent( wxT( "qb" ) ).y + 10 ) );
159#endif
160
161 m_fpList = new WX_LISTBOX( fpPanel, ID_MODVIEW_FOOTPRINT_LIST, wxDefaultPosition, wxDefaultSize,
162 0, nullptr, wxLB_HSCROLL | wxNO_BORDER );
163
164 m_fpList->Connect( wxEVT_LEFT_DCLICK,
166 nullptr, this );
167 fpSizer->Add( m_fpList, 1, wxEXPAND, 5 );
168
169 fpPanel->SetSizer( fpSizer );
170 fpPanel->Fit();
171
172 // Create GAL canvas
173 m_canvasType = loadCanvasTypeSetting();
174
175 PCB_DRAW_PANEL_GAL* drawPanel = new PCB_DRAW_PANEL_GAL( this, -1, wxPoint( 0, 0 ), m_frameSize,
176 GetGalDisplayOptions(), m_canvasType );
177 SetCanvas( drawPanel );
178
179 SetBoard( new BOARD() );
180
181 // This board will only be used to hold a footprint for viewing
182 GetBoard()->SetBoardUse( BOARD_USE::FPHOLDER );
183
184 // In viewer, the default net clearance is not known (it depends on the actual board).
185 // So we do not show the default clearance, by setting it to 0
186 // The footprint or pad specific clearance will be shown
187 GetBoard()->GetDesignSettings().m_NetSettings->GetDefaultNetclass()->SetClearance( 0 );
188
189 // Don't show the default board solder mask clearance in the footprint viewer. Only the
190 // footprint or pad clearance setting should be shown if it is not 0.
191 GetBoard()->GetDesignSettings().m_SolderMaskExpansion = 0;
192
193 // Ensure all layers and items are visible:
194 GetBoard()->SetVisibleAlls();
195 SetScreen( new PCB_SCREEN( GetPageSizeIU() ) );
196
197 GetScreen()->m_Center = true; // Center coordinate origins on screen.
198 LoadSettings( config() );
199 GetGalDisplayOptions().m_axesEnabled = true;
200
201 // Create the manager and dispatcher & route draw panel events to the dispatcher
202 m_toolManager = new TOOL_MANAGER;
203 m_toolManager->SetEnvironment( GetBoard(), drawPanel->GetView(),
204 drawPanel->GetViewControls(), config(), this );
205 m_actions = new PCB_ACTIONS();
206 m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager );
207 drawPanel->SetEventDispatcher( m_toolDispatcher );
208
209 m_toolManager->RegisterTool( new PCB_CONTROL );
210 m_toolManager->RegisterTool( new PCB_SELECTION_TOOL );
211 m_toolManager->RegisterTool( new COMMON_TOOLS ); // for std context menus (zoom & grid)
212 m_toolManager->RegisterTool( new COMMON_CONTROL );
213 m_toolManager->RegisterTool( new PCB_PICKER_TOOL ); // for setting grid origin
214 m_toolManager->RegisterTool( new ZOOM_TOOL );
215 m_toolManager->RegisterTool( new PCB_VIEWER_TOOLS );
216
217 m_toolManager->GetTool<PCB_VIEWER_TOOLS>()->SetFootprintFrame( true );
218
219 m_toolManager->InitTools();
220 m_toolManager->InvokeTool( "common.InteractiveSelection" );
221
222 setupUIConditions();
223
224 m_toolbarSettings = GetToolbarSettings<FOOTPRINT_VIEWER_TOOLBAR_SETTINGS>( "fpviewer-toolbars" );
225 configureToolbars();
226 RecreateToolbars();
227 ReCreateMenuBar();
228
229 ReCreateLibraryList();
230 UpdateTitle();
231
232 // If a footprint was previously loaded, reload it
233 if( getCurNickname().size() && getCurFootprintName().size() )
234 {
235 LIB_ID id;
236
237 id.SetLibNickname( getCurNickname() );
238 id.SetLibItemName( getCurFootprintName() );
239
240 FOOTPRINT* footprint = LoadFootprint( id );
241
242 if( footprint )
243 {
244 GetBoard()->Add( footprint );
245 setFPWatcher( footprint );
246
247 m_toolManager->RunAction( PCB_ACTIONS::rehatchShapes );
248 }
249 }
250
251 drawPanel->DisplayBoard( m_pcb );
252
253 m_auimgr.SetManagedWindow( this );
254
255 // Horizontal items; layers 4 - 6
256 m_auimgr.AddPane( m_tbTopMain, EDA_PANE().VToolbar().Name( "TopMainToolbar" ).Top().Layer(6) );
257 m_auimgr.AddPane( m_tbLeft, EDA_PANE().VToolbar().Name( "LeftToolbar" ).Left().Layer(3) );
258 m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" ).Bottom().Layer(6) );
259
260 // Vertical items; layers 1 - 3
261 m_auimgr.AddPane( libPanel, EDA_PANE().Palette().Name( "Libraries" ).Left().Layer(2)
262 .CaptionVisible( false ).MinSize( 100, -1 ).BestSize( 200, -1 ) );
263 m_auimgr.AddPane( fpPanel, EDA_PANE().Palette().Name( "Footprints" ).Left().Layer(1)
264 .CaptionVisible( false ).MinSize( 100, -1 ).BestSize( 300, -1 ) );
265
266 m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" ).Center() );
267
268 // after changing something to the aui manager call Update() to reflect the changes
269 m_auimgr.Update();
270
271 if( m_libListWidth > 0 )
272 SetAuiPaneSize( m_auimgr, m_auimgr.GetPane( "Libraries" ), m_libListWidth, -1 );
273
274 if( m_fpListWidth > 0 )
275 SetAuiPaneSize( m_auimgr, m_auimgr.GetPane( "Footprints" ), m_fpListWidth, -1 );
276
277 // The canvas should not steal the focus from the list boxes
278 GetCanvas()->SetCanFocus( false );
279 GetCanvas()->GetGAL()->SetAxesEnabled( true );
280
281 // Call resolveCanvasType after loading settings:
282 resolveCanvasType();
283 ActivateGalCanvas();
284
285 // Restore last zoom and auto zoom option. (If auto-zooming we'll adjust when we load the footprint.)
286 if( PCBNEW_SETTINGS* cfg = GetPcbNewSettings() )
287 GetCanvas()->GetView()->SetScale( cfg->m_FootprintViewerZoom );
288
289 updateView();
290 setupUnits( config() );
291
292 ReCreateFootprintList();
293 Raise(); // On some window managers, this is needed
294 Show( true );
295}
296
297
299{
300 // Shutdown all running tools
301 if( m_toolManager )
302 m_toolManager->ShutdownAllTools();
303
305 GetCanvas()->GetView()->Clear();
306 // Be sure any event cannot be fired after frame deletion:
307 GetCanvas()->SetEvtHandlerEnabled( false );
308 m_fpList->Disconnect( wxEVT_LEFT_DCLICK,
310 nullptr, this );
311 setFPWatcher( nullptr );
312}
313
314
319
320
322{
324
325 if( FOOTPRINT* fp = static_cast<FOOTPRINT*>( GetModel() ) )
326 {
327 std::vector<MSG_PANEL_ITEM> msgItems;
328 fp->GetMsgPanelInfo( this, msgItems );
329 SetMsgPanel( msgItems );
330 }
331}
332
333
335{
337
338 ACTION_MANAGER* mgr = m_toolManager->GetActionManager();
339 PCB_EDITOR_CONDITIONS cond( this );
340
341 wxASSERT( mgr );
342
343 auto addToBoardCond =
344 [this]( const SELECTION& )
345 {
346 return ( GetBoard()->GetFirstFootprint() != nullptr );
347 };
348
349#define ENABLE( x ) ACTION_CONDITIONS().Enable( x )
350#define CHECK( x ) ACTION_CONDITIONS().Check( x )
351
356
357 mgr->SetConditions( PCB_ACTIONS::saveFpToBoard, ENABLE( addToBoardCond ) );
358
365
371
373
374#undef ENABLE
375#undef CHECK
376}
377
378
380{
381 // A workaround to avoid flicker, in modal mode when modview frame is destroyed,
382 // when the aui toolbar is not docked (i.e. shown in a miniframe)
383 // (useful on windows only)
384 m_tbTopMain->SetFocus();
385
387
388 Destroy();
389}
390
391
392void FOOTPRINT_VIEWER_FRAME::OnSize( wxSizeEvent& SizeEv )
393{
394 if( m_auimgr.GetManagedWindow() )
395 m_auimgr.Update();
396
397 SizeEv.Skip();
398}
399
400
402{
403 m_libList->Clear();
404
407 std::vector<wxString> nicknames = PROJECT_PCB::FootprintLibAdapter( &Prj() )->GetLibraryNames();
408 std::vector<wxString> pinnedMatches;
409 std::vector<wxString> otherMatches;
410
411 auto process =
412 [&]( const wxString& aNickname )
413 {
414 if( alg::contains( project.m_PinnedFootprintLibs, aNickname )
415 || alg::contains( cfg->m_Session.pinned_fp_libs, aNickname ) )
416 {
417 pinnedMatches.push_back( aNickname );
418 }
419 else
420 {
421 otherMatches.push_back( aNickname );
422 }
423 };
424
425 if( m_libFilter->GetValue().IsEmpty() )
426 {
427 for( const wxString& nickname : nicknames )
428 process( nickname );
429 }
430 else
431 {
432 wxStringTokenizer tokenizer( m_libFilter->GetValue(), " \t\r\n", wxTOKEN_STRTOK );
433
434 while( tokenizer.HasMoreTokens() )
435 {
436 const wxString term = tokenizer.GetNextToken().Lower();
437 EDA_COMBINED_MATCHER matcher( term, CTX_LIBITEM );
438
439 for( const wxString& nickname : nicknames )
440 {
441 if( matcher.Find( nickname.Lower() ) )
442 process( nickname );
443 }
444 }
445 }
446
447 for( const wxString& nickname : pinnedMatches )
449
450 for( const wxString& nickname : otherMatches )
451 m_libList->Append( nickname );
452
453 // Search for a previous selection:
454 int index = m_libList->FindString( getCurNickname(), true );
455
456 if( index == wxNOT_FOUND )
457 {
458 if( m_libList->GetCount() > 0 )
459 {
460 m_libList->SetSelection( 0 );
461 wxCommandEvent dummy;
463 }
464 else
465 {
466 setCurNickname( wxEmptyString );
467 setCurFootprintName( wxEmptyString );
468 }
469 }
470 else
471 {
472 m_libList->SetSelection( index, true );
473 wxCommandEvent dummy;
475 }
476
477 GetCanvas()->Refresh();
478}
479
480
482{
483 m_fpList->Clear();
484
485 if( !getCurNickname() )
486 setCurFootprintName( wxEmptyString );
487
489 wxString nickname = getCurNickname();
490
491 if( !nickname )
492 return;
493
494 std::vector<FOOTPRINT*> footprints = adapter->GetFootprints( nickname, true );
495
496 if( footprints.empty() )
497 return;
498
499 std::set<wxString> excludes;
500
501 if( !m_fpFilter->GetValue().IsEmpty() )
502 {
503 wxStringTokenizer tokenizer( m_fpFilter->GetValue(), " \t\r\n", wxTOKEN_STRTOK );
504
505 while( tokenizer.HasMoreTokens() )
506 {
507 const wxString filterTerm = tokenizer.GetNextToken().Lower();
508 EDA_COMBINED_MATCHER matcher( filterTerm, CTX_LIBITEM );
509
510 for( FOOTPRINT* footprint : footprints )
511 {
512 int matched = matcher.ScoreTerms( footprint->GetSearchTerms() );
513
514 if( filterTerm.IsNumber() && wxAtoi( filterTerm ) == (int)footprint->GetNumberedPadCount() )
515 matched++;
516
517 if( !matched )
518 excludes.insert( footprint->GetFPID().GetLibItemName() );
519 }
520 }
521 }
522
523 for( FOOTPRINT* footprint : footprints )
524 {
525 wxString fpName = footprint->GetFPID().GetLibItemName();
526
527 if( !excludes.count( fpName ) )
528 m_fpList->Append( fpName );
529 }
530
531 int index = wxNOT_FOUND;
532
533 if( !getCurFootprintName().IsEmpty() )
534 index = m_fpList->FindString( getCurFootprintName(), true );
535
536 if( index == wxNOT_FOUND )
537 {
538 if( m_fpList->GetCount() > 0 )
539 {
540 m_fpList->SetSelection( 0 );
541 m_fpList->EnsureVisible( 0 );
542
543 wxCommandEvent dummy;
545 }
546 else
547 {
548 setCurFootprintName( wxEmptyString );
549 }
550 }
551 else
552 {
553 m_fpList->SetSelection( index, true );
554 m_fpList->EnsureVisible( index );
555
556 wxCommandEvent dummy;
558 }
559}
560
561
562void FOOTPRINT_VIEWER_FRAME::OnLibFilter( wxCommandEvent& aEvent )
563{
565
566 // Required to avoid interaction with SetHint()
567 // See documentation for wxTextEntry::SetHint
568 aEvent.Skip();
569}
570
571
572void FOOTPRINT_VIEWER_FRAME::OnFPFilter( wxCommandEvent& aEvent )
573{
575
576 // Required to avoid interaction with SetHint()
577 // See documentation for wxTextEntry::SetHint
578 aEvent.Skip();
579}
580
581
582void FOOTPRINT_VIEWER_FRAME::OnCharHook( wxKeyEvent& aEvent )
583{
584 if( aEvent.GetKeyCode() == WXK_UP )
585 {
586 if( m_libFilter->HasFocus() || m_libList->HasFocus() )
588 else
590 }
591 else if( aEvent.GetKeyCode() == WXK_DOWN )
592 {
593 if( m_libFilter->HasFocus() || m_libList->HasFocus() )
595 else
597 }
598 else if( aEvent.GetKeyCode() == WXK_TAB && m_libFilter->HasFocus() )
599 {
600 if( !aEvent.ShiftDown() )
601 m_fpFilter->SetFocus();
602 else
603 aEvent.Skip();
604 }
605 else if( aEvent.GetKeyCode() == WXK_TAB && m_fpFilter->HasFocus() )
606 {
607 if( aEvent.ShiftDown() )
608 m_libFilter->SetFocus();
609 else
610 aEvent.Skip();
611 }
612 else if( ( aEvent.GetKeyCode() == WXK_RETURN || aEvent.GetKeyCode() == WXK_NUMPAD_ENTER )
613 && m_fpList->GetSelection() >= 0 )
614 {
616 }
617 else
618 {
619 aEvent.Skip();
620 }
621}
622
623
625{
626 int prev = aListBox->GetSelection() - 1;
627
628 if( prev >= 0 )
629 {
630 aListBox->SetSelection( prev );
631 aListBox->EnsureVisible( prev );
632
633 wxCommandEvent dummy;
634
635 if( aListBox == m_libList )
637 else
639 }
640}
641
642
644{
645 int next = aListBox->GetSelection() + 1;
646
647 if( next < (int)aListBox->GetCount() )
648 {
649 aListBox->SetSelection( next );
650 aListBox->EnsureVisible( next );
651
652 wxCommandEvent dummy;
653
654 if( aListBox == m_libList )
656 else
658 }
659}
660
661
662void FOOTPRINT_VIEWER_FRAME::ClickOnLibList( wxCommandEvent& aEvent )
663{
664 int ii = m_libList->GetSelection();
665
666 if( ii < 0 )
667 return;
668
669 wxString name = m_libList->GetBaseString( ii );
670
671 try
672 {
674 }
675 catch( const IO_ERROR& e )
676 {
677 wxLogTrace( traceLibraries, "FP: %s: refresh failed: %s", name, e.What() );
678 }
679
680 if( getCurNickname() == name )
681 return;
682
684
685 // Ensure the displayed footprint is loade/reloaded from the new library
686 setCurFootprintName( wxEmptyString );
687
689 UpdateTitle();
690}
691
692
694{
695 if( m_fpList->GetCount() == 0 )
696 return;
697
698 int ii = m_fpList->GetSelection();
699
700 if( ii < 0 )
701 return;
702
703 wxString name = m_fpList->GetBaseString( ii );
704
705 if( getCurFootprintName().CmpNoCase( name ) != 0 )
706 {
709 }
710}
711
712
714{
715 for( PAD* pad : aFootprint->Pads() )
716 {
717 const COMPONENT_NET& net = m_comp.GetNet( pad->GetNumber() );
718
719 if( !net.GetPinFunction().IsEmpty() )
720 {
721 NETINFO_ITEM* netinfo = new NETINFO_ITEM( GetBoard() );
722 netinfo->SetNetname( net.GetPinFunction() );
723 GetBoard()->Add( netinfo );
724 pad->SetNet( netinfo );
725 }
726 }
727
728 GetBoard()->Add( aFootprint );
729
731}
732
733
735{
737}
738
739
741{
742 if( GetBoard()->GetFirstFootprint() )
743 {
744 PCB_EDIT_FRAME* pcbframe = (PCB_EDIT_FRAME*) Kiway().Player( FRAME_PCB_EDITOR, false );
745
746 if( pcbframe == nullptr ) // happens when the board editor is not active (or closed)
747 {
748 DisplayErrorMessage( this, _( "No board currently open." ) );
749 return;
750 }
751
752 PCBNEW_SETTINGS* cfg = pcbframe->GetPcbNewSettings();
753 TOOL_MANAGER* toolMgr = pcbframe->GetToolManager();
754
756 {
757 DisplayError( this, _( "Previous footprint placement still in progress." ) );
758 return;
759 }
760
761 wxWindow* blocking_dialog = pcbframe->Kiway().GetBlockingDialog();
762
763 if( blocking_dialog )
764 blocking_dialog->Close( true );
765
767 BOARD_COMMIT commit( pcbframe );
768
769 // Create the "new" footprint
771 newFootprint->SetParent( pcbframe->GetBoard() );
772 newFootprint->SetLink( niluuid );
773 newFootprint->SetFlags(IS_NEW ); // whatever
774
775 for( PAD* pad : newFootprint->Pads() )
776 {
777 // Set the pads ratsnest settings to the global settings
778 pad->SetLocalRatsnestVisible( cfg->m_Display.m_ShowGlobalRatsnest );
779
780 // Pads in the library all have orphaned nets. Replace with Default.
781 pad->SetNetCode( 0 );
782 }
783
784 // Put it on FRONT layer,
785 // (Can be stored flipped if the lib is an archive built from a board)
786 if( newFootprint->IsFlipped() )
787 newFootprint->Flip( newFootprint->GetPosition(), cfg->m_FlipDirection );
788
789 KIGFX::VIEW_CONTROLS* viewControls = pcbframe->GetCanvas()->GetViewControls();
790 VECTOR2D cursorPos = viewControls->GetCursorPosition();
791
792 commit.Add( newFootprint );
793 viewControls->SetCrossHairCursorPosition( VECTOR2D( 0, 0 ), false );
794 pcbframe->PlaceFootprint( newFootprint );
795
796 newFootprint->SetPosition( VECTOR2I( 0, 0 ) );
797 viewControls->SetCrossHairCursorPosition( cursorPos, false );
798 commit.Push( _( "Insert Footprint" ) );
799
800 pcbframe->Raise();
801 toolMgr->PostAction( PCB_ACTIONS::placeFootprint, newFootprint );
802
803 newFootprint->ClearFlags();
804 }
805}
806
807
809{
810 if( PCBNEW_SETTINGS* cfg = dynamic_cast<PCBNEW_SETTINGS*>( aCfg ) )
811 {
812 // We don't allow people to change this right now, so make sure it's on
814
816
817 // Fetch display and grid settings from Footprint Editor
819 {
820 m_displayOptions = fpedit->m_Display;
821 GetGalDisplayOptions().ReadWindowSettings( fpedit->m_Window );
822 }
823
824 m_libListWidth = cfg->m_FootprintViewerLibListWidth;
825 m_fpListWidth = cfg->m_FootprintViewerFPListWidth;
826
827 // Set parameters to a reasonable value.
828 int maxWidth = cfg->m_FootprintViewer.state.size_x - 80;
829
830 if( m_libListWidth + m_fpListWidth > maxWidth )
831 {
833 m_fpListWidth = maxWidth - m_libListWidth;
834 }
835 }
836}
837
838
840{
841 PCBNEW_SETTINGS* cfg = dynamic_cast<PCBNEW_SETTINGS*>( aCfg );
842 wxCHECK( cfg, /*void*/ );
843
845
846 // We don't want to store anything other than the window settings
848
849 if( GetCanvas() && GetCanvas()->GetView() )
851
852 cfg->m_FootprintViewerLibListWidth = m_libList->GetSize().x;
853 cfg->m_FootprintViewerFPListWidth = m_fpList->GetSize().x;
854
855}
856
857
859{
860 if( PCBNEW_SETTINGS* cfg = dynamic_cast<PCBNEW_SETTINGS*>( aCfg ) )
861 return &cfg->m_FootprintViewer;
862
863 wxFAIL_MSG( wxT( "FOOTPRINT_CHOOSER not running with PCBNEW_SETTINGS" ) );
864 return &aCfg->m_Window; // non-null fail-safe
865}
866
867
869{
871 return ::GetColorSettings( cfg ? cfg->m_ColorTheme : DEFAULT_THEME );
872}
873
874
876{
878
880
881 if( aFlags & ENVVARS_CHANGED )
883}
884
885
890
891
892void FOOTPRINT_VIEWER_FRAME::setCurNickname( const wxString& aNickname )
893{
895}
896
897
902
903
908
909
910void FOOTPRINT_VIEWER_FRAME::OnActivate( wxActivateEvent& event )
911{
912 if( event.GetActive() )
913 {
914 // Ensure we have the right library list:
915 std::vector< wxString > libNicknames = PROJECT_PCB::FootprintLibAdapter( &Prj() )->GetLibraryNames();
916 bool stale = false;
917
918 if( libNicknames.size() != m_libList->GetCount() )
919 stale = true;
920 else
921 {
922 for( unsigned ii = 0; ii < libNicknames.size(); ii++ )
923 {
924 if( libNicknames[ii] != m_libList->GetBaseString( ii ) )
925 {
926 stale = true;
927 break;
928 }
929 }
930 }
931
932 if( stale )
933 {
935 UpdateTitle();
936 }
937 }
938
939 event.Skip(); // required under wxMAC
940}
941
942
949
950
952{
955
956 if( FOOTPRINT* footprint = GetBoard()->GetFirstFootprint() )
957 ReloadFootprint( footprint );
958}
959
961{
962 switch( mail.Command() )
963 {
964 case MAIL_RELOAD_LIB:
966 break;
967
968 default:
969 break;
970 }
971}
972
973
974void FOOTPRINT_VIEWER_FRAME::Update3DView( bool aMarkDirty, bool aRefresh, const wxString* aTitle )
975{
976 wxString title = _( "3D Viewer" ) + wxT( " \u2014 " ) + getCurFootprintName();
977 PCB_BASE_FRAME::Update3DView( aMarkDirty, aRefresh, &title );
978}
979
980
985
986
988{
989 wxString title;
991
992 if( !getCurNickname().IsEmpty() )
993 {
994 if( std::optional<wxString> optUri = manager.GetFullURI( LIBRARY_TABLE_TYPE::FOOTPRINT, getCurNickname(), true ) )
995 title = getCurNickname() + wxT( " \u2014 " ) + *optUri;
996 else
997 title = _( "[no library selected]" );
998 }
999 else
1000 {
1001 title = _( "[no library selected]" );
1002 }
1003
1004 title += wxT( " \u2014 " ) + _( "Footprint Library Browser" );
1005
1006 SetTitle( title );
1007}
1008
1009
1011{
1012 if( !getCurNickname() )
1013 return;
1014
1015 int selection = m_fpList->FindString( getCurFootprintName(), true );
1016
1017 if( aMode == FPVIEWER_CONSTANTS::NEXT_PART )
1018 {
1019 if( selection != wxNOT_FOUND && selection < (int)m_fpList->GetCount() - 1 )
1020 selection++;
1021 }
1022
1024 {
1025 if( selection != wxNOT_FOUND && selection > 0 )
1026 selection--;
1027 }
1028
1029 if( selection != wxNOT_FOUND )
1030 {
1031 m_fpList->SetSelection( selection );
1032 m_fpList->EnsureVisible( selection );
1033
1034 setCurFootprintName( m_fpList->GetBaseString( selection ) );
1035
1036 // Delete the current footprint
1037 if( PCB_SELECTION_TOOL* selectionTool = m_toolManager->GetTool<PCB_SELECTION_TOOL>() )
1038 selectionTool->ClearSelection( true /* quiet mode */ );
1039
1041 GetBoard()->RemoveUnusedNets( nullptr );
1042
1044 getCurFootprintName(), false );
1045
1046 if( footprint )
1047 displayFootprint( footprint );
1048
1049 if( aMode != FPVIEWER_CONSTANTS::RELOAD_PART )
1050 setFPWatcher( footprint );
1051
1052 Update3DView( true, true );
1053 updateView();
1054 }
1055
1056 UpdateTitle();
1057
1058 GetCanvas()->Refresh();
1059}
1060
1061
1063{
1066
1068
1069 PCBNEW_SETTINGS* cfg = dynamic_cast<PCBNEW_SETTINGS*>( config() );
1070 wxCHECK( cfg, /* void */ );
1071
1074 else
1076
1077
1079}
1080
1081
1082void FOOTPRINT_VIEWER_FRAME::OnExitKiCad( wxCommandEvent& event )
1083{
1084 Kiway().OnKiCadExit();
1085}
1086
1087
1089{
1090 Close( false );
1091}
1092
1093
int index
const char * name
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
Definition bitmap.cpp:100
@ icon_footprint_browser
@ FPHOLDER
Definition board.h:401
static TOOL_ACTION toggleGrid
Definition actions.h:194
static TOOL_ACTION cursorSmallCrosshairs
Definition actions.h:148
static TOOL_ACTION toggleBoundingBoxes
Definition actions.h:153
static TOOL_ACTION centerContents
Definition actions.h:145
static TOOL_ACTION measureTool
Definition actions.h:248
static TOOL_ACTION selectionTool
Definition actions.h:247
static TOOL_ACTION zoomFitScreen
Definition actions.h:138
static TOOL_ACTION zoomTool
Definition actions.h:142
static TOOL_ACTION selectionClear
Clear the current selection.
Definition actions.h:220
static TOOL_ACTION cursor45Crosshairs
Definition actions.h:150
static TOOL_ACTION cursorFullCrosshairs
Definition actions.h:149
Manage TOOL_ACTION objects.
void SetConditions(const TOOL_ACTION &aAction, const ACTION_CONDITIONS &aConditions)
Set the conditions the UI elements for activating a specific tool action should use for determining t...
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
WINDOW_SETTINGS m_Window
wxString m_ColorTheme
Active color theme name.
virtual void Push(const wxString &aMessage=wxEmptyString, int aCommitFlags=0) override
Execute the changes.
Handle actions specific to the board editor in PcbNew.
bool PlacingFootprint() const
Re-entrancy checker for above.
Abstract interface for BOARD_ITEMs capable of storing other items inside.
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false) override
Removes an item from the container.
Definition board.cpp:1497
FOOTPRINT * GetFirstFootprint() const
Get the first footprint on the board or nullptr.
Definition board.h:704
void RemoveUnusedNets(BOARD_COMMIT *aCommit)
Definition board.h:1212
void DeleteAllFootprints()
Remove all footprints from the deque and free the memory associated with them.
Definition board.cpp:2077
Color settings are a bit different than most of the settings objects in that there can be more than o...
COLOR4D GetColor(int aLayer) const
COMMIT & Add(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Add a new item to the model.
Definition commit.h:74
Handle actions that are shared between different applications.
Handles action that are shared between different applications.
Used to store the component pin name to net name (and pin function) associations stored in a netlist.
const wxString & GetPinFunction() const
virtual APP_SETTINGS_BASE * config() const
Return the settings object used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME.
virtual void setupUIConditions()
Setup the UI conditions for the various actions and their controls in this frame.
wxAuiManager m_auimgr
ACTION_TOOLBAR * m_tbTopMain
int ScoreTerms(std::vector< SEARCH_TERM > &aWeightedTerms, bool *aExactMatch=nullptr)
bool Find(const wxString &aTerm, int &aMatchersTriggered, int &aPosition)
Look in all existing matchers, return the earliest match of any of the existing.
void OnSelectGrid(wxCommandEvent &event)
Command event handler for selecting grid sizes.
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
virtual void OnSelectZoom(wxCommandEvent &event)
Set the zoom factor when selected by the zoom list box in the main tool bar.
GAL_DISPLAY_OPTIONS_IMPL & GetGalDisplayOptions()
Return a reference to the gal rendering options used by GAL for rendering.
virtual void UpdateMsgPanel()
Redraw the message panel.
void StopDrawing()
Prevent the GAL canvas from further drawing until it is recreated or StartDrawing() is called.
KIGFX::VIEW_CONTROLS * GetViewControls() const
Return a pointer to the #VIEW_CONTROLS instance used in the panel.
void ForceRefresh()
Force a redraw.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
void SetEventDispatcher(TOOL_DISPATCHER *aEventDispatcher)
Set a dispatcher that processes events and forwards them to tools.
void SetFlags(EDA_ITEM_FLAGS aMask)
Definition eda_item.h:158
void ClearFlags(EDA_ITEM_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition eda_item.h:160
virtual void SetParent(EDA_ITEM *aParent)
Definition eda_item.cpp:153
Specialization of the wxAuiPaneInfo class for KiCad panels.
SELECTION_CONDITION BoundingBoxes()
SELECTION_CONDITION CurrentTool(const TOOL_ACTION &aTool)
Create a functor testing if the specified tool is the current active tool in the frame.
SELECTION_CONDITION CursorSmallCrosshairs()
Create a functor testing if the cursor is full screen in a frame.
SELECTION_CONDITION GridVisible()
Create a functor testing if the grid is visible in a frame.
SELECTION_CONDITION Cursor45Crosshairs()
SELECTION_CONDITION CursorFullCrosshairs()
An interface to the global shared library manager that is schematic-specific and linked to one projec...
std::vector< FOOTPRINT * > GetFootprints(const wxString &aNickname, bool aBestEfforts=false)
Retrieves a list of footprints contained in a given loaded library.
void RefreshLibraryIfChanged(const wxString &aNickname)
Checks whether the library on disk has changed since it was last enumerated into PreloadedFootprints ...
FOOTPRINT * LoadFootprint(const wxString &aNickname, const wxString &aName, bool aKeepUUID)
Load a FOOTPRINT having aName from the library given by aNickname.
Component library viewer main window.
void displayFootprint(FOOTPRINT *aFootprint)
BOARD_ITEM_CONTAINER * GetModel() const override
void Update3DView(bool aMarkDirty, bool aRefresh, const wxString *aTitle=nullptr) override
Update the 3D view, if the viewer is opened by this frame.
void OnLibFilter(wxCommandEvent &aEvent)
void DClickOnFootprintList(wxMouseEvent &aEvent)
WINDOW_SETTINGS * GetWindowSettings(APP_SETTINGS_BASE *aCfg) override
Return a pointer to the window settings for this frame.
void OnCharHook(wxKeyEvent &aEvent) override
Capture the key event before it is sent to the GUI.
void selectPrev(WX_LISTBOX *aListBox)
void ReCreateLibraryList()
Create or recreate the list of current loaded libraries.
void CloseFootprintViewer(wxCommandEvent &event)
void KiwayMailIn(KIWAY_MAIL_EVENT &mail) override
Receive #KIWAY_ROUTED_EVENT messages from other players.
void setupUIConditions() override
Setup the UI conditions for the various actions and their controls in this frame.
FOOTPRINT_VIEWER_FRAME(KIWAY *aKiway, wxWindow *aParent)
void ReloadFootprint(FOOTPRINT *aFootprint) override
Override from PCB_BASE_FRAME which reloads the footprint from the library without setting the footpri...
SELECTION & GetCurrentSelection() override
Get the current selection from the canvas area.
void HardRedraw() override
Rebuild the GAL and redraws the screen.
virtual COLOR4D GetGridColor() override
void CommonSettingsChanged(int aFlags) override
Notification event that some of the common (suite-wide) settings have changed.
COLOR_SETTINGS * GetColorSettings(bool aForceRefresh=false) const override
Helper to retrieve the current color settings.
void AddFootprintToPCB()
Export the current footprint name and close the library browser.
void OnActivate(wxActivateEvent &event)
Called when the frame frame is activate to reload the libraries and component lists that can be chang...
void SaveSettings(APP_SETTINGS_BASE *aCfg) override
Save common frame parameters to a configuration data file.
void setCurFootprintName(const wxString &aName)
void OnSize(wxSizeEvent &event) override
Recalculate the size of toolbars and display panel when the frame size changes.
void OnExitKiCad(wxCommandEvent &event)
void setCurNickname(const wxString &aNickname)
void LoadSettings(APP_SETTINGS_BASE *aCfg) override
Load common frame parameters from a configuration file.
void OnFPFilter(wxCommandEvent &aEvent)
void UpdateMsgPanel() override
Redraw the message panel.
void UpdateTitle()
Update the window title with current library information.
void SelectAndViewFootprint(FPVIEWER_CONSTANTS aMode)
Select and load the next or the previous footprint.
void selectNext(WX_LISTBOX *aListBox)
void ClickOnLibList(wxCommandEvent &aEvent)
void ClickOnFootprintList(wxCommandEvent &aEvent)
void SetPosition(const VECTOR2I &aPos) override
void SetLink(const KIID &aLink)
Definition footprint.h:1259
std::vector< SEARCH_TERM > & GetSearchTerms() override
std::deque< PAD * > & Pads()
Definition footprint.h:404
bool IsFlipped() const
Definition footprint.h:660
const LIB_ID & GetFPID() const
Definition footprint.h:473
unsigned GetNumberedPadCount() const
Return the number of unique pads whose pad number represents an electrical pin.
void Flip(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection) override
Flip this object, i.e.
BOARD_ITEM * Duplicate(bool addToParentGroup, BOARD_COMMIT *aCommit=nullptr) const override
Create a copy of this BOARD_ITEM.
VECTOR2I GetPosition() const override
Definition footprint.h:435
void ReadWindowSettings(WINDOW_SETTINGS &aCfg)
Read GAL config options from application-level config.
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
virtual const wxString What() const
A composite of Problem() and Where()
A color representation with 4 components: red, green, blue, alpha.
Definition color4d.h:101
bool m_axesEnabled
Crosshair drawing mode.
An interface for classes handling user events controlling the view behavior such as zooming,...
virtual void SetCrossHairCursorPosition(const VECTOR2D &aPosition, bool aWarpView=true)=0
Move the graphic crosshair cursor to the requested position expressed in world coordinates.
VECTOR2D GetCursorPosition() const
Return the current cursor position in world coordinates.
double GetScale() const
Definition view.h:281
void Clear()
Remove all items from the view.
Definition view.cpp:1234
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
Carry a payload from one KIWAY_PLAYER to another within a PROJECT.
Definition kiway_mail.h:34
MAIL_T Command()
Returns the MAIL_T associated with this mail.
Definition kiway_mail.h:44
bool Destroy() override
Our version of Destroy() which is virtual from wxWidgets.
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Definition kiway.h:340
void OnKiCadExit()
Definition kiway.cpp:790
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
Definition kiway.cpp:388
wxWindow * GetBlockingDialog()
Gets the window pointer to the blocking dialog (to send it signals)
Definition kiway.cpp:680
virtual PROJECT & Prj() const
Return the PROJECT associated with this KIWAY.
Definition kiway.cpp:201
std::vector< wxString > GetLibraryNames() const
Returns a list of library nicknames that are available (skips any that failed to load)
std::optional< wxString > GetFullURI(LIBRARY_TABLE_TYPE aType, const wxString &aNickname, bool aSubstituted=false)
Return the full location specifying URI for the LIB, either in original UI form or in environment var...
A logical library item identifier and consists of various portions much like a URI.
Definition lib_id.h:45
int SetLibNickname(const UTF8 &aLibNickname)
Override the logical library name portion of the LIB_ID to aLibNickname.
Definition lib_id.cpp:113
const UTF8 & GetLibItemName() const
Definition lib_id.h:98
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Definition lib_id.h:83
static const wxString GetPinningSymbol()
Handle the data for a net.
Definition netinfo.h:50
void SetNetname(const wxString &aNewName)
Set the long netname to aNetName, the short netname to the last token in the long netname's path,...
Definition pad.h:61
DISPLAY_OPTIONS m_Display
FLIP_DIRECTION m_FlipDirection
Gather all the actions that are shared by tools.
Definition pcb_actions.h:50
static TOOL_ACTION padDisplayMode
static TOOL_ACTION rehatchShapes
static TOOL_ACTION graphicsOutlines
Display footprint graphics as outlines.
static TOOL_ACTION fpAutoZoom
static TOOL_ACTION textOutlines
Display texts as lines.
static TOOL_ACTION showPadNumbers
static TOOL_ACTION placeFootprint
static TOOL_ACTION saveFpToBoard
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
void LoadSettings(APP_SETTINGS_BASE *aCfg) override
Load common frame parameters from a configuration file.
void setFPWatcher(FOOTPRINT *aFootprint)
Create or removes a watcher on the specified footprint.
PCBNEW_SETTINGS * GetPcbNewSettings() const
PCB_BASE_FRAME(KIWAY *aKiway, wxWindow *aParent, FRAME_T aFrameType, const wxString &aTitle, const wxPoint &aPos, const wxSize &aSize, long aStyle, const wxString &aFrameName)
void CommonSettingsChanged(int aFlags) override
Notification event that some of the common (suite-wide) settings have changed.
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
void SaveSettings(APP_SETTINGS_BASE *aCfg) override
Save common frame parameters to a configuration data file.
BOARD * GetBoard() const
PCB_DISPLAY_OPTIONS m_displayOptions
void PlaceFootprint(FOOTPRINT *aFootprint, bool aRecreateRatsnest=true, std::optional< VECTOR2I > aPosition=std::nullopt)
Place aFootprint at the current cursor position (or provided one) and updates footprint coordinates w...
virtual void Update3DView(bool aMarkDirty, bool aRefresh, const wxString *aTitle=nullptr)
Update the 3D view, if the viewer is opened by this frame.
Handle actions that are shared between different frames in PcbNew.
Definition pcb_control.h:45
void UpdateColors()
Update the color settings in the painter and GAL.
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
void DisplayBoard(BOARD *aBoard, PROGRESS_REPORTER *aReporter=nullptr)
Add all items from the current board to the VIEW, so they can be displayed by GAL.
Group generic conditions for PCB editor states.
SELECTION_CONDITION PadFillDisplay()
Create a functor that tests if the frame fills the pads.
SELECTION_CONDITION GraphicsFillDisplay()
Create a functor that tests if the frame fills graphics items.
SELECTION_CONDITION FootprintViewerAutoZoom()
Create a functor that tests if the footprint viewer should auto zoom on new footprints.
SELECTION_CONDITION PadNumbersDisplay()
Create a functor that tests if the pad numbers are displayed.
SELECTION_CONDITION TextFillDisplay()
Create a functor that tests if the frame fills text items.
The main frame for Pcbnew.
Generic tool for picking an item.
The selection tool: currently supports:
bool m_FootprintViewerAutoZoomOnSelect
true to use automatic zoom on fp selection
double m_FootprintViewerZoom
The last zoom level used (0 for auto)
Tool useful for viewing footprints.
virtual COMMON_SETTINGS * GetCommonSettings() const
Definition pgm_base.cpp:546
virtual LIBRARY_MANAGER & GetLibraryManager() const
Definition pgm_base.h:125
The backing store for a PROJECT, in JSON format.
static FOOTPRINT_LIBRARY_ADAPTER * FootprintLibAdapter(PROJECT *aProject)
@ PCB_FOOTPRINT_VIEWER_FP_NAME
Definition project.h:228
@ PCB_FOOTPRINT_VIEWER_LIB_NICKNAME
Definition project.h:229
virtual PROJECT_FILE & GetProjectFile() const
Definition project.h:201
virtual void SetRString(RSTRING_T aStringId, const wxString &aString)
Store a "retained string", which is any session and project specific string identified in enum RSTRIN...
Definition project.cpp:355
virtual const wxString & GetRString(RSTRING_T aStringId)
Return a "retained string", which is any session and project specific string identified in enum RSTRI...
Definition project.cpp:366
TOOL_MANAGER * m_toolManager
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
@ MODEL_RELOAD
Model changes (the sheet for a schematic)
Definition tool_base.h:76
Master controller class:
bool RunAction(const std::string &aActionName, T aParam)
Run the specified action immediately, pausing the current action to run the new one.
bool PostAction(const std::string &aActionName, T aParam)
Run the specified action after the current action (coroutine) ends.
void SetEnvironment(EDA_ITEM *aModel, KIGFX::VIEW *aView, KIGFX::VIEW_CONTROLS *aViewControls, APP_SETTINGS_BASE *aSettings, TOOLS_HOLDER *aFrame)
Set the work environment (model, view, view controls and the parent window).
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
Definition confirm.cpp:217
void DisplayError(wxWindow *aParent, const wxString &aText)
Display an error or warning message box with aMessage.
Definition confirm.cpp:192
This file is part of the common library.
#define CHECK(x)
#define ENABLE(x)
#define _(s)
Declaration of the eda_3d_viewer class.
#define KICAD_DEFAULT_DRAWFRAME_STYLE
#define FOOTPRINT_VIEWER_FRAME_NAME
#define IGNORE_PARENT_GROUP
Definition eda_item.h:55
#define IS_NEW
New item, just created.
Abstract pattern-matching tool and implementations.
@ CTX_LIBITEM
@ FRAME_PCB_EDITOR
Definition frame_type.h:38
@ FRAME_FOOTPRINT_VIEWER
Definition frame_type.h:41
const wxChar *const traceLibraries
Flag to enable library table and library manager tracing.
@ ID_ON_GRID_SELECT
Definition id.h:113
@ ID_ON_ZOOM_SELECT
Definition id.h:112
PROJECT & Prj()
Definition kicad.cpp:727
EVT_MENU(ID_COMPARE_PROJECT_BRANCHES, KICAD_MANAGER_FRAME::OnCompareProjectBranches) KICAD_MANAGER_FRAME
KIID niluuid(0)
@ LAYER_GRID
Definition layer_ids.h:250
@ MAIL_RELOAD_LIB
Definition mail_type.h:53
Message panel definition file.
bool contains(const _Container &__container, _Value __value)
Returns true if the container contains the given value.
Definition kicad_algo.h:96
#define _HKI(x)
Definition page_info.cpp:40
@ ID_MODVIEW_FOOTPRINT_LIST
Definition pcbnew_id.h:87
@ ID_MODVIEW_FOOTPRINT_FILTER
Definition pcbnew_id.h:86
@ ID_MODVIEW_LIB_FILTER
Definition pcbnew_id.h:84
@ ID_MODVIEW_LIB_LIST
Definition pcbnew_id.h:85
static PGM_BASE * process
PGM_BASE & Pgm()
The global program "get" accessor.
see class PGM_BASE
CITER next(CITER it)
Definition ptree.cpp:120
#define DEFAULT_THEME
T * GetToolbarSettings(const wxString &aFilename)
T * GetAppSettings(const char *aFilename)
KIWAY Kiway(KFCTL_STANDALONE)
std::vector< FAB_LAYER_COLOR > dummy
std::vector< wxString > pinned_fp_libs
Store the common settings that are saved and loaded for each window / frame.
CURSOR_SETTINGS cursor
#define ENVVARS_CHANGED
wxLogTrace helper definitions.
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:683
VECTOR2< double > VECTOR2D
Definition vector2d.h:682
Definition of file extensions used in Kicad.
void SetAuiPaneSize(wxAuiManager &aManager, wxAuiPaneInfo &aPane, int aWidth, int aHeight)
Sets the size of an AUI pane, working around http://trac.wxwidgets.org/ticket/13180.