KiCad PCB EDA Suite
Loading...
Searching...
No Matches
symbol_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) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr
5 * Copyright (C) 2008 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, 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
26#include <bitmaps.h>
28#include <confirm.h>
30#include <eeschema_id.h>
31#include <eeschema_settings.h>
33#include <kiface_base.h>
34#include <kiway.h>
35#include <kiway_express.h>
36#include <locale_io.h>
37#include <symbol_viewer_frame.h>
38#include <widgets/msgpanel.h>
39#include <widgets/wx_listbox.h>
42#include <sch_view.h>
43#include <sch_painter.h>
44#include <symbol_lib_table.h>
46#include <pgm_base.h>
48#include <project_sch.h>
50#include <symbol_async_loader.h>
51#include <tool/action_toolbar.h>
52#include <tool/common_control.h>
53#include <tool/common_tools.h>
55#include <tool/selection.h>
57#include <tool/tool_manager.h>
58#include <tool/zoom_tool.h>
59#include <tools/sch_actions.h>
62#include <view/view_controls.h>
63#include <wx/srchctrl.h>
64#include <wx/log.h>
65#include <wx/choice.h>
67
68#include <default_values.h>
69#include <string_utils.h>
70#include "eda_pattern_match.h"
71
72// Save previous symbol library viewer state.
74
78
79
80BEGIN_EVENT_TABLE( SYMBOL_VIEWER_FRAME, SCH_BASE_FRAME )
81 // Window events
84
85 // Toolbar events
90
91 // listbox events
97
98 // Menu (and/or hotkey) events
99 EVT_MENU( wxID_CLOSE, SYMBOL_VIEWER_FRAME::CloseLibraryViewer )
100
103
104END_EVENT_TABLE()
105
106
107SYMBOL_VIEWER_FRAME::SYMBOL_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
108 SCH_BASE_FRAME( aKiway, aParent, FRAME_SCH_VIEWER, _( "Symbol Library Browser" ),
109 wxDefaultPosition, wxDefaultSize, KICAD_DEFAULT_DRAWFRAME_STYLE,
111 m_unitChoice( nullptr ),
112 m_bodyStyleChoice( nullptr ),
113 m_libList( nullptr ),
114 m_symbolList( nullptr )
115{
116 m_aboutTitle = _HKI( "KiCad Symbol Library Browser" );
117
118 // Force the frame name used in config. the lib viewer frame has a name
119 // depending on aFrameType (needed to identify the frame by wxWidgets),
120 // but only one configuration is preferable.
122
123 // Give an icon
124 wxIcon icon;
125 icon.CopyFromBitmap( KiBitmap( BITMAPS::library_browser ) );
126 SetIcon( icon );
127
128 m_libListWidth = 200;
129 m_symbolListWidth = 300;
130 m_listPowerOnly = false;
131
132 SetScreen( new SCH_SCREEN );
133 GetScreen()->m_Center = true; // Axis origin centered on screen.
134 LoadSettings( config() );
135
136 // Ensure axis are always drawn (initial default display was not drawn)
138 gal_opts.m_axesEnabled = true;
139 gal_opts.m_gridMinSpacing = 10.0;
140 gal_opts.NotifyChanged();
141
142 GetRenderSettings()->LoadColors( GetColorSettings() );
143 GetCanvas()->GetGAL()->SetAxesColor( m_colorSettings->GetColor( LAYER_SCHEMATIC_GRID_AXES ) );
144
145 GetRenderSettings()->SetDefaultPenWidth( DEFAULT_LINE_WIDTH_MILS * schIUScale.IU_PER_MILS );
146
147 setupTools();
149
153
155
156 wxPanel* libPanel = new wxPanel( this );
157 wxSizer* libSizer = new wxBoxSizer( wxVERTICAL );
158
159 m_libFilter = new wxSearchCtrl( libPanel, ID_LIBVIEW_LIB_FILTER, wxEmptyString,
160 wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
161 m_libFilter->SetDescriptiveText( _( "Filter" ) );
162 libSizer->Add( m_libFilter, 0, wxEXPAND, 5 );
163
164 m_libList = new WX_LISTBOX( libPanel, ID_LIBVIEW_LIB_LIST, wxDefaultPosition, wxDefaultSize,
165 0, nullptr, wxLB_HSCROLL | wxNO_BORDER );
166 libSizer->Add( m_libList, 1, wxEXPAND, 5 );
167
168 libPanel->SetSizer( libSizer );
169 libPanel->Fit();
170
171 wxPanel* symbolPanel = new wxPanel( this );
172 wxSizer* symbolSizer = new wxBoxSizer( wxVERTICAL );
173
174 m_symbolFilter = new wxSearchCtrl( symbolPanel, ID_LIBVIEW_SYM_FILTER, wxEmptyString,
175 wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
176 m_symbolFilter->SetDescriptiveText( _( "Filter" ) );
177 m_symbolFilter->SetToolTip(
178 _( "Filter on symbol name, keywords, description and pin count.\n"
179 "Search terms are separated by spaces. All search terms must match.\n"
180 "A term which is a number will also match against the pin count." ) );
181 symbolSizer->Add( m_symbolFilter, 0, wxEXPAND, 5 );
182
183#ifdef __WXGTK__
184 // wxSearchCtrl vertical height is not calculated correctly on some GTK setups
185 // See https://gitlab.com/kicad/code/kicad/-/issues/9019
186 m_libFilter->SetMinSize( wxSize( -1, GetTextExtent( wxT( "qb" ) ).y + 10 ) );
187 m_symbolFilter->SetMinSize( wxSize( -1, GetTextExtent( wxT( "qb" ) ).y + 10 ) );
188#endif
189
190 m_symbolList = new WX_LISTBOX( symbolPanel, ID_LIBVIEW_SYM_LIST, wxDefaultPosition,
191 wxDefaultSize, 0, nullptr, wxLB_HSCROLL | wxNO_BORDER );
192 symbolSizer->Add( m_symbolList, 1, wxEXPAND, 5 );
193
194 symbolPanel->SetSizer( symbolSizer );
195 symbolPanel->Fit();
196
197 // Preload libraries
200
201 m_selection_changed = false;
202
204
205 m_auimgr.SetManagedWindow( this );
206
208
209 // Manage main toolbar
210 m_auimgr.AddPane( m_tbTopMain, EDA_PANE().HToolbar().Name( "TopMainToolbar" ).Top().Layer(6) );
211 m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" ) .Bottom().Layer(6) );
212
213 m_auimgr.AddPane( libPanel, EDA_PANE().Palette().Name( "Libraries" ).Left().Layer(2)
214 .CaptionVisible( false ).MinSize( 100, -1 ).BestSize( 200, -1 ) );
215 m_auimgr.AddPane( symbolPanel, EDA_PANE().Palette().Name( "Symbols" ).Left().Layer(1)
216 .CaptionVisible( false ).MinSize( 100, -1 ).BestSize( 300, -1 ) );
217
218 m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" ).Center() );
219
221 m_auimgr.Update();
222
223 if( m_libListWidth > 0 )
224 SetAuiPaneSize( m_auimgr, m_auimgr.GetPane( "Libraries" ), m_libListWidth, -1 );
225
226 if( m_symbolListWidth > 0 )
227 SetAuiPaneSize( m_auimgr, m_auimgr.GetPane( "Symbols" ), m_symbolListWidth, -1 );
228
230
231 Raise();
232 Show( true );
233
234 SyncView();
235 GetCanvas()->SetCanFocus( false );
236
237 setupUnits( config() );
238
239 // Set the working/draw area size to display a symbol to a reasonable value:
240 // A 450mm x 450mm with a origin at the area center looks like a large working area
241 double max_size_x = schIUScale.mmToIU( 450 );
242 double max_size_y = schIUScale.mmToIU( 450 );
243 BOX2D bbox;
244 bbox.SetOrigin( -max_size_x / 2, -max_size_y / 2 );
245 bbox.SetSize( max_size_x, max_size_y );
246 GetCanvas()->GetView()->SetBoundary( bbox );
248
249 // If a symbol was previously selected in m_symbolList from a previous run, show it
250 wxString symbName = m_symbolList->GetStringSelection();
251
252 if( !symbName.IsEmpty() )
253 {
254 SetSelectedSymbol( symbName );
256 }
257}
258
259
261{
262 // Shutdown all running tools
263 if( m_toolManager )
264 m_toolManager->ShutdownAllTools();
265
266 if( m_previewItem )
267 {
268 GetCanvas()->GetView()->Remove( m_previewItem.get() );
269 m_previewItem = nullptr;
270 }
271}
272
273
275{
276 // TODO: deduplicate with SYMBOL_TREE_MODEL_ADAPTER::AddLibraries
277 std::vector<wxString> libraryNames = PROJECT_SCH::SchSymbolLibTable( &Prj() )->GetLogicalLibs();
278 std::unique_ptr<WX_PROGRESS_REPORTER> progressReporter = nullptr;
279
280 if( m_show_progress )
281 {
282 progressReporter = std::make_unique<WX_PROGRESS_REPORTER>( this, _( "Load Symbol Libraries" ),
283 libraryNames.size(), PR_CAN_ABORT );
284 }
285
286 // Disable KIID generation: not needed for library parts; sometimes very slow
287 KIID::CreateNilUuids( true );
288
289 std::unordered_map<wxString, std::vector<LIB_SYMBOL*>> loadedSymbols;
290
291 SYMBOL_ASYNC_LOADER loader( libraryNames, PROJECT_SCH::SchSymbolLibTable( &Prj() ), false,
292 nullptr, progressReporter.get() );
293
294 LOCALE_IO toggle;
295
296 loader.Start();
297
298 while( !loader.Done() )
299 {
300 if( progressReporter && !progressReporter->KeepRefreshing() )
301 break;
302
303 wxMilliSleep( 33 );
304 }
305
306 loader.Join();
307
308 KIID::CreateNilUuids( false );
309
310 if( !loader.GetErrors().IsEmpty() )
311 {
312 HTML_MESSAGE_BOX dlg( this, _( "Load Error" ) );
313
314 dlg.MessageSet( _( "Errors loading symbols:" ) );
315
316 wxString msg = loader.GetErrors();
317 msg.Replace( "\n", "<BR>" );
318
319 dlg.AddHTML_Text( msg );
320 dlg.ShowModal();
321 }
322}
323
324
326{
327 // Create the manager and dispatcher & route draw panel events to the dispatcher
329 m_toolManager->SetEnvironment( GetScreen(), GetCanvas()->GetView(),
330 GetCanvas()->GetViewControls(), config(), this );
331 m_actions = new SCH_ACTIONS();
333
334 // Register tools
335 m_toolManager->RegisterTool( new COMMON_TOOLS );
336 m_toolManager->RegisterTool( new COMMON_CONTROL );
337 m_toolManager->RegisterTool( new ZOOM_TOOL );
338 m_toolManager->RegisterTool( new SCH_INSPECTION_TOOL ); // manage show datasheet
339 m_toolManager->RegisterTool( new SCH_SELECTION_TOOL ); // manage context menu
340 m_toolManager->RegisterTool( new SYMBOL_EDITOR_CONTROL ); // manage render settings
341
342 m_toolManager->InitTools();
343
344 // Run the selection tool, it is supposed to be always active
345 // It also manages the mouse right click to show the context menu
346 m_toolManager->InvokeTool( "common.InteractiveSelection" );
347
349}
350
351
353{
355
356 ACTION_MANAGER* mgr = m_toolManager->GetActionManager();
357 EDITOR_CONDITIONS cond( this );
358
359 wxASSERT( mgr );
360
361#define ENABLE( x ) ACTION_CONDITIONS().Enable( x )
362#define CHECK( x ) ACTION_CONDITIONS().Check( x )
363
365
366 auto electricalTypesShownCondition =
367 [this]( const SELECTION& aSel )
368 {
370 };
371
372 auto pinNumbersShownCondition =
373 [this]( const SELECTION& )
374 {
376 };
377
378 auto haveDatasheetCond =
379 [this]( const SELECTION& )
380 {
381 LIB_SYMBOL* symbol = GetSelectedSymbol();
382 return symbol && !symbol->GetDatasheetField().GetText().IsEmpty();
383 };
384
385 mgr->SetConditions( ACTIONS::showDatasheet, ENABLE( haveDatasheetCond ) );
386 mgr->SetConditions( SCH_ACTIONS::showElectricalTypes, CHECK( electricalTypesShownCondition ) );
387 mgr->SetConditions( SCH_ACTIONS::showPinNumbers, CHECK( pinNumbersShownCondition ) );
388
389#undef CHECK
390#undef ENABLE
391}
392
393
394void SYMBOL_VIEWER_FRAME::SetUnitAndBodyStyle( int aUnit, int aBodyStyle )
395{
396 m_unit = aUnit > 0 ? aUnit : 1;
397 m_bodyStyle = aBodyStyle > 0 ? aBodyStyle : BODY_STYLE::BASE;
398 m_selection_changed = false;
399
401}
402
403
405{
406 LIB_SYMBOL* symbol = nullptr;
407
408 if( m_currentSymbol.IsValid() )
410
411 return symbol;
412}
413
414
416{
417 LIB_SYMBOL* symbol = GetSelectedSymbol();
418 KIGFX::SCH_VIEW* view = GetCanvas()->GetView();
419
420 if( m_previewItem )
421 {
422 view->Remove( m_previewItem.get() );
423 m_previewItem = nullptr;
424 }
425
427
428 if( symbol )
429 {
432
433 m_previewItem = symbol->Flatten();
434 view->Add( m_previewItem.get() );
435
436 wxString parentName;
437 std::shared_ptr<LIB_SYMBOL> parent = symbol->GetParent().lock();
438
439 if( parent )
440 parentName = parent->GetName();
441
442 AppendMsgPanel( _( "Name" ), UnescapeString( m_previewItem->GetName() ) );
443 AppendMsgPanel( _( "Parent" ), UnescapeString( parentName ) );
444 AppendMsgPanel( _( "Description" ), m_previewItem->GetDescription() );
445 AppendMsgPanel( _( "Keywords" ), m_previewItem->GetKeyWords() );
446 }
447
449 GetCanvas()->Refresh();
450}
451
452
454{
456
457 delete m_toolManager;
458 m_toolManager = nullptr;
459
460 Destroy();
461}
462
463
464void SYMBOL_VIEWER_FRAME::OnSize( wxSizeEvent& SizeEv )
465{
466 if( m_auimgr.GetManagedWindow() )
467 m_auimgr.Update();
468
469 SizeEv.Skip();
470}
471
472
473void SYMBOL_VIEWER_FRAME::onUpdateUnitChoice( wxUpdateUIEvent& aEvent )
474{
475 LIB_SYMBOL* symbol = GetSelectedSymbol();
476
477 int unit_count = 1;
478
479 if( symbol )
480 unit_count = std::max( symbol->GetUnitCount(), 1 );
481
482 m_unitChoice->Enable( unit_count > 1 );
483 m_unitChoice->Clear();
484
485 if( unit_count > 1 )
486 {
487 // rebuild the unit list if it is not suitable (after a new selection for instance)
488 if( unit_count != (int) m_unitChoice->GetCount() )
489 {
490 for( int ii = 0; ii < unit_count; ii++ )
491 m_unitChoice->Append( symbol->GetUnitDisplayName( ii + 1, true ) );
492 }
493
494 if( m_unitChoice->GetSelection() != std::max( 0, m_unit - 1 ) )
495 m_unitChoice->SetSelection( std::max( 0, m_unit - 1 ) );
496 }
497}
498
499
500void SYMBOL_VIEWER_FRAME::onUpdateBodyStyleChoice( wxUpdateUIEvent& aEvent )
501{
502 LIB_SYMBOL* symbol = GetSelectedSymbol();
503
504 int bodyStyle_count = 1;
505
506 if( symbol )
507 bodyStyle_count = std::max( symbol->GetBodyStyleCount(), 1 );
508
509 m_bodyStyleChoice->Enable( bodyStyle_count > 1 );
510 m_bodyStyleChoice->Clear();
511
512 if( bodyStyle_count > 1 )
513 {
514 if( symbol && symbol->HasDeMorganBodyStyles() )
515 {
516 m_bodyStyleChoice->Append( wxGetTranslation( DEMORGAN_STD ) );
517 m_bodyStyleChoice->Append( wxGetTranslation( DEMORGAN_ALT ) );
518 }
519 else if( symbol )
520 {
521 for( int i = 0; i < symbol->GetBodyStyleCount(); i++ )
522 m_bodyStyleChoice->Append( symbol->GetBodyStyleNames()[i] );
523 }
524
525 if( m_bodyStyleChoice->GetSelection() != std::max( 0, m_bodyStyle - 1 ) )
526 m_bodyStyleChoice->SetSelection( std::max( 0, m_bodyStyle - 1 ) );
527 }
528}
529
530
532{
533 if( !m_libList )
534 return false;
535
536 m_libList->Clear();
537
541 std::vector<wxString> libs = libTable->GetLogicalLibs();
542 std::vector<wxString> pinnedMatches;
543 std::vector<wxString> otherMatches;
544
545 auto doAddLib =
546 [&]( const wxString& aLib )
547 {
548 if( alg::contains( project.m_PinnedSymbolLibs, aLib )
550 {
551 pinnedMatches.push_back( aLib );
552 }
553 else
554 {
555 otherMatches.push_back( aLib );
556 }
557 };
558
559 auto process =
560 [&]( const wxString& aLib )
561 {
562 // Remove not allowed libs, if the allowed lib list is not empty
563 if( m_allowedLibs.GetCount() )
564 {
565 if( m_allowedLibs.Index( aLib ) == wxNOT_FOUND )
566 return;
567 }
568
569 // Remove libs which have no power symbols, if this filter is activated
570 if( m_listPowerOnly )
571 {
572 wxArrayString aliasNames;
573
574 PROJECT_SCH::SchSymbolLibTable( &Prj() )->EnumerateSymbolLib( aLib, aliasNames, true );
575
576 if( aliasNames.IsEmpty() )
577 return;
578 }
579
580 SYMBOL_LIB_TABLE_ROW* row = libTable->FindRow( aLib );
581
582 wxCHECK( row, /* void */ );
583
584 if( !row->GetIsVisible() )
585 return;
586
587 if( row->SupportsSubLibraries() )
588 {
589 std::vector<wxString> subLibraries;
590 row->GetSubLibraryNames( subLibraries );
591
592 for( const wxString& lib : subLibraries )
593 {
594 wxString suffix = lib.IsEmpty() ? wxString( wxT( "" ) )
595 : wxString::Format( wxT( " - %s" ), lib );
596 wxString name = wxString::Format( wxT( "%s%s" ), aLib, suffix );
597
598 doAddLib( name );
599 }
600 }
601 else
602 {
603 doAddLib( aLib );
604 }
605 };
606
607 if( m_libFilter->GetValue().IsEmpty() )
608 {
609 for( const wxString& lib : libs )
610 process( lib );
611 }
612 else
613 {
614 wxStringTokenizer tokenizer( m_libFilter->GetValue(), " \t\r\n", wxTOKEN_STRTOK );
615
616 while( tokenizer.HasMoreTokens() )
617 {
618 const wxString term = tokenizer.GetNextToken().Lower();
619 EDA_COMBINED_MATCHER matcher( term, CTX_LIBITEM );
620
621 for( const wxString& lib : libs )
622 {
623 if( matcher.Find( lib.Lower() ) )
624 process( lib );
625 }
626 }
627 }
628
629 if( libs.empty() )
630 return true;
631
632 for( const wxString& name : pinnedMatches )
634
635 for( const wxString& name : otherMatches )
636 m_libList->Append( UnescapeString( name ) );
637
638 // Search for a previous selection:
639 int index =
640 m_libList->FindString( UnescapeString( m_currentSymbol.GetUniStringLibNickname() ) );
641
642 if( index != wxNOT_FOUND )
643 {
644 m_libList->SetSelection( index, true );
645 }
646 else
647 {
648 // If not found, clear current library selection because it can be deleted after a
649 // config change.
650 m_currentSymbol.SetLibNickname( m_libList->GetCount() > 0 ? m_libList->GetBaseString( 0 )
651 : wxString( wxEmptyString ) );
652 m_currentSymbol.SetLibItemName( wxEmptyString );
653 m_unit = 1;
655 }
656
657 bool cmp_changed = ReCreateSymbolList();
659 GetCanvas()->Refresh();
660
661 return cmp_changed;
662}
663
664
666{
667 if( m_symbolList == nullptr )
668 return false;
669
670 m_symbolList->Clear();
671
672 wxString libName = m_currentSymbol.GetUniStringLibNickname();
673
674 if( libName.IsEmpty() )
675 return false;
676
677 std::vector<LIB_SYMBOL*> symbols;
679
680 try
681 {
682 if( row )
684 }
685 catch( const IO_ERROR& ) {} // ignore, it is handled below
686
687 std::set<wxString> excludes;
688
689 if( !m_symbolFilter->GetValue().IsEmpty() )
690 {
691 wxStringTokenizer tokenizer( m_symbolFilter->GetValue(), " \t\r\n", wxTOKEN_STRTOK );
692
693 while( tokenizer.HasMoreTokens() )
694 {
695 const wxString filterTerm = tokenizer.GetNextToken().Lower();
696 EDA_COMBINED_MATCHER matcher( filterTerm, CTX_LIBITEM );
697
698 for( LIB_SYMBOL* symbol : symbols )
699 {
700 std::vector<SEARCH_TERM> searchTerms = symbol->GetSearchTerms();
701 int matched = matcher.ScoreTerms( searchTerms );
702
703 if( filterTerm.IsNumber() && wxAtoi( filterTerm ) == (int)symbol->GetPinCount() )
704 matched++;
705
706 if( !matched )
707 excludes.insert( symbol->GetName() );
708 }
709 }
710 }
711
712 wxString subLib = m_currentSymbol.GetSubLibraryName();
713
714 for( const LIB_SYMBOL* symbol : symbols )
715 {
716 if( row && row->SupportsSubLibraries()
717 && !subLib.IsSameAs( symbol->GetLibId().GetSubLibraryName() ) )
718 {
719 continue;
720 }
721
722 if( !excludes.count( symbol->GetName() ) )
723 m_symbolList->Append( UnescapeString( symbol->GetName() ) );
724 }
725
726 if( m_symbolList->IsEmpty() )
727 {
728 SetSelectedSymbol( wxEmptyString );
730 m_unit = 1;
731 return true;
732 }
733
734 int index =
735 m_symbolList->FindString( UnescapeString( m_currentSymbol.GetUniStringLibItemName() ) );
736 bool changed = false;
737
738 if( index == wxNOT_FOUND )
739 {
740 // Select the first library entry when the previous entry name does not exist in
741 // the current library.
743 m_unit = 1;
744 index = -1;
745 changed = true;
746 SetSelectedSymbol( wxEmptyString );
747 }
748
749 m_symbolList->SetSelection( index, true );
750
751 return changed;
752}
753
754
755void SYMBOL_VIEWER_FRAME::ClickOnLibList( wxCommandEvent& event )
756{
757 int ii = m_libList->GetSelection();
758
759 if( ii < 0 )
760 return;
761
762 m_selection_changed = true;
763
764 wxString selection = EscapeString( m_libList->GetBaseString( ii ), CTX_LIBID );
765
766 if( !PROJECT_SCH::SchSymbolLibTable( &Prj() )->FindRow( selection )
767 && selection.Find( '-' ) != wxNOT_FOUND )
768 {
769 // Probably a sub-library
770 wxString sublib;
771 selection = selection.BeforeLast( '-', &sublib ).Trim();
772 sublib.Trim( false );
773 SetSelectedLibrary( selection, sublib );
774 }
775 else
776 {
777 SetSelectedLibrary( selection );
778 }
779}
780
781
782void SYMBOL_VIEWER_FRAME::SetSelectedLibrary( const wxString& aLibraryName,
783 const wxString& aSubLibName )
784{
785 if( m_currentSymbol.GetUniStringLibNickname() == aLibraryName
786 && wxString( m_currentSymbol.GetSubLibraryName().wx_str() ) == aSubLibName )
787 return;
788
789 m_currentSymbol.SetLibNickname( aLibraryName );
790 m_currentSymbol.SetSubLibraryName( aSubLibName );
792 GetCanvas()->Refresh();
794
795 // Ensure the corresponding line in m_libList is selected
796 // (which is not necessary the case if SetSelectedLibrary is called
797 // by another caller than ClickOnLibList.
798 m_libList->SetStringSelection( UnescapeString( m_currentSymbol.GetFullLibraryName() ), true );
799
800 // The m_libList has now the focus, in order to be able to use arrow keys
801 // to navigate inside the list.
802 // the gal canvas must not steal the focus to allow navigation
803 GetCanvas()->SetStealsFocus( false );
804 m_libList->SetFocus();
805}
806
807
808void SYMBOL_VIEWER_FRAME::ClickOnSymbolList( wxCommandEvent& event )
809{
810 int ii = m_symbolList->GetSelection();
811
812 if( ii < 0 )
813 return;
814
815 m_selection_changed = true;
816
817 SetSelectedSymbol( EscapeString( m_symbolList->GetBaseString( ii ), CTX_LIBID ) );
818
819 // The m_symbolList has now the focus, in order to be able to use arrow keys
820 // to navigate inside the list.
821 // the gal canvas must not steal the focus to allow navigation
822 GetCanvas()->SetStealsFocus( false );
823 m_symbolList->SetFocus();
824}
825
826
827void SYMBOL_VIEWER_FRAME::SetSelectedSymbol( const wxString& aSymbolName )
828{
829 if( m_currentSymbol.GetUniStringLibItemName() != aSymbolName )
830 {
831 m_currentSymbol.SetLibItemName( aSymbolName );
832
833 // Ensure the corresponding line in m_symbolList is selected
834 // (which is not necessarily the case if SetSelectedSymbol is called
835 // by another caller than ClickOnSymbolList.
836 m_symbolList->SetStringSelection( UnescapeString( aSymbolName ), true );
838
840 {
841 m_unit = 1;
843 m_selection_changed = false;
844 }
845
847 }
848}
849
850
851void SYMBOL_VIEWER_FRAME::DClickOnSymbolList( wxCommandEvent& event )
852{
854}
855
856
858{
860
862 {
863 // Grid shape, etc.
864 GetGalDisplayOptions().ReadWindowSettings( cfg->m_LibViewPanel.window );
865
866 m_libListWidth = cfg->m_LibViewPanel.lib_list_width;
867 m_symbolListWidth = cfg->m_LibViewPanel.cmp_list_width;
868
869 GetRenderSettings()->m_ShowPinsElectricalType = cfg->m_LibViewPanel.show_pin_electrical_type;
870 GetRenderSettings()->m_ShowPinNumbers = cfg->m_LibViewPanel.show_pin_numbers;
871
872 // Set parameters to a reasonable value.
873 int maxWidth = cfg->m_LibViewPanel.window.state.size_x - 80;
874
875 if( m_libListWidth + m_symbolListWidth > maxWidth )
876 {
879 }
880 }
881}
882
883
885{
887
889 m_libListWidth = m_libList->GetSize().x;
890
891 m_symbolListWidth = m_symbolList->GetSize().x;
892
894 {
895 cfg->m_LibViewPanel.lib_list_width = m_libListWidth;
896 cfg->m_LibViewPanel.cmp_list_width = m_symbolListWidth;
897
898 if( SCH_RENDER_SETTINGS* renderSettings = GetRenderSettings() )
899 {
900 cfg->m_LibViewPanel.show_pin_electrical_type = renderSettings->m_ShowPinsElectricalType;
901 cfg->m_LibViewPanel.show_pin_numbers = renderSettings->m_ShowPinNumbers;
902 }
903 }
904}
905
906
908{
909 if( EESCHEMA_SETTINGS* cfg = dynamic_cast<EESCHEMA_SETTINGS*>( aCfg ) )
910 return &cfg->m_LibViewPanel.window;
911
912 wxFAIL_MSG( wxT( "SYMBOL_VIEWER not running with EESCHEMA_SETTINGS" ) );
913 return &aCfg->m_Window; // non-null fail-safe
914}
915
916
918{
920
922 GetGalDisplayOptions().ReadWindowSettings( cfg->m_LibViewPanel.window );
923
925 GetCanvas()->GetGAL()->DrawGrid();
927
928 if( aFlags && ENVVARS_CHANGED )
930}
931
932
933void SYMBOL_VIEWER_FRAME::OnActivate( wxActivateEvent& event )
934{
935 if( event.GetActive() )
936 {
937 bool changed = m_libList ? ReCreateLibList() : false;
938
939 if (changed)
940 m_selection_changed = true;
941
943
945 }
946
947 event.Skip(); // required under wxMAC
948}
949
950
951void SYMBOL_VIEWER_FRAME::CloseLibraryViewer( wxCommandEvent& event )
952{
953 Close();
954}
955
956
957const BOX2I SYMBOL_VIEWER_FRAME::GetDocumentExtents( bool aIncludeAllVisible ) const
958{
959 LIB_SYMBOL* symbol = GetSelectedSymbol();
960
961 if( !symbol )
962 {
963 return BOX2I( VECTOR2I( -200, -200 ), VECTOR2I( 400, 400 ) );
964 }
965 else
966 {
967 std::shared_ptr<LIB_SYMBOL> tmp = symbol->IsDerived() ? symbol->GetParent().lock()
968 : symbol->SharedPtr();
969
970 wxCHECK( tmp, BOX2I( VECTOR2I( -200, -200 ), VECTOR2I( 400, 400 ) ) );
971
972 return tmp->GetUnitBoundingBox( m_unit, m_bodyStyle );
973 }
974}
975
976
977void SYMBOL_VIEWER_FRAME::OnLibFilter( wxCommandEvent& aEvent )
978{
980
981 // Required to avoid interaction with SetHint()
982 // See documentation for wxTextEntry::SetHint
983 aEvent.Skip();
984}
985
986
987void SYMBOL_VIEWER_FRAME::OnSymFilter( wxCommandEvent& aEvent )
988{
990
991 // Required to avoid interaction with SetHint()
992 // See documentation for wxTextEntry::SetHint
993 aEvent.Skip();
994}
995
996
997void SYMBOL_VIEWER_FRAME::OnCharHook( wxKeyEvent& aEvent )
998{
999 if( aEvent.GetKeyCode() == WXK_UP )
1000 {
1001 if( m_libFilter->HasFocus() || m_libList->HasFocus() )
1002 {
1003 int prev = m_libList->GetSelection() - 1;
1004
1005 if( prev >= 0 )
1006 {
1007 m_libList->SetSelection( prev );
1008 m_libList->EnsureVisible( prev );
1009
1010 wxCommandEvent dummy;
1012 }
1013 }
1014 else
1015 {
1016 wxCommandEvent dummy;
1018 }
1019 }
1020 else if( aEvent.GetKeyCode() == WXK_DOWN )
1021 {
1022 if( m_libFilter->HasFocus() || m_libList->HasFocus() )
1023 {
1024 int next = m_libList->GetSelection() + 1;
1025
1026 if( next < (int)m_libList->GetCount() )
1027 {
1028 m_libList->SetSelection( next );
1029 m_libList->EnsureVisible( next );
1030
1031 wxCommandEvent dummy;
1033 }
1034 }
1035 else
1036 {
1037 wxCommandEvent dummy;
1039 }
1040 }
1041 else if( aEvent.GetKeyCode() == WXK_TAB && m_libFilter->HasFocus() )
1042 {
1043 if( !aEvent.ShiftDown() )
1044 m_symbolFilter->SetFocus();
1045 else
1046 aEvent.Skip();
1047 }
1048 else if( aEvent.GetKeyCode() == WXK_TAB && m_symbolFilter->HasFocus() )
1049 {
1050 if( aEvent.ShiftDown() )
1051 m_libFilter->SetFocus();
1052 else
1053 aEvent.Skip();
1054 }
1055 else if( ( aEvent.GetKeyCode() == WXK_RETURN || aEvent.GetKeyCode() == WXK_NUMPAD_ENTER )
1056 && m_symbolList->GetSelection() >= 0 )
1057 {
1058 wxCommandEvent dummy;
1060 }
1061 else
1062 {
1063 aEvent.Skip();
1064 }
1065}
1066
1067
1068void SYMBOL_VIEWER_FRAME::onSelectNextSymbol( wxCommandEvent& aEvent )
1069{
1070 wxCommandEvent evt( wxEVT_COMMAND_LISTBOX_SELECTED, ID_LIBVIEW_SYM_LIST );
1071 int ii = m_symbolList->GetSelection();
1072
1073 // Select the next symbol or stop at the end of the list.
1074 if( ii != wxNOT_FOUND && ii < (int) ( m_symbolList->GetCount() - 1 ) )
1075 ii += 1;
1076
1077 m_symbolList->SetSelection( ii );
1078 ProcessEvent( evt );
1079}
1080
1081
1083{
1084 wxCommandEvent evt( wxEVT_COMMAND_LISTBOX_SELECTED, ID_LIBVIEW_SYM_LIST );
1085 int ii = m_symbolList->GetSelection();
1086
1087 // Select the previous symbol or stop at the beginning of list.
1088 if( ii != wxNOT_FOUND && ii != 0 )
1089 ii -= 1;
1090
1091 m_symbolList->SetSelection( ii );
1092 ProcessEvent( evt );
1093}
1094
1095
1096void SYMBOL_VIEWER_FRAME::onSelectSymbolUnit( wxCommandEvent& aEvent )
1097{
1098 int ii = m_unitChoice->GetSelection();
1099
1100 if( ii < 0 )
1101 return;
1102
1103 m_unit = ii + 1;
1104
1106}
1107
1108
1110{
1111 int ii = m_bodyStyleChoice->GetSelection();
1112
1113 if( ii < 0 )
1114 return;
1115
1116 m_bodyStyle = ii + 1;
1117
1119}
1120
1121
1123{
1124 wxString libName = m_currentSymbol.GetUniStringLibNickname();
1125
1126 if( m_libList && !m_libList->IsEmpty() && !libName.IsEmpty() )
1127 {
1128 const SYMBOL_LIB_TABLE_ROW* row =
1129 PROJECT_SCH::SchSymbolLibTable( &Prj() )->FindRow( libName, true );
1130
1131 wxString title = row ? row->GetFullURI( true ) : _( "[no library selected]" );
1132
1133 title += wxT( " \u2014 " ) + _( "Symbol Library Browser" );
1134 SetTitle( title );
1135 }
1136}
1137
1138
1140{
1141 return m_toolManager->GetTool<SCH_SELECTION_TOOL>()->GetSelection();
1142}
1143
1144
1146{
1147
1148 switch( mail.Command() )
1149 {
1150 case MAIL_RELOAD_LIB:
1151 {
1153 break;
1154 }
1156 {
1158 LIB_SYMBOL* symbol = GetSelectedSymbol();
1159
1160 wxCHECK2( tbl && symbol, break );
1161
1162 const SYMBOL_LIB_TABLE_ROW* row = tbl->FindRow( symbol->GetLibId().GetLibNickname() );
1163
1164 if( !row )
1165 return;
1166
1167 wxString libfullname = row->GetFullURI( true );
1168
1169 wxString lib( mail.GetPayload() );
1170 wxLogTrace( "KICAD_LIB_WATCH", "Received refresh symbol request for %s, current symbols "
1171 "is %s", lib, libfullname );
1172
1173 if( lib == libfullname )
1174 {
1175 wxLogTrace( "KICAD_LIB_WATCH", "Refreshing symbol %s", symbol->GetName() );
1178 }
1179
1180 break;
1181 }
1182 default:;
1183 }
1184}
const char * name
constexpr EDA_IU_SCALE schIUScale
Definition base_units.h:114
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:104
@ library_browser
BOX2< VECTOR2I > BOX2I
Definition box2.h:922
BOX2< VECTOR2D > BOX2D
Definition box2.h:923
static TOOL_ACTION toggleGrid
Definition actions.h:197
static TOOL_ACTION showDatasheet
Definition actions.h:266
static TOOL_ACTION zoomFitScreen
Definition actions.h:141
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
constexpr void SetOrigin(const Vec &pos)
Definition box2.h:237
constexpr void SetSize(const SizeVec &size)
Definition box2.h:248
Handle actions that are shared between different applications.
Handles action that are shared between different applications.
int ShowModal() override
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.
TOOLBAR_SETTINGS * m_toolbarSettings
wxString m_configName
wxAuiManager m_auimgr
virtual void RecreateToolbars()
bool ProcessEvent(wxEvent &aEvent) override
Override the default process event handler to implement the auto save feature.
ACTION_TOOLBAR * m_tbTopMain
wxString m_aboutTitle
void ReCreateMenuBar()
Recreate the menu bar.
int ScoreTerms(std::vector< SEARCH_TERM > &aWeightedTerms)
bool Find(const wxString &aTerm, int &aMatchersTriggered, int &aPosition)
Look in all existing matchers, return the earliest match of any of the existing.
virtual void ClearMsgPanel()
Clear all messages from the message panel.
COLOR_SETTINGS * m_colorSettings
void setupUnits(APP_SETTINGS_BASE *aCfg)
GAL_DISPLAY_OPTIONS_IMPL & GetGalDisplayOptions()
Return a reference to the gal rendering options used by GAL for rendering.
EDA_MSG_PANEL * m_messagePanel
virtual void SetScreen(BASE_SCREEN *aScreen)
void AppendMsgPanel(const wxString &aTextUpper, const wxString &aTextLower, int aPadding=6)
Append a message to the message panel.
void ForceRefresh()
Force a redraw.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
KIGFX::GAL * GetGAL() const
Return a pointer to the GAL instance used in the panel.
void SetEventDispatcher(TOOL_DISPATCHER *aEventDispatcher)
Set a dispatcher that processes events and forwards them to tools.
void SetStealsFocus(bool aStealsFocus)
Set whether focus is taken on certain events (mouseover, keys, etc).
Specialization of the wxAuiPaneInfo class for KiCad panels.
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition eda_text.h:98
Class that groups generic conditions for editor states.
SELECTION_CONDITION GridVisible()
Create a functor testing if the grid is visible in a frame.
void ReadWindowSettings(WINDOW_SETTINGS &aCfg)
Read GAL config options from application-level config.
void MessageSet(const wxString &message)
Add a message (in bold) to message list.
void AddHTML_Text(const wxString &message)
Add HTML text (without any change) to message list.
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
double m_gridMinSpacing
Whether or not to draw the coordinate system axes.
bool m_axesEnabled
Crosshair drawing mode.
void SetAxesColor(const COLOR4D &aAxesColor)
Set the axes color.
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Add a VIEW_ITEM to the view.
Definition view.cpp:298
virtual void Remove(VIEW_ITEM *aItem)
Remove a VIEW_ITEM from the view.
Definition view.cpp:341
void UpdateAllItems(int aUpdateFlags)
Update all items in the view according to the given flags.
Definition view.cpp:1561
static void CreateNilUuids(bool aNil=true)
A performance optimization which disables/enables the generation of pseudo-random UUIDs.
Definition kiid.cpp:288
Carry a payload from one KIWAY_PLAYER to another within a PROJECT.
std::string & GetPayload()
Return the payload, which can be any text but it typically self identifying s-expression.
MAIL_T Command()
Returns the MAIL_T associated with this mail.
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:286
virtual PROJECT & Prj() const
Return the PROJECT associated with this KIWAY.
Definition kiway.cpp:192
A logical library item identifier and consists of various portions much like a URI.
Definition lib_id.h:49
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Definition lib_id.h:87
Define a library symbol object.
Definition lib_symbol.h:87
const LIB_ID & GetLibId() const override
Definition lib_symbol.h:156
SCH_FIELD & GetDatasheetField()
Return reference to the datasheet field.
Definition lib_symbol.h:350
bool IsDerived() const
Definition lib_symbol.h:208
wxString GetName() const override
Definition lib_symbol.h:150
const std::vector< wxString > & GetBodyStyleNames() const
Definition lib_symbol.h:765
bool HasDeMorganBodyStyles() const override
Definition lib_symbol.h:762
LIB_SYMBOL_SPTR SharedPtr() const
http://www.boost.org/doc/libs/1_55_0/libs/smart_ptr/sp_techniques.html#weak_without_shared.
Definition lib_symbol.h:97
int GetBodyStyleCount() const override
Definition lib_symbol.h:754
int GetUnitCount() const override
std::unique_ptr< LIB_SYMBOL > Flatten() const
Return a flattened symbol inheritance to the caller.
LIB_SYMBOL_REF & GetParent()
Definition lib_symbol.h:119
wxString GetUnitDisplayName(int aUnit, bool aLabel) const override
Return the user-defined display name for aUnit for symbols with units.
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...
bool GetIsVisible() const
std::vector< wxString > GetLogicalLibs()
Return the logical library names, all of them that are pertinent to a look up done on this LIB_TABLE.
static const wxString GetPinningSymbol()
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Definition locale_io.h:41
virtual COMMON_SETTINGS * GetCommonSettings() const
Definition pgm_base.cpp:576
The backing store for a PROJECT, in JSON format.
static SYMBOL_LIB_TABLE * SchSymbolLibTable(PROJECT *aProject)
Accessor for project symbol library table.
virtual PROJECT_FILE & GetProjectFile() const
Definition project.h:204
Gather all the actions that are shared by tools.
Definition sch_actions.h:40
static TOOL_ACTION showElectricalTypes
static TOOL_ACTION showPinNumbers
static TOOL_ACTION addSymbolToSchematic
A shim class between EDA_DRAW_FRAME and several derived classes: SYMBOL_EDIT_FRAME,...
SCH_BASE_FRAME(KIWAY *aKiway, wxWindow *aParent, FRAME_T aWindowType, const wxString &aTitle, const wxPoint &aPosition, const wxSize &aSize, long aStyle, const wxString &aFrameName)
SCH_RENDER_SETTINGS * GetRenderSettings()
void doCloseWindow() override
void SaveSettings(APP_SETTINGS_BASE *aCfg) override
Save common frame parameters to a configuration data file.
void LoadSettings(APP_SETTINGS_BASE *aCfg) override
Load common frame parameters from a configuration file.
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
void CommonSettingsChanged(int aFlags) override
Notification event that some of the common (suite-wide) settings have changed.
void SyncView()
Mark all items for refresh.
KIGFX::SCH_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
const wxString & GetErrors() const
void Start()
Spin up threads to load all the libraries in m_nicknames.
bool Join()
Finalize the threads and combines the output into the target output map.
Handle actions for the various symbol editor and viewers.
Hold a record identifying a symbol library accessed by the appropriate symbol library SCH_IO object i...
void GetSubLibraryNames(std::vector< wxString > &aNames) const
bool SupportsSubLibraries() const
void LoadSymbolLib(std::vector< LIB_SYMBOL * > &aAliasList, const wxString &aNickname, bool aPowerSymbolsOnly=false)
void EnumerateSymbolLib(const wxString &aNickname, wxArrayString &aAliasNames, bool aPowerSymbolsOnly=false)
Return a list of symbol alias names contained within the library given by aNickname.
LIB_SYMBOL * LoadSymbol(const wxString &aNickname, const wxString &aName)
Load a LIB_SYMBOL having aName from the library given by aNickname.
SYMBOL_LIB_TABLE_ROW * FindRow(const wxString &aNickName, bool aCheckIfEnabled=false)
Return an SYMBOL_LIB_TABLE_ROW if aNickName is found in this table or in any chained fallBack table f...
Symbol library viewer main window.
void OnLibFilter(wxCommandEvent &aEvent)
std::unique_ptr< LIB_SYMBOL > m_previewItem
void CloseLibraryViewer(wxCommandEvent &event)
void onSelectNextSymbol(wxCommandEvent &aEvent)
void SetSelectedLibrary(const wxString &aLibName, const wxString &aSubLibName=wxEmptyString)
Set the selected library in the library window.
void ClickOnLibList(wxCommandEvent &event)
void onUpdateUnitChoice(wxUpdateUIEvent &aEvent)
SYMBOL_VIEWER_FRAME(KIWAY *aKiway, wxWindow *aParent)
void DClickOnSymbolList(wxCommandEvent &event)
void OnActivate(wxActivateEvent &event)
Called when the frame is activated to reload the libraries and symbol lists that can be changed by th...
void OnSymFilter(wxCommandEvent &aEvent)
void setupUIConditions() override
Setup the UI conditions for the various actions and their controls in this frame.
void SetSelectedSymbol(const wxString &aSymbolName)
Set the selected symbol.
void KiwayMailIn(KIWAY_EXPRESS &mail) override
Receive KIWAY_EXPRESS messages from other players.
bool ReCreateLibList()
Create o recreates a sorted list of currently loaded libraries.
SELECTION & GetCurrentSelection() override
Get the current selection from the canvas area.
void ClickOnSymbolList(wxCommandEvent &event)
const BOX2I GetDocumentExtents(bool aIncludeAllVisible=true) const override
Return bounding box of document with option to not include some items.
void SetUnitAndBodyStyle(int aUnit, int aBodyStyle)
Set unit and convert, and set flag preventing them from automatically resetting to 1.
wxSearchCtrl * m_symbolFilter
void LoadSettings(APP_SETTINGS_BASE *aCfg) override
Load common frame parameters from a configuration file.
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.
LIB_SYMBOL * GetSelectedSymbol() const
void onSelectSymbolUnit(wxCommandEvent &aEvent)
void OnSize(wxSizeEvent &event) override
Recalculate the size of toolbars and display panel when the frame size changes.
void onSelectPreviousSymbol(wxCommandEvent &aEvent)
void onUpdateBodyStyleChoice(wxUpdateUIEvent &aEvent)
void SaveSettings(APP_SETTINGS_BASE *aCfg) override
Save common frame parameters to a configuration data file.
void onSelectSymbolBodyStyle(wxCommandEvent &aEvent)
bool m_selection_changed
Updated to true if a list rewrite on GUI activation resulted in the symbol selection changing,...
bool ReCreateSymbolList()
Create or recreate the list of symbols in the currently selected library.
void CommonSettingsChanged(int aFlags) override
Notification event that some of the common (suite-wide) settings have changed.
TOOL_MANAGER * m_toolManager
TOOL_DISPATCHER * m_toolDispatcher
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
ACTIONS * m_actions
Master controller class:
This file is part of the common library.
#define CHECK(x)
#define ENABLE(x)
#define DEFAULT_LINE_WIDTH_MILS
The default wire width in mils. (can be changed in preference menu)
#define _(s)
#define KICAD_DEFAULT_DRAWFRAME_STYLE
#define LIB_VIEW_FRAME_NAME
Abstract pattern-matching tool and implementations.
@ CTX_LIBITEM
@ ID_LIBVIEW_SELECT_UNIT_NUMBER
Definition eeschema_id.h:71
@ ID_LIBVIEW_SYM_LIST
Definition eeschema_id.h:76
@ ID_LIBVIEW_NEXT
Definition eeschema_id.h:69
@ ID_LIBVIEW_SELECT_BODY_STYLE
Definition eeschema_id.h:72
@ ID_LIBVIEW_LIB_FILTER
Definition eeschema_id.h:73
@ ID_LIBVIEW_LIB_LIST
Definition eeschema_id.h:74
@ ID_LIBVIEW_SYM_FILTER
Definition eeschema_id.h:75
@ ID_LIBVIEW_PREVIOUS
Definition eeschema_id.h:70
@ FRAME_SCH_VIEWER
Definition frame_type.h:36
PROJECT & Prj()
Definition kicad.cpp:612
@ LAYER_SCHEMATIC_GRID_AXES
Definition layer_ids.h:487
@ MAIL_REFRESH_SYMBOL
Definition mail_type.h:59
@ MAIL_RELOAD_LIB
Definition mail_type.h:57
Message panel definition file.
@ ALL
All except INITIAL_ADD.
Definition view_item.h:59
bool contains(const _Container &__container, _Value __value)
Returns true if the container contains the given value.
Definition kicad_algo.h:100
#define _HKI(x)
Definition page_info.cpp:44
static PGM_BASE * process
Definition pgm_base.cpp:910
PGM_BASE & Pgm()
The global program "get" accessor.
Definition pgm_base.cpp:913
see class PGM_BASE
CITER next(CITER it)
Definition ptree.cpp:124
@ BASE
Definition sch_item.h:59
COLOR_SETTINGS * GetColorSettings(const wxString &aName)
T * GetToolbarSettings(const wxString &aFilename)
T * GetAppSettings(const char *aFilename)
KIWAY Kiway(KFCTL_STANDALONE)
std::vector< FAB_LAYER_COLOR > dummy
wxString UnescapeString(const wxString &aSource)
wxString EscapeString(const wxString &aSource, ESCAPE_CONTEXT aContext)
The Escape/Unescape routines use HTML-entity-reference-style encoding to handle characters which are:...
@ CTX_LIBID
std::vector< wxString > pinned_symbol_libs
Store the common settings that are saved and loaded for each window / frame.
#define DEMORGAN_ALT
#define DEMORGAN_STD
#define ENVVARS_CHANGED
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:695
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.
#define PR_CAN_ABORT