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& )
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;
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 {
536 return;
537 }
538
539 LIBRARY_TABLE_ROW* row = adapter->GetRow( aLib ).value_or( nullptr );
540 wxCHECK( row, /* void */ );
541
542 if( row->Hidden() )
543 return;
544
545 if( adapter->SupportsSubLibraries( aLib ) )
546 {
547 for( const auto& [nickname, description] : adapter->GetSubLibraries( aLib ) )
548 {
549 wxString suffix = nickname.IsEmpty() ? wxString( wxT( "" ) )
550 : wxString::Format( wxT( " - %s" ), nickname );
551 wxString name = wxString::Format( wxT( "%s%s" ), aLib, suffix );
552
553 doAddLib( name );
554 }
555 }
556 else
557 {
558 doAddLib( aLib );
559 }
560 };
561
562 if( m_libFilter->GetValue().IsEmpty() )
563 {
564 for( const wxString& lib : libNicknames )
565 process( lib );
566 }
567 else
568 {
569 wxStringTokenizer tokenizer( m_libFilter->GetValue(), " \t\r\n", wxTOKEN_STRTOK );
570 std::set<wxString> successfulMatches;
571 std::set<wxString> failedMatches;
572
573 while( tokenizer.HasMoreTokens() )
574 {
575 const wxString term = tokenizer.GetNextToken().Lower();
576 EDA_COMBINED_MATCHER matcher( term, CTX_LIBITEM );
577
578 for( const wxString& lib : libNicknames )
579 {
580 if( matcher.Find( lib.Lower() ) )
581 successfulMatches.insert( lib );
582 else
583 failedMatches.insert( lib );
584 }
585 }
586
587 for( const wxString& lib : successfulMatches )
588 {
589 if( !failedMatches.contains( lib ) )
590 process( lib );
591 }
592 }
593
594 for( const wxString& name : pinnedMatches )
596
597 for( const wxString& name : otherMatches )
598 m_libList->Append( UnescapeString( name ) );
599
600 // Search for a previous selection:
601 int index = m_libList->FindString( UnescapeString( m_currentSymbol.GetUniStringLibNickname() ) );
602
603 if( index != wxNOT_FOUND )
604 {
605 m_libList->SetSelection( index, true );
606 }
607 else
608 {
609 // If not found, clear current library selection because it can be deleted after a config change.
610 m_currentSymbol.SetLibNickname( m_libList->GetCount() > 0 ? m_libList->GetBaseString( 0 )
611 : wxString( wxEmptyString ) );
612 m_currentSymbol.SetLibItemName( wxEmptyString );
613 m_unit = 1;
615 }
616
618}
619
620
622{
623 if( m_symbolList == nullptr )
624 return;
625
626 m_symbolList->Clear();
627
628 wxString libName = m_currentSymbol.GetUniStringLibNickname();
629
630 if( libName.IsEmpty() )
631 {
634 GetCanvas()->Refresh();
635 return;
636 }
637
639 std::vector<LIB_SYMBOL*> symbols = adapter->GetSymbols( libName );
640
641 std::sort( symbols.begin(), symbols.end(),
642 []( LIB_SYMBOL* a, LIB_SYMBOL* b ) -> bool
643 {
644 return StrNumCmp( b->GetName(), a->GetName(), true ) > 0;
645 } );
646
647 std::set<wxString> excludes;
648
649 if( !m_symbolFilter->GetValue().IsEmpty() )
650 {
651 wxStringTokenizer tokenizer( m_symbolFilter->GetValue(), " \t\r\n", wxTOKEN_STRTOK );
652
653 while( tokenizer.HasMoreTokens() )
654 {
655 const wxString filterTerm = tokenizer.GetNextToken().Lower();
656 EDA_COMBINED_MATCHER matcher( filterTerm, CTX_LIBITEM );
657
658 for( LIB_SYMBOL* symbol : symbols )
659 {
660 int matched = matcher.ScoreTerms( symbol->GetSearchTerms() );
661
662 if( filterTerm.IsNumber() && wxAtoi( filterTerm ) == (int)symbol->GetPinCount() )
663 matched++;
664
665 if( !matched )
666 excludes.insert( symbol->GetName() );
667 }
668 }
669 }
670
671 wxString subLib = m_currentSymbol.GetSubLibraryName();
672
673 for( const LIB_SYMBOL* symbol : symbols )
674 {
675 if( adapter->SupportsSubLibraries( libName ) && !subLib.IsSameAs( symbol->GetLibId().GetSubLibraryName() ) )
676 continue;
677
678 if( !excludes.count( symbol->GetName() ) )
679 m_symbolList->Append( UnescapeString( symbol->GetName() ) );
680 }
681
682 int index = m_symbolList->FindString( UnescapeString( m_currentSymbol.GetUniStringLibItemName() ) );
683
684 if( index != wxNOT_FOUND )
685 {
686 m_symbolList->SetSelection( index, true );
687 }
688 else
689 {
690 // Select the first library entry (if available) when the previous entry name no longer exists.
691 m_symbolList->SetSelection( m_symbolList->IsEmpty() ? -1 : 0, true );
692 m_currentSymbol.SetLibItemName( m_symbolList->GetStringSelection() );
694 m_unit = 1;
695
698 GetCanvas()->Refresh();
699 }
700}
701
702
703void SYMBOL_VIEWER_FRAME::ClickOnLibList( wxCommandEvent& event )
704{
705 int ii = m_libList->GetSelection();
706
707 if( ii < 0 )
708 return;
709
710 m_selection_changed = true;
711
712 wxString selection = EscapeString( m_libList->GetBaseString( ii ), CTX_LIBID );
713
715
716 if( !adapter->HasLibrary( selection ) && selection.Find( '-' ) != wxNOT_FOUND )
717 {
718 // Probably a sub-library
719 wxString sublib;
720 selection = selection.BeforeLast( '-', &sublib ).Trim();
721 sublib.Trim( false );
722 SetSelectedLibrary( selection, sublib );
723 }
724 else
725 {
726 SetSelectedLibrary( selection );
727 }
728}
729
730
731void SYMBOL_VIEWER_FRAME::SetSelectedLibrary( const wxString& aLibraryName, const wxString& aSubLibName )
732{
733 if( m_currentSymbol.GetUniStringLibNickname() == aLibraryName
734 && wxString( m_currentSymbol.GetSubLibraryName().wx_str() ) == aSubLibName )
735 {
736 return;
737 }
738
739 m_currentSymbol.SetLibNickname( aLibraryName );
740 m_currentSymbol.SetSubLibraryName( aSubLibName );
742 GetCanvas()->Refresh();
744
745 // Ensure the corresponding line in m_libList is selected
746 // (which is not necessary the case if SetSelectedLibrary is called
747 // by another caller than ClickOnLibList.
748 m_libList->SetStringSelection( UnescapeString( m_currentSymbol.GetFullLibraryName() ), true );
749
750 // The m_libList has now the focus, in order to be able to use arrow keys
751 // to navigate inside the list.
752 // the gal canvas must not steal the focus to allow navigation
753 GetCanvas()->SetStealsFocus( false );
754 m_libList->SetFocus();
755}
756
757
758void SYMBOL_VIEWER_FRAME::ClickOnSymbolList( wxCommandEvent& event )
759{
760 int ii = m_symbolList->GetSelection();
761
762 if( ii < 0 )
763 return;
764
765 m_selection_changed = true;
766
767 SetSelectedSymbol( EscapeString( m_symbolList->GetBaseString( ii ), CTX_LIBID ) );
768
769 // The m_symbolList has now the focus, in order to be able to use arrow keys
770 // to navigate inside the list.
771 // the gal canvas must not steal the focus to allow navigation
772 GetCanvas()->SetStealsFocus( false );
773 m_symbolList->SetFocus();
774}
775
776
777void SYMBOL_VIEWER_FRAME::SetSelectedSymbol( const wxString& aSymbolName )
778{
779 if( m_currentSymbol.GetUniStringLibItemName() != aSymbolName )
780 {
781 m_currentSymbol.SetLibItemName( aSymbolName );
782
783 // Ensure the corresponding line in m_symbolList is selected
784 // (which is not necessarily the case if SetSelectedSymbol is called
785 // by another caller than ClickOnSymbolList.
786 m_symbolList->SetStringSelection( UnescapeString( aSymbolName ), true );
788
790 {
791 m_unit = 1;
793 m_selection_changed = false;
794 }
795
797 }
798}
799
800
801void SYMBOL_VIEWER_FRAME::DClickOnSymbolList( wxCommandEvent& event )
802{
804}
805
806
808{
810
812 {
813 // Grid shape, etc.
814 GetGalDisplayOptions().ReadWindowSettings( cfg->m_LibViewPanel.window );
815
816 m_libListWidth = cfg->m_LibViewPanel.lib_list_width;
817 m_symbolListWidth = cfg->m_LibViewPanel.cmp_list_width;
818
819 GetRenderSettings()->m_ShowPinsElectricalType = cfg->m_LibViewPanel.show_pin_electrical_type;
820 GetRenderSettings()->m_ShowPinNumbers = cfg->m_LibViewPanel.show_pin_numbers;
821
822 // Set parameters to a reasonable value.
823 int64_t maxWidth = cfg->m_LibViewPanel.window.state.size_x - 80;
824 int64_t totalWidth = static_cast<int64_t>( m_libListWidth ) + m_symbolListWidth;
825
826 // Multiply before dividing or the integer ratio truncates to zero and starves the library list
827 if( totalWidth > 0 && totalWidth > maxWidth )
828 {
829 m_libListWidth = static_cast<int>( maxWidth * m_libListWidth / totalWidth );
830 m_symbolListWidth = static_cast<int>( maxWidth ) - m_libListWidth;
831 }
832 }
833}
834
835
837{
839
841 m_libListWidth = m_libList->GetSize().x;
842
843 m_symbolListWidth = m_symbolList->GetSize().x;
844
846 {
847 cfg->m_LibViewPanel.lib_list_width = m_libListWidth;
848 cfg->m_LibViewPanel.cmp_list_width = m_symbolListWidth;
849
850 if( SCH_RENDER_SETTINGS* renderSettings = GetRenderSettings() )
851 {
852 cfg->m_LibViewPanel.show_pin_electrical_type = renderSettings->m_ShowPinsElectricalType;
853 cfg->m_LibViewPanel.show_pin_numbers = renderSettings->m_ShowPinNumbers;
854 }
855 }
856}
857
858
860{
861 if( EESCHEMA_SETTINGS* cfg = dynamic_cast<EESCHEMA_SETTINGS*>( aCfg ) )
862 return &cfg->m_LibViewPanel.window;
863
864 wxFAIL_MSG( wxT( "SYMBOL_VIEWER not running with EESCHEMA_SETTINGS" ) );
865 return &aCfg->m_Window; // non-null fail-safe
866}
867
868
870{
872
874 GetGalDisplayOptions().ReadWindowSettings( cfg->m_LibViewPanel.window );
875
877 GetCanvas()->GetGAL()->DrawGrid();
879
880 if( aFlags & ENVVARS_CHANGED )
882}
883
884
885void SYMBOL_VIEWER_FRAME::OnActivate( wxActivateEvent& event )
886{
887 if( event.GetActive() )
889
890 event.Skip(); // required under wxMAC
891}
892
893
894void SYMBOL_VIEWER_FRAME::CloseLibraryViewer( wxCommandEvent& event )
895{
896 Close();
897}
898
899
900const BOX2I SYMBOL_VIEWER_FRAME::GetDocumentExtents( bool aIncludeAllVisible ) const
901{
902 if( LIB_SYMBOL* symbol = GetSelectedSymbol() )
903 return symbol->GetUnitBoundingBox( m_unit, m_bodyStyle );
904
905 return BOX2I( VECTOR2I( -200, -200 ), VECTOR2I( 400, 400 ) );
906}
907
908
909void SYMBOL_VIEWER_FRAME::OnLibFilter( wxCommandEvent& aEvent )
910{
912
913 // Required to avoid interaction with SetHint()
914 // See documentation for wxTextEntry::SetHint
915 aEvent.Skip();
916}
917
918
919void SYMBOL_VIEWER_FRAME::OnSymFilter( wxCommandEvent& aEvent )
920{
922
923 // Required to avoid interaction with SetHint()
924 // See documentation for wxTextEntry::SetHint
925 aEvent.Skip();
926}
927
928
929void SYMBOL_VIEWER_FRAME::OnCharHook( wxKeyEvent& aEvent )
930{
931 if( aEvent.GetKeyCode() == WXK_UP )
932 {
933 if( m_libFilter->HasFocus() || m_libList->HasFocus() )
934 {
935 int prev = m_libList->GetSelection() - 1;
936
937 if( prev >= 0 )
938 {
939 m_libList->SetSelection( prev );
940 m_libList->EnsureVisible( prev );
941
942 wxCommandEvent dummy;
944 }
945 }
946 else
947 {
949 }
950 }
951 else if( aEvent.GetKeyCode() == WXK_DOWN )
952 {
953 if( m_libFilter->HasFocus() || m_libList->HasFocus() )
954 {
955 int next = m_libList->GetSelection() + 1;
956
957 if( next < (int)m_libList->GetCount() )
958 {
959 m_libList->SetSelection( next );
960 m_libList->EnsureVisible( next );
961
962 wxCommandEvent dummy;
964 }
965 }
966 else
967 {
969 }
970 }
971 else if( aEvent.GetKeyCode() == WXK_TAB && m_libFilter->HasFocus() )
972 {
973 if( !aEvent.ShiftDown() )
974 m_symbolFilter->SetFocus();
975 else
976 aEvent.Skip();
977 }
978 else if( aEvent.GetKeyCode() == WXK_TAB && m_symbolFilter->HasFocus() )
979 {
980 if( aEvent.ShiftDown() )
981 m_libFilter->SetFocus();
982 else
983 aEvent.Skip();
984 }
985 else if( ( aEvent.GetKeyCode() == WXK_RETURN || aEvent.GetKeyCode() == WXK_NUMPAD_ENTER )
986 && m_symbolList->GetSelection() >= 0 )
987 {
988 wxCommandEvent dummy;
990 }
991 else
992 {
993 aEvent.Skip();
994 }
995}
996
997
999{
1000 wxCommandEvent evt( wxEVT_COMMAND_LISTBOX_SELECTED, ID_LIBVIEW_SYM_LIST );
1001 int ii = m_symbolList->GetSelection();
1002
1003 // Select the next symbol or stop at the end of the list.
1004 if( ii != wxNOT_FOUND && ii < (int) ( m_symbolList->GetCount() - 1 ) )
1005 ii += 1;
1006
1007 m_symbolList->SetSelection( ii );
1008 ProcessEvent( evt );
1009}
1010
1011
1013{
1014 wxCommandEvent evt( wxEVT_COMMAND_LISTBOX_SELECTED, ID_LIBVIEW_SYM_LIST );
1015 int ii = m_symbolList->GetSelection();
1016
1017 // Select the previous symbol or stop at the beginning of list.
1018 if( ii != wxNOT_FOUND && ii != 0 )
1019 ii -= 1;
1020
1021 m_symbolList->SetSelection( ii );
1022 ProcessEvent( evt );
1023}
1024
1025
1026void SYMBOL_VIEWER_FRAME::onSelectSymbolUnit( wxCommandEvent& aEvent )
1027{
1028 int ii = m_unitChoice->GetSelection();
1029
1030 if( ii < 0 )
1031 return;
1032
1033 m_unit = ii + 1;
1034
1036}
1037
1038
1040{
1041 int ii = m_bodyStyleChoice->GetSelection();
1042
1043 if( ii < 0 )
1044 return;
1045
1046 m_bodyStyle = ii + 1;
1047
1049}
1050
1051
1053{
1054 wxString libName = m_currentSymbol.GetUniStringLibNickname();
1055
1056 if( m_libList && !m_libList->IsEmpty() && !libName.IsEmpty() )
1057 {
1059 LIBRARY_TABLE_ROW* row = adapter->GetRow( libName ).value_or( nullptr );
1060
1061 wxString title = row ? LIBRARY_MANAGER::GetFullURI( row, true )
1062 : _( "[no library selected]" );
1063
1064 title += wxT( " \u2014 " ) + _( "Symbol Library Browser" );
1065 SetTitle( title );
1066 }
1067}
1068
1069
1071{
1072 return m_toolManager->GetTool<SCH_SELECTION_TOOL>()->GetSelection();
1073}
1074
1075
1077{
1078
1079 switch( mail.Command() )
1080 {
1081 case MAIL_RELOAD_LIB:
1083 break;
1084
1086 {
1087 // A library reload can invalidate the LIB_SYMBOL borrowed from the adapter.
1088 const LIB_ID symbolId = m_currentSymbol;
1089
1090 if( !symbolId.IsValid() )
1091 break;
1092
1094 wxCHECK2( adapter, break );
1095
1096 LIBRARY_TABLE_ROW* row = adapter->GetRow( symbolId.GetLibNickname() ).value_or( nullptr );
1097
1098 if( !row )
1099 return;
1100
1101 wxString libfullname = LIBRARY_MANAGER::GetFullURI( row, true );
1102
1103 wxString lib( mail.GetPayload() );
1104 wxLogTrace( traceLibWatch, "Received refresh symbol request for %s, current symbols is %s", lib, libfullname );
1105
1106 if( lib == libfullname )
1107 {
1108 wxLogTrace( traceLibWatch, "Refreshing symbol %s", symbolId.GetLibItemName().wx_str() );
1111 }
1112
1113 break;
1114 }
1115 default:;
1116 }
1117}
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:264
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:365
virtual void Remove(VIEW_ITEM *aItem)
Remove a VIEW_ITEM from the view.
Definition view.cpp:488
void UpdateAllItems(int aUpdateFlags)
Update all items in the view according to the given flags.
Definition view.cpp:2475
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:208
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
bool IsValid() const
Check if this LID_ID is valid.
Definition lib_id.h:168
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
Define a library symbol object.
Definition lib_symbol.h:114
std::weak_ptr< LIB_SYMBOL > & GetParent()
Definition lib_symbol.h:152
SCH_FIELD & GetDatasheetField()
Definition lib_symbol.h:459
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:562
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 ReCreateSymbolList()
Create or recreate the list of symbols in the currently selected library.
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.
void 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,...
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:
wxString wx_str() const
Definition utf8.cpp:41
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:737
EVT_MENU(ID_COMPARE_PROJECT_BRANCHES, KICAD_MANAGER_FRAME::OnCompareProjectBranches) KICAD_MANAGER_FRAME
@ LAYER_SCHEMATIC_GRID_AXES
Definition layer_ids.h:515
@ MAIL_REFRESH_SYMBOL
Definition mail_type.h:57
@ MAIL_RELOAD_LIB
Definition mail_type.h:55
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.