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, see <https://www.gnu.org/licenses/>.
20 */
21
22#include <wx/tokenzr.h>
23#include <bitmaps.h>
25#include <confirm.h>
27#include <eeschema_id.h>
28#include <eeschema_settings.h>
31#include <kiface_base.h>
32#include <kiway.h>
33#include <kiway_mail.h>
34#include <locale_io.h>
35#include <symbol_viewer_frame.h>
36#include <symbol_edit_frame.h>
37#include <widgets/msgpanel.h>
38#include <widgets/wx_listbox.h>
41#include <sch_view.h>
42#include <sch_painter.h>
44#include <pgm_base.h>
46#include <project_sch.h>
48#include <tool/action_toolbar.h>
49#include <tool/common_control.h>
50#include <tool/common_tools.h>
52#include <tool/selection.h>
54#include <tool/tool_manager.h>
55#include <tool/zoom_tool.h>
56#include <tools/sch_actions.h>
60#include <view/view_controls.h>
61#include <wx/srchctrl.h>
62#include <wx/log.h>
63#include <wx/choice.h>
65#include <trace_helpers.h>
66
67#include <default_values.h>
68#include <string_utils.h>
70
71#include "eda_pattern_match.h"
72
73// Save previous symbol library viewer state.
75
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
100
101END_EVENT_TABLE()
102
103
104SYMBOL_VIEWER_FRAME::SYMBOL_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
105 SCH_BASE_FRAME( aKiway, aParent, FRAME_SCH_VIEWER, _( "Symbol Library Browser" ), wxDefaultPosition,
107 m_unitChoice( nullptr ),
108 m_bodyStyleChoice( nullptr ),
109 m_libList( nullptr ),
110 m_symbolList( nullptr )
111{
112 m_aboutTitle = _HKI( "KiCad Symbol Library Browser" );
113
114 // Force the frame name used in config. the lib viewer frame has a name
115 // depending on aFrameType (needed to identify the frame by wxWidgets),
116 // but only one configuration is preferable.
118
119 // Give an icon
120 wxIcon icon;
121 icon.CopyFromBitmap( KiBitmap( BITMAPS::library_browser ) );
122 SetIcon( icon );
123
124 m_libListWidth = 200;
125 m_symbolListWidth = 300;
126 m_listPowerOnly = false;
127
128 SetScreen( new SCH_SCREEN );
129 GetScreen()->m_Center = true; // Axis origin centered on screen.
130 LoadSettings( config() );
131
132 // Ensure axis are always drawn (initial default display was not drawn)
134 gal_opts.m_axesEnabled = true;
135 gal_opts.m_gridMinSpacing = 10.0;
136 gal_opts.NotifyChanged();
137
138 GetRenderSettings()->LoadColors( GetColorSettings() );
139 GetCanvas()->GetGAL()->SetAxesColor( m_colorSettings->GetColor( LAYER_SCHEMATIC_GRID_AXES ) );
140
141 GetRenderSettings()->SetDefaultPenWidth( DEFAULT_LINE_WIDTH_MILS * schIUScale.IU_PER_MILS );
142
143 setupTools();
145
149
151
152 wxPanel* libPanel = new wxPanel( this );
153 wxSizer* libSizer = new wxBoxSizer( wxVERTICAL );
154
155 m_libFilter = new wxSearchCtrl( libPanel, ID_LIBVIEW_LIB_FILTER, wxEmptyString, wxDefaultPosition,
156 wxDefaultSize, wxTE_PROCESS_ENTER );
157 m_libFilter->SetDescriptiveText( _( "Filter" ) );
158 libSizer->Add( m_libFilter, 0, wxEXPAND, 5 );
159
160 m_libList = new WX_LISTBOX( libPanel, ID_LIBVIEW_LIB_LIST, wxDefaultPosition, wxDefaultSize, 0, nullptr,
161 wxLB_HSCROLL | wxNO_BORDER );
162 libSizer->Add( m_libList, 1, wxEXPAND, 5 );
163
164 libPanel->SetSizer( libSizer );
165 libPanel->Fit();
166
167 wxPanel* symbolPanel = new wxPanel( this );
168 wxSizer* symbolSizer = new wxBoxSizer( wxVERTICAL );
169
170 m_symbolFilter = new wxSearchCtrl( symbolPanel, ID_LIBVIEW_SYM_FILTER, wxEmptyString, wxDefaultPosition,
171 wxDefaultSize, wxTE_PROCESS_ENTER );
172 m_symbolFilter->SetDescriptiveText( _( "Filter" ) );
173 m_symbolFilter->SetToolTip( _( "Filter on symbol name, keywords, description and pin count.\n"
174 "Search terms are separated by spaces. All search terms must match.\n"
175 "A term which is a number will also match against the pin count." ) );
176 symbolSizer->Add( m_symbolFilter, 0, wxEXPAND, 5 );
177
178#ifdef __WXGTK__
179 // wxSearchCtrl vertical height is not calculated correctly on some GTK setups
180 // See https://gitlab.com/kicad/code/kicad/-/issues/9019
181 m_libFilter->SetMinSize( wxSize( -1, GetTextExtent( wxT( "qb" ) ).y + 10 ) );
182 m_symbolFilter->SetMinSize( wxSize( -1, GetTextExtent( wxT( "qb" ) ).y + 10 ) );
183#endif
184
185 m_symbolList = new WX_LISTBOX( symbolPanel, ID_LIBVIEW_SYM_LIST, wxDefaultPosition, wxDefaultSize, 0, nullptr,
186 wxLB_HSCROLL | wxNO_BORDER );
187 symbolSizer->Add( m_symbolList, 1, wxEXPAND, 5 );
188
189 symbolPanel->SetSizer( symbolSizer );
190 symbolPanel->Fit();
191
192 // Preload libraries
194
195 m_selection_changed = false;
196
198
199 m_auimgr.SetManagedWindow( this );
200
202
203 // Manage main toolbar
204 m_auimgr.AddPane( m_tbTopMain, EDA_PANE().HToolbar().Name( "TopMainToolbar" ).Top().Layer(6) );
205 m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" ) .Bottom().Layer(6) );
206
207 m_auimgr.AddPane( libPanel, EDA_PANE().Palette().Name( "Libraries" ).Left().Layer(2)
208 .CaptionVisible( false ).MinSize( 100, -1 ).BestSize( 200, -1 ) );
209 m_auimgr.AddPane( symbolPanel, EDA_PANE().Palette().Name( "Symbols" ).Left().Layer(1)
210 .CaptionVisible( false ).MinSize( 100, -1 ).BestSize( 300, -1 ) );
211
212 m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" ).Center() );
213
215
216 // Perspectives are sometimes saved with panes marked hidden, and this frame offers no way to
217 // bring one back, so a single bad save would leave the browser permanently blank
218 for( const wchar_t* pane : { wxS( "Libraries" ), wxS( "Symbols" ), wxS( "MsgPanel" ),
219 wxS( "DrawFrame" ) } )
220 {
221 m_auimgr.GetPane( pane ).Show( true );
222 }
223
224 m_auimgr.Update();
225
226 if( m_libListWidth > 0 )
227 SetAuiPaneSize( m_auimgr, m_auimgr.GetPane( "Libraries" ), m_libListWidth, -1 );
228
229 if( m_symbolListWidth > 0 )
230 SetAuiPaneSize( m_auimgr, m_auimgr.GetPane( "Symbols" ), m_symbolListWidth, -1 );
231
233
234 Raise();
235 Show( true );
236
237 SyncView();
238 GetCanvas()->SetCanFocus( false );
239
240 setupUnits( config() );
241
242 // Set the working/draw area size to display a symbol to a reasonable value:
243 // A 450mm x 450mm with a origin at the area center looks like a large working area
244 double max_size_x = schIUScale.mmToIU( 450 );
245 double max_size_y = schIUScale.mmToIU( 450 );
246 BOX2D bbox;
247 bbox.SetOrigin( -max_size_x / 2, -max_size_y / 2 );
248 bbox.SetSize( max_size_x, max_size_y );
249 GetCanvas()->GetView()->SetBoundary( bbox );
251
252 // If a symbol was previously selected in m_symbolList from a previous run, show it
253 wxString symbName = m_symbolList->GetStringSelection();
254
255 if( !symbName.IsEmpty() )
256 {
257 SetSelectedSymbol( symbName );
259 }
260}
261
262
264{
265 // Shutdown all running tools
266 if( m_toolManager )
267 m_toolManager->ShutdownAllTools();
268
269 if( m_previewItem )
270 {
271 GetCanvas()->GetView()->Remove( m_previewItem.get() );
272 m_previewItem = nullptr;
273 }
274}
275
276
278{
279 // Create the manager and dispatcher & route draw panel events to the dispatcher
281 m_toolManager->SetEnvironment( GetScreen(), GetCanvas()->GetView(), GetCanvas()->GetViewControls(), config(),
282 this );
283 m_actions = new SCH_ACTIONS();
285
286 // Register tools
287 m_toolManager->RegisterTool( new COMMON_TOOLS );
288 m_toolManager->RegisterTool( new COMMON_CONTROL );
289 m_toolManager->RegisterTool( new ZOOM_TOOL );
290 m_toolManager->RegisterTool( new SCH_INSPECTION_TOOL ); // manage show datasheet
291 m_toolManager->RegisterTool( new SCH_SELECTION_TOOL ); // manage context menu
292 m_toolManager->RegisterTool( new SYMBOL_EDITOR_CONTROL ); // manage render settings
293
294 m_toolManager->InitTools();
295
296 // Run the selection tool, it is supposed to be always active
297 // It also manages the mouse right click to show the context menu
298 m_toolManager->InvokeTool( "common.InteractiveSelection" );
299
301}
302
303
305{
307
308 ACTION_MANAGER* mgr = m_toolManager->GetActionManager();
309 EDITOR_CONDITIONS cond( this );
310
311 wxASSERT( mgr );
312
313#define ENABLE( x ) ACTION_CONDITIONS().Enable( x )
314#define CHECK( x ) ACTION_CONDITIONS().Check( x )
315
317
318 auto electricalTypesShownCondition =
319 [this]( const SELECTION& aSel )
320 {
322 };
323
324 auto pinNumbersShownCondition =
325 [this]( const SELECTION& )
326 {
328 };
329
330 auto haveDatasheetCond =
331 [this]( const SELECTION& )
332 {
333 LIB_SYMBOL* symbol = GetSelectedSymbol();
334 return symbol && !symbol->GetDatasheetField().GetText().IsEmpty();
335 };
336
337 mgr->SetConditions( ACTIONS::showDatasheet, ENABLE( haveDatasheetCond ) );
338 mgr->SetConditions( SCH_ACTIONS::showElectricalTypes, CHECK( electricalTypesShownCondition ) );
339 mgr->SetConditions( SCH_ACTIONS::showPinNumbers, CHECK( pinNumbersShownCondition ) );
340
341#undef CHECK
342#undef ENABLE
343}
344
345
346void SYMBOL_VIEWER_FRAME::SetUnitAndBodyStyle( int aUnit, int aBodyStyle )
347{
348 m_unit = aUnit > 0 ? aUnit : 1;
349 m_bodyStyle = aBodyStyle > 0 ? aBodyStyle : BODY_STYLE::BASE;
350 m_selection_changed = false;
351
353}
354
355
357{
358 LIB_SYMBOL* symbol = nullptr;
359
360 if( m_currentSymbol.IsValid() )
361 {
362 try
363 {
365 }
366 catch( const IO_ERROR& ioe )
367 {
368 // best efforts
369 }
370 }
371
372 return symbol;
373}
374
375
377{
378 LIB_SYMBOL* symbol = GetSelectedSymbol();
379 KIGFX::SCH_VIEW* view = GetCanvas()->GetView();
380
381 if( m_previewItem )
382 {
383 view->Remove( m_previewItem.get() );
384 m_previewItem = nullptr;
385 }
386
388
389 if( symbol )
390 {
393
394 m_previewItem = symbol->Flatten();
395 view->Add( m_previewItem.get() );
396
397 wxString parentName;
398
399 if( std::shared_ptr<LIB_SYMBOL> parent = symbol->GetParent().lock() )
400 parentName = parent->GetName();
401
402 AppendMsgPanel( _( "Name" ), UnescapeString( m_previewItem->GetName() ) );
403 AppendMsgPanel( _( "Parent" ), UnescapeString( parentName ) );
404 AppendMsgPanel( _( "Description" ), m_previewItem->GetDescription() );
405 AppendMsgPanel( _( "Keywords" ), m_previewItem->GetKeyWords() );
406 }
407
409 GetCanvas()->Refresh();
410
413}
414
415
417{
419
420 delete m_toolManager;
421 m_toolManager = nullptr;
422
423 Destroy();
424}
425
426
427void SYMBOL_VIEWER_FRAME::OnSize( wxSizeEvent& SizeEv )
428{
429 if( m_auimgr.GetManagedWindow() )
430 m_auimgr.Update();
431
432 SizeEv.Skip();
433}
434
435
437{
438 LIB_SYMBOL* symbol = GetSelectedSymbol();
439
440 int unit_count = 1;
441
442 if( symbol )
443 unit_count = std::max( symbol->GetUnitCount(), 1 );
444
445 m_unitChoice->Enable( unit_count > 1 );
446 m_unitChoice->Clear();
447
448 if( unit_count > 1 )
449 {
450 // rebuild the unit list if it is not suitable (after a new selection for instance)
451 if( unit_count != (int) m_unitChoice->GetCount() )
452 {
453 for( int ii = 0; ii < unit_count; ii++ )
454 m_unitChoice->Append( symbol->GetUnitDisplayName( ii + 1, true ) );
455 }
456
457 if( m_unitChoice->GetSelection() != std::max( 0, m_unit - 1 ) )
458 m_unitChoice->SetSelection( std::max( 0, m_unit - 1 ) );
459 }
460}
461
462
464{
465 LIB_SYMBOL* symbol = GetSelectedSymbol();
466
467 int bodyStyle_count = 1;
468
469 if( symbol )
470 bodyStyle_count = std::max( symbol->GetBodyStyleCount(), 1 );
471
472 m_bodyStyleChoice->Enable( bodyStyle_count > 1 );
473 m_bodyStyleChoice->Clear();
474
475 if( bodyStyle_count > 1 )
476 {
477 if( symbol && symbol->HasDeMorganBodyStyles() )
478 {
479 m_bodyStyleChoice->Append( wxGetTranslation( DEMORGAN_STD ) );
480 m_bodyStyleChoice->Append( wxGetTranslation( DEMORGAN_ALT ) );
481 }
482 else if( symbol )
483 {
484 for( int i = 0; i < symbol->GetBodyStyleCount(); i++ )
485 m_bodyStyleChoice->Append( symbol->GetBodyStyleNames()[i] );
486 }
487
488 if( m_bodyStyleChoice->GetSelection() != std::max( 0, m_bodyStyle - 1 ) )
489 m_bodyStyleChoice->SetSelection( std::max( 0, m_bodyStyle - 1 ) );
490 }
491}
492
493
495{
496 if( !m_libList )
497 return false;
498
499 m_libList->Clear();
500
504 std::vector<wxString> libNicknames = adapter->GetLibraryNames();
505 std::vector<wxString> pinnedMatches;
506 std::vector<wxString> otherMatches;
507
508 auto doAddLib =
509 [&]( const wxString& aLib )
510 {
511 if( alg::contains( project.m_PinnedSymbolLibs, aLib )
513 {
514 pinnedMatches.push_back( aLib );
515 }
516 else
517 {
518 otherMatches.push_back( aLib );
519 }
520 };
521
522 auto process =
523 [&]( const wxString& aLib )
524 {
525 // Remove not allowed libs, if the allowed lib list is not empty
526 if( m_allowedLibs.GetCount() )
527 {
528 if( m_allowedLibs.Index( aLib ) == wxNOT_FOUND )
529 return;
530 }
531
532 // Remove libs which have no power symbols, if this filter is activated
533 if( m_listPowerOnly )
534 {
535 std::vector<wxString> symbolNames = adapter->GetSymbolNames(
537
538 if( symbolNames.empty() )
539 return;
540 }
541
542 LIBRARY_TABLE_ROW* row = adapter->GetRow( aLib ).value_or( nullptr );
543 wxCHECK( row, /* void */ );
544
545 if( row->Hidden() )
546 return;
547
548 if( adapter->SupportsSubLibraries( aLib ) )
549 {
550 for( const auto& [nickname, description] : adapter->GetSubLibraries( aLib ) )
551 {
552 wxString suffix = nickname.IsEmpty() ? wxString( wxT( "" ) )
553 : wxString::Format( wxT( " - %s" ), nickname );
554 wxString name = wxString::Format( wxT( "%s%s" ), aLib, suffix );
555
556 doAddLib( name );
557 }
558 }
559 else
560 {
561 doAddLib( aLib );
562 }
563 };
564
565 if( m_libFilter->GetValue().IsEmpty() )
566 {
567 for( const wxString& lib : libNicknames )
568 process( lib );
569 }
570 else
571 {
572 wxStringTokenizer tokenizer( m_libFilter->GetValue(), " \t\r\n", wxTOKEN_STRTOK );
573 std::set<wxString> successfulMatches;
574 std::set<wxString> failedMatches;
575
576 while( tokenizer.HasMoreTokens() )
577 {
578 const wxString term = tokenizer.GetNextToken().Lower();
579 EDA_COMBINED_MATCHER matcher( term, CTX_LIBITEM );
580
581 for( const wxString& lib : libNicknames )
582 {
583 if( matcher.Find( lib.Lower() ) )
584 successfulMatches.insert( lib );
585 else
586 failedMatches.insert( lib );
587 }
588 }
589
590 for( const wxString& lib : successfulMatches )
591 {
592 if( !failedMatches.contains( lib ) )
593 process( lib );
594 }
595 }
596
597 for( const wxString& name : pinnedMatches )
599
600 for( const wxString& name : otherMatches )
601 m_libList->Append( UnescapeString( name ) );
602
603 // Search for a previous selection:
604 int index = m_libList->FindString( UnescapeString( m_currentSymbol.GetUniStringLibNickname() ) );
605 bool selChanged = false;
606
607 if( index != wxNOT_FOUND )
608 {
609 m_libList->SetSelection( index, true );
610 }
611 else
612 {
613 // If not found, clear current library selection because it can be deleted after a
614 // config change.
615 m_currentSymbol.SetLibNickname( m_libList->GetCount() > 0 ? m_libList->GetBaseString( 0 )
616 : wxString( wxEmptyString ) );
617 m_currentSymbol.SetLibItemName( wxEmptyString );
618 m_unit = 1;
620 selChanged = true;
621 }
622
623 selChanged |= ReCreateSymbolList();
625 GetCanvas()->Refresh();
626
627 return selChanged;
628}
629
630
632{
633 if( m_symbolList == nullptr )
634 return false;
635
636 m_symbolList->Clear();
637
638 wxString libName = m_currentSymbol.GetUniStringLibNickname();
639
640 if( libName.IsEmpty() )
641 return false;
642
644 std::vector<LIB_SYMBOL*> symbols = adapter->GetSymbols( libName );
645
646 std::sort( symbols.begin(), symbols.end(),
647 []( LIB_SYMBOL* a, LIB_SYMBOL* b ) -> bool
648 {
649 return StrNumCmp( b->GetName(), a->GetName(), true ) > 0;
650 } );
651
652 std::set<wxString> excludes;
653
654 if( !m_symbolFilter->GetValue().IsEmpty() )
655 {
656 wxStringTokenizer tokenizer( m_symbolFilter->GetValue(), " \t\r\n", wxTOKEN_STRTOK );
657
658 while( tokenizer.HasMoreTokens() )
659 {
660 const wxString filterTerm = tokenizer.GetNextToken().Lower();
661 EDA_COMBINED_MATCHER matcher( filterTerm, CTX_LIBITEM );
662
663 for( LIB_SYMBOL* symbol : symbols )
664 {
665 int matched = matcher.ScoreTerms( symbol->GetSearchTerms() );
666
667 if( filterTerm.IsNumber() && wxAtoi( filterTerm ) == (int)symbol->GetPinCount() )
668 matched++;
669
670 if( !matched )
671 excludes.insert( symbol->GetName() );
672 }
673 }
674 }
675
676 wxString subLib = m_currentSymbol.GetSubLibraryName();
677
678 for( const LIB_SYMBOL* symbol : symbols )
679 {
680 if( adapter->SupportsSubLibraries( libName )
681 && !subLib.IsSameAs( symbol->GetLibId().GetSubLibraryName() ) )
682 {
683 continue;
684 }
685
686 if( !excludes.count( symbol->GetName() ) )
687 m_symbolList->Append( UnescapeString( symbol->GetName() ) );
688 }
689
690 int index = m_symbolList->FindString( UnescapeString( m_currentSymbol.GetUniStringLibItemName() ) );
691 bool selChanged = false;
692
693 if( index == wxNOT_FOUND )
694 {
695 // Clear out the current selection so that we don't match same-named symbols between
696 // libraries.
697 SetSelectedSymbol( wxEmptyString );
698
699 // Select the first library entry (if available) when the previous entry name no
700 // longer exists.
701 index = m_symbolList->IsEmpty() ? -1 : 0;
703 m_unit = 1;
704 selChanged = true;
705 }
706
707 m_symbolList->SetSelection( index, true );
708
709 return selChanged;
710}
711
712
713void SYMBOL_VIEWER_FRAME::ClickOnLibList( wxCommandEvent& event )
714{
715 int ii = m_libList->GetSelection();
716
717 if( ii < 0 )
718 return;
719
720 m_selection_changed = true;
721
722 wxString selection = EscapeString( m_libList->GetBaseString( ii ), CTX_LIBID );
723
725
726 if( !adapter->HasLibrary( selection ) && selection.Find( '-' ) != wxNOT_FOUND )
727 {
728 // Probably a sub-library
729 wxString sublib;
730 selection = selection.BeforeLast( '-', &sublib ).Trim();
731 sublib.Trim( false );
732 SetSelectedLibrary( selection, sublib );
733 }
734 else
735 {
736 SetSelectedLibrary( selection );
737 }
738}
739
740
741void SYMBOL_VIEWER_FRAME::SetSelectedLibrary( const wxString& aLibraryName, const wxString& aSubLibName )
742{
743 if( m_currentSymbol.GetUniStringLibNickname() == aLibraryName
744 && wxString( m_currentSymbol.GetSubLibraryName().wx_str() ) == aSubLibName )
745 {
746 return;
747 }
748
749 m_currentSymbol.SetLibNickname( aLibraryName );
750 m_currentSymbol.SetSubLibraryName( aSubLibName );
752 GetCanvas()->Refresh();
754
755 // Ensure the corresponding line in m_libList is selected
756 // (which is not necessary the case if SetSelectedLibrary is called
757 // by another caller than ClickOnLibList.
758 m_libList->SetStringSelection( UnescapeString( m_currentSymbol.GetFullLibraryName() ), true );
759
760 // The m_libList has now the focus, in order to be able to use arrow keys
761 // to navigate inside the list.
762 // the gal canvas must not steal the focus to allow navigation
763 GetCanvas()->SetStealsFocus( false );
764 m_libList->SetFocus();
765}
766
767
768void SYMBOL_VIEWER_FRAME::ClickOnSymbolList( wxCommandEvent& event )
769{
770 int ii = m_symbolList->GetSelection();
771
772 if( ii < 0 )
773 return;
774
775 m_selection_changed = true;
776
777 SetSelectedSymbol( EscapeString( m_symbolList->GetBaseString( ii ), CTX_LIBID ) );
778
779 // The m_symbolList has now the focus, in order to be able to use arrow keys
780 // to navigate inside the list.
781 // the gal canvas must not steal the focus to allow navigation
782 GetCanvas()->SetStealsFocus( false );
783 m_symbolList->SetFocus();
784}
785
786
787void SYMBOL_VIEWER_FRAME::SetSelectedSymbol( const wxString& aSymbolName )
788{
789 if( m_currentSymbol.GetUniStringLibItemName() != aSymbolName )
790 {
791 m_currentSymbol.SetLibItemName( aSymbolName );
792
793 // Ensure the corresponding line in m_symbolList is selected
794 // (which is not necessarily the case if SetSelectedSymbol is called
795 // by another caller than ClickOnSymbolList.
796 m_symbolList->SetStringSelection( UnescapeString( aSymbolName ), true );
798
800 {
801 m_unit = 1;
803 m_selection_changed = false;
804 }
805
807 }
808}
809
810
811void SYMBOL_VIEWER_FRAME::DClickOnSymbolList( wxCommandEvent& event )
812{
814}
815
816
818{
820
822 {
823 // Grid shape, etc.
824 GetGalDisplayOptions().ReadWindowSettings( cfg->m_LibViewPanel.window );
825
826 m_libListWidth = cfg->m_LibViewPanel.lib_list_width;
827 m_symbolListWidth = cfg->m_LibViewPanel.cmp_list_width;
828
829 GetRenderSettings()->m_ShowPinsElectricalType = cfg->m_LibViewPanel.show_pin_electrical_type;
830 GetRenderSettings()->m_ShowPinNumbers = cfg->m_LibViewPanel.show_pin_numbers;
831
832 // Set parameters to a reasonable value.
833 int64_t maxWidth = cfg->m_LibViewPanel.window.state.size_x - 80;
834 int64_t totalWidth = static_cast<int64_t>( m_libListWidth ) + m_symbolListWidth;
835
836 // Multiply before dividing or the integer ratio truncates to zero and starves the library list
837 if( totalWidth > 0 && totalWidth > maxWidth )
838 {
839 m_libListWidth = static_cast<int>( maxWidth * m_libListWidth / totalWidth );
840 m_symbolListWidth = static_cast<int>( maxWidth ) - m_libListWidth;
841 }
842 }
843}
844
845
847{
849
851 m_libListWidth = m_libList->GetSize().x;
852
853 m_symbolListWidth = m_symbolList->GetSize().x;
854
856 {
857 cfg->m_LibViewPanel.lib_list_width = m_libListWidth;
858 cfg->m_LibViewPanel.cmp_list_width = m_symbolListWidth;
859
860 if( SCH_RENDER_SETTINGS* renderSettings = GetRenderSettings() )
861 {
862 cfg->m_LibViewPanel.show_pin_electrical_type = renderSettings->m_ShowPinsElectricalType;
863 cfg->m_LibViewPanel.show_pin_numbers = renderSettings->m_ShowPinNumbers;
864 }
865 }
866}
867
868
870{
871 if( EESCHEMA_SETTINGS* cfg = dynamic_cast<EESCHEMA_SETTINGS*>( aCfg ) )
872 return &cfg->m_LibViewPanel.window;
873
874 wxFAIL_MSG( wxT( "SYMBOL_VIEWER not running with EESCHEMA_SETTINGS" ) );
875 return &aCfg->m_Window; // non-null fail-safe
876}
877
878
880{
882
884 GetGalDisplayOptions().ReadWindowSettings( cfg->m_LibViewPanel.window );
885
887 GetCanvas()->GetGAL()->DrawGrid();
889
890 if( aFlags && ENVVARS_CHANGED )
892}
893
894
895void SYMBOL_VIEWER_FRAME::OnActivate( wxActivateEvent& event )
896{
897 if( event.GetActive() )
898 {
899 bool changed = m_libList ? ReCreateLibList() : false;
900
901 if (changed)
902 m_selection_changed = true;
903
905
907 }
908
909 event.Skip(); // required under wxMAC
910}
911
912
913void SYMBOL_VIEWER_FRAME::CloseLibraryViewer( wxCommandEvent& event )
914{
915 Close();
916}
917
918
919const BOX2I SYMBOL_VIEWER_FRAME::GetDocumentExtents( bool aIncludeAllVisible ) const
920{
921 if( LIB_SYMBOL* symbol = GetSelectedSymbol() )
922 return symbol->GetUnitBoundingBox( m_unit, m_bodyStyle );
923
924 return BOX2I( VECTOR2I( -200, -200 ), VECTOR2I( 400, 400 ) );
925}
926
927
928void SYMBOL_VIEWER_FRAME::OnLibFilter( wxCommandEvent& aEvent )
929{
931
932 // Required to avoid interaction with SetHint()
933 // See documentation for wxTextEntry::SetHint
934 aEvent.Skip();
935}
936
937
938void SYMBOL_VIEWER_FRAME::OnSymFilter( wxCommandEvent& aEvent )
939{
941
942 // Required to avoid interaction with SetHint()
943 // See documentation for wxTextEntry::SetHint
944 aEvent.Skip();
945}
946
947
948void SYMBOL_VIEWER_FRAME::OnCharHook( wxKeyEvent& aEvent )
949{
950 if( aEvent.GetKeyCode() == WXK_UP )
951 {
952 if( m_libFilter->HasFocus() || m_libList->HasFocus() )
953 {
954 int prev = m_libList->GetSelection() - 1;
955
956 if( prev >= 0 )
957 {
958 m_libList->SetSelection( prev );
959 m_libList->EnsureVisible( prev );
960
961 wxCommandEvent dummy;
963 }
964 }
965 else
966 {
968 }
969 }
970 else if( aEvent.GetKeyCode() == WXK_DOWN )
971 {
972 if( m_libFilter->HasFocus() || m_libList->HasFocus() )
973 {
974 int next = m_libList->GetSelection() + 1;
975
976 if( next < (int)m_libList->GetCount() )
977 {
978 m_libList->SetSelection( next );
979 m_libList->EnsureVisible( next );
980
981 wxCommandEvent dummy;
983 }
984 }
985 else
986 {
988 }
989 }
990 else if( aEvent.GetKeyCode() == WXK_TAB && m_libFilter->HasFocus() )
991 {
992 if( !aEvent.ShiftDown() )
993 m_symbolFilter->SetFocus();
994 else
995 aEvent.Skip();
996 }
997 else if( aEvent.GetKeyCode() == WXK_TAB && m_symbolFilter->HasFocus() )
998 {
999 if( aEvent.ShiftDown() )
1000 m_libFilter->SetFocus();
1001 else
1002 aEvent.Skip();
1003 }
1004 else if( ( aEvent.GetKeyCode() == WXK_RETURN || aEvent.GetKeyCode() == WXK_NUMPAD_ENTER )
1005 && m_symbolList->GetSelection() >= 0 )
1006 {
1007 wxCommandEvent dummy;
1009 }
1010 else
1011 {
1012 aEvent.Skip();
1013 }
1014}
1015
1016
1018{
1019 wxCommandEvent evt( wxEVT_COMMAND_LISTBOX_SELECTED, ID_LIBVIEW_SYM_LIST );
1020 int ii = m_symbolList->GetSelection();
1021
1022 // Select the next symbol or stop at the end of the list.
1023 if( ii != wxNOT_FOUND && ii < (int) ( m_symbolList->GetCount() - 1 ) )
1024 ii += 1;
1025
1026 m_symbolList->SetSelection( ii );
1027 ProcessEvent( evt );
1028}
1029
1030
1032{
1033 wxCommandEvent evt( wxEVT_COMMAND_LISTBOX_SELECTED, ID_LIBVIEW_SYM_LIST );
1034 int ii = m_symbolList->GetSelection();
1035
1036 // Select the previous symbol or stop at the beginning of list.
1037 if( ii != wxNOT_FOUND && ii != 0 )
1038 ii -= 1;
1039
1040 m_symbolList->SetSelection( ii );
1041 ProcessEvent( evt );
1042}
1043
1044
1045void SYMBOL_VIEWER_FRAME::onSelectSymbolUnit( wxCommandEvent& aEvent )
1046{
1047 int ii = m_unitChoice->GetSelection();
1048
1049 if( ii < 0 )
1050 return;
1051
1052 m_unit = ii + 1;
1053
1055}
1056
1057
1059{
1060 int ii = m_bodyStyleChoice->GetSelection();
1061
1062 if( ii < 0 )
1063 return;
1064
1065 m_bodyStyle = ii + 1;
1066
1068}
1069
1070
1072{
1073 wxString libName = m_currentSymbol.GetUniStringLibNickname();
1074
1075 if( m_libList && !m_libList->IsEmpty() && !libName.IsEmpty() )
1076 {
1078 LIBRARY_TABLE_ROW* row = adapter->GetRow( libName ).value_or( nullptr );
1079
1080 wxString title = row ? LIBRARY_MANAGER::GetFullURI( row, true )
1081 : _( "[no library selected]" );
1082
1083 title += wxT( " \u2014 " ) + _( "Symbol Library Browser" );
1084 SetTitle( title );
1085 }
1086}
1087
1088
1090{
1091 return m_toolManager->GetTool<SCH_SELECTION_TOOL>()->GetSelection();
1092}
1093
1094
1096{
1097
1098 switch( mail.Command() )
1099 {
1100 case MAIL_RELOAD_LIB:
1102 break;
1103
1105 {
1106 LIB_SYMBOL* symbol = GetSelectedSymbol();
1107 wxCHECK2( symbol, break );
1108
1110 LIBRARY_TABLE_ROW* row = adapter->GetRow( symbol->GetLibId().GetLibNickname() ).value_or( nullptr );
1111
1112 if( !row )
1113 return;
1114
1115 wxString libfullname = LIBRARY_MANAGER::GetFullURI( row, true );
1116
1117 wxString lib( mail.GetPayload() );
1118 wxLogTrace( traceLibWatch, "Received refresh symbol request for %s, current symbols is %s", lib, libfullname );
1119
1120 if( lib == libfullname )
1121 {
1122 wxLogTrace( traceLibWatch, "Refreshing symbol %s", symbol->GetName() );
1125 }
1126
1127 break;
1128 }
1129 default:;
1130 }
1131}
int index
const char * name
constexpr EDA_IU_SCALE schIUScale
Definition base_units.h:130
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
@ library_browser
BOX2< VECTOR2I > BOX2I
Definition box2.h:914
BOX2< VECTOR2D > BOX2D
Definition box2.h:915
static TOOL_ACTION toggleGrid
Definition actions.h:194
static TOOL_ACTION showDatasheet
Definition actions.h:263
static TOOL_ACTION zoomFitScreen
Definition actions.h:138
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:234
constexpr void SetSize(const SizeVec &size)
Definition box2.h:245
Handle actions that are shared between different applications.
Handles action that are shared between different applications.
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 *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.
virtual void ClearMsgPanel()
Clear all messages from the message panel.
COLOR_SETTINGS * m_colorSettings
void OnSelectGrid(wxCommandEvent &event)
Command event handler for selecting grid sizes.
void setupUnits(APP_SETTINGS_BASE *aCfg)
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.
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.
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.
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
double m_gridMinSpacing
Minimum pixel distance between displayed grid lines.
bool m_axesEnabled
Whether or not to draw the coordinate system axes.
virtual void DrawGrid()
Draw the grid.
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:297
virtual void Remove(VIEW_ITEM *aItem)
Remove a VIEW_ITEM from the view.
Definition view.cpp:412
void UpdateAllItems(int aUpdateFlags)
Update all items in the view according to the given flags.
Definition view.cpp:1743
Carry a payload from one KIWAY_PLAYER to another within a PROJECT.
Definition kiway_mail.h:34
std::string & GetPayload()
Return the payload, which can be any text but it typically self identifying s-expression.
Definition kiway_mail.h:52
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:348
virtual PROJECT & Prj() const
Return the PROJECT associated with this KIWAY.
Definition kiway.cpp:201
bool HasLibrary(const wxString &aNickname, bool aCheckEnabled=false) const
Test for the existence of aNickname in the library tables.
std::optional< LIBRARY_TABLE_ROW * > GetRow(const wxString &aNickname, LIBRARY_TABLE_SCOPE aScope=LIBRARY_TABLE_SCOPE::BOTH) const
Like LIBRARY_MANAGER::GetRow but filtered to the LIBRARY_TABLE_TYPE of this adapter.
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...
bool Hidden() const
A logical library item identifier and consists of various portions much like a URI.
Definition lib_id.h:45
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Definition lib_id.h:83
Define a library symbol object.
Definition lib_symbol.h:114
const LIB_ID & GetLibId() const override
Definition lib_symbol.h:190
std::weak_ptr< LIB_SYMBOL > & GetParent()
Definition lib_symbol.h:152
SCH_FIELD & GetDatasheetField()
Definition lib_symbol.h:459
wxString GetName() const override
Definition lib_symbol.h:183
const std::vector< wxString > & GetBodyStyleNames() const
bool HasDeMorganBodyStyles() const override
int GetBodyStyleCount() const override
The body styles are a property of the drawings, which a derived symbol inherits from its root symbol ...
int GetUnitCount() const override
std::unique_ptr< LIB_SYMBOL > Flatten() const
Return a flattened symbol inheritance to the caller.
wxString GetUnitDisplayName(int aUnit, bool aLabel) const override
Return the user-defined display name for aUnit for symbols with units.
static const wxString GetPinningSymbol()
virtual COMMON_SETTINGS * GetCommonSettings() const
Definition pgm_base.cpp:546
The backing store for a PROJECT, in JSON format.
static SYMBOL_LIBRARY_ADAPTER * SymbolLibAdapter(PROJECT *aProject)
Accessor for project symbol library manager adapter.
virtual PROJECT_FILE & GetProjectFile() const
Definition project.h:201
Gather all the actions that are shared by tools.
Definition sch_actions.h:46
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 KIGFX::VIEW instance used in the panel.
virtual const wxString & GetText() const override
Return the string associated with the text object.
Definition sch_field.h:139
Handle actions for the various symbol editor and viewers.
An interface to the global shared library manager that is schematic-specific and linked to one projec...
LIB_SYMBOL * LoadSymbol(const wxString &aNickname, const wxString &aName)
Load a LIB_SYMBOL having aName from the library given by aNickname.
std::vector< wxString > GetSymbolNames(const wxString &aNickname, SYMBOL_TYPE aType=SYMBOL_TYPE::ALL_SYMBOLS)
bool SupportsSubLibraries(const wxString &aNickname) const
std::vector< SUB_LIBRARY > GetSubLibraries(const wxString &aNickname) const
std::vector< LIB_SYMBOL * > GetSymbols(const wxString &aNickname, SYMBOL_TYPE aType=SYMBOL_TYPE::ALL_SYMBOLS)
Symbol library viewer main window.
void OnLibFilter(wxCommandEvent &aEvent)
std::unique_ptr< LIB_SYMBOL > m_previewItem
void CloseLibraryViewer(wxCommandEvent &event)
void SetSelectedLibrary(const wxString &aLibName, const wxString &aSubLibName=wxEmptyString)
Set the selected library in the library window.
void ClickOnLibList(wxCommandEvent &event)
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.
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.
void KiwayMailIn(KIWAY_MAIL_EVENT &mail) override
Receive KIWAY_MAIL_EVENT messages from other players.
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 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 line 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:63
@ ID_LIBVIEW_SYM_LIST
Definition eeschema_id.h:68
@ ID_LIBVIEW_SELECT_BODY_STYLE
Definition eeschema_id.h:64
@ ID_LIBVIEW_LIB_FILTER
Definition eeschema_id.h:65
@ ID_LIBVIEW_LIB_LIST
Definition eeschema_id.h:66
@ ID_LIBVIEW_SYM_FILTER
Definition eeschema_id.h:67
@ FRAME_SCH_VIEWER
Definition frame_type.h:32
const wxChar *const traceLibWatch
Flag to enable debug output for library file watch refreshes.
@ ID_ON_GRID_SELECT
Definition id.h:113
@ ID_ON_ZOOM_SELECT
Definition id.h:112
PROJECT & Prj()
Definition kicad.cpp:733
EVT_MENU(ID_COMPARE_PROJECT_BRANCHES, KICAD_MANAGER_FRAME::OnCompareProjectBranches) KICAD_MANAGER_FRAME
@ LAYER_SCHEMATIC_GRID_AXES
Definition layer_ids.h:509
@ MAIL_REFRESH_SYMBOL
Definition mail_type.h:56
@ MAIL_RELOAD_LIB
Definition mail_type.h:54
Message panel definition file.
@ ALL
All except INITIAL_ADD.
Definition view_item.h:55
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
static PGM_BASE * process
PGM_BASE & Pgm()
The global program "get" accessor.
see class PGM_BASE
CITER next(CITER it)
Definition ptree.cpp:120
@ BASE
Definition sch_item.h:64
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
wxLogTrace helper definitions.
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:708
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.