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 {
633 std::vector<LIB_SYMBOL*> symbols = adapter->GetSymbols( libName );
634
635 std::sort( symbols.begin(), symbols.end(),
636 []( LIB_SYMBOL* a, LIB_SYMBOL* b ) -> bool
637 {
638 return StrNumCmp( b->GetName(), a->GetName(), CMP_T::IGNORE_CASE ) > 0;
639 } );
640
641 std::set<wxString> excludes;
642
643 if( !m_symbolFilter->GetValue().IsEmpty() )
644 {
645 wxStringTokenizer tokenizer( m_symbolFilter->GetValue(), " \t\r\n", wxTOKEN_STRTOK );
646
647 while( tokenizer.HasMoreTokens() )
648 {
649 const wxString filterTerm = tokenizer.GetNextToken().Lower();
650 EDA_COMBINED_MATCHER matcher( filterTerm, CTX_LIBITEM );
651
652 for( LIB_SYMBOL* symbol : symbols )
653 {
654 int matched = matcher.ScoreTerms( symbol->GetSearchTerms() );
655
656 if( filterTerm.IsNumber() && wxAtoi( filterTerm ) == (int)symbol->GetPinCount() )
657 matched++;
658
659 if( !matched )
660 excludes.insert( symbol->GetName() );
661 }
662 }
663 }
664
665 wxString subLib = m_currentSymbol.GetSubLibraryName();
666
667 for( const LIB_SYMBOL* symbol : symbols )
668 {
669 if( adapter->SupportsSubLibraries( libName ) && !subLib.IsSameAs( symbol->GetLibId().GetSubLibraryName() ) )
670 continue;
671
672 if( !excludes.count( symbol->GetName() ) )
673 m_symbolList->Append( UnescapeString( symbol->GetName() ) );
674 }
675
676 int index = m_symbolList->FindString( UnescapeString( m_currentSymbol.GetUniStringLibItemName() ) );
677
678 if( index != wxNOT_FOUND )
679 {
680 m_symbolList->SetSelection( index, true );
681 }
682 else
683 {
684 // Select the first library entry (if available) when the previous entry name no longer exists.
685 m_symbolList->SetSelection( m_symbolList->IsEmpty() ? -1 : 0, true );
686 m_currentSymbol.SetLibItemName( EscapeString( m_symbolList->GetStringSelection(), CTX_LIBID ) );
688 m_unit = 1;
689 }
690 }
691
694 GetCanvas()->Refresh();
695}
696
697
698void SYMBOL_VIEWER_FRAME::ClickOnLibList( wxCommandEvent& event )
699{
700 int ii = m_libList->GetSelection();
701
702 if( ii < 0 )
703 return;
704
705 m_selection_changed = true;
706
707 wxString selection = EscapeString( m_libList->GetBaseString( ii ), CTX_LIBID );
708
710
711 if( !adapter->HasLibrary( selection ) && selection.Find( '-' ) != wxNOT_FOUND )
712 {
713 // Probably a sub-library
714 wxString sublib;
715 selection = selection.BeforeLast( '-', &sublib ).Trim();
716 sublib.Trim( false );
717 SetSelectedLibrary( selection, sublib );
718 }
719 else
720 {
721 SetSelectedLibrary( selection );
722 }
723}
724
725
726void SYMBOL_VIEWER_FRAME::SetSelectedLibrary( const wxString& aLibraryName, const wxString& aSubLibName )
727{
728 if( m_currentSymbol.GetUniStringLibNickname() == aLibraryName
729 && wxString( m_currentSymbol.GetSubLibraryName().wx_str() ) == aSubLibName )
730 {
731 return;
732 }
733
734 m_currentSymbol.SetLibNickname( aLibraryName );
735 m_currentSymbol.SetSubLibraryName( aSubLibName );
737 GetCanvas()->Refresh();
739
740 // Ensure the corresponding line in m_libList is selected
741 // (which is not necessary the case if SetSelectedLibrary is called
742 // by another caller than ClickOnLibList.
743 m_libList->SetStringSelection( UnescapeString( m_currentSymbol.GetFullLibraryName() ), true );
744
745 // The m_libList has now the focus, in order to be able to use arrow keys
746 // to navigate inside the list.
747 // the gal canvas must not steal the focus to allow navigation
748 GetCanvas()->SetStealsFocus( false );
749 m_libList->SetFocus();
750}
751
752
753void SYMBOL_VIEWER_FRAME::ClickOnSymbolList( wxCommandEvent& event )
754{
755 int ii = m_symbolList->GetSelection();
756
757 if( ii < 0 )
758 return;
759
760 m_selection_changed = true;
761
762 SetSelectedSymbol( EscapeString( m_symbolList->GetBaseString( ii ), CTX_LIBID ) );
763
764 // The m_symbolList has now the focus, in order to be able to use arrow keys
765 // to navigate inside the list.
766 // the gal canvas must not steal the focus to allow navigation
767 GetCanvas()->SetStealsFocus( false );
768 m_symbolList->SetFocus();
769}
770
771
772void SYMBOL_VIEWER_FRAME::SetSelectedSymbol( const wxString& aSymbolName )
773{
774 if( m_currentSymbol.GetUniStringLibItemName() != aSymbolName )
775 {
776 m_currentSymbol.SetLibItemName( aSymbolName );
777
778 // Ensure the corresponding line in m_symbolList is selected
779 // (which is not necessarily the case if SetSelectedSymbol is called
780 // by another caller than ClickOnSymbolList.
781 m_symbolList->SetStringSelection( UnescapeString( aSymbolName ), true );
783
785 {
786 m_unit = 1;
788 m_selection_changed = false;
789 }
790
792 }
793}
794
795
796void SYMBOL_VIEWER_FRAME::DClickOnSymbolList( wxCommandEvent& event )
797{
799}
800
801
803{
805
807 {
808 // Grid shape, etc.
809 GetGalDisplayOptions().ReadWindowSettings( cfg->m_LibViewPanel.window );
810
811 m_libListWidth = cfg->m_LibViewPanel.lib_list_width;
812 m_symbolListWidth = cfg->m_LibViewPanel.cmp_list_width;
813
814 GetRenderSettings()->m_ShowPinsElectricalType = cfg->m_LibViewPanel.show_pin_electrical_type;
815 GetRenderSettings()->m_ShowPinNumbers = cfg->m_LibViewPanel.show_pin_numbers;
816
817 // Set parameters to a reasonable value.
818 int64_t maxWidth = cfg->m_LibViewPanel.window.state.size_x - 80;
819 int64_t totalWidth = static_cast<int64_t>( m_libListWidth ) + m_symbolListWidth;
820
821 // Multiply before dividing or the integer ratio truncates to zero and starves the library list
822 if( totalWidth > 0 && totalWidth > maxWidth )
823 {
824 m_libListWidth = static_cast<int>( maxWidth * m_libListWidth / totalWidth );
825 m_symbolListWidth = static_cast<int>( maxWidth ) - m_libListWidth;
826 }
827 }
828}
829
830
832{
834
836 m_libListWidth = m_libList->GetSize().x;
837
838 m_symbolListWidth = m_symbolList->GetSize().x;
839
841 {
842 cfg->m_LibViewPanel.lib_list_width = m_libListWidth;
843 cfg->m_LibViewPanel.cmp_list_width = m_symbolListWidth;
844
845 if( SCH_RENDER_SETTINGS* renderSettings = GetRenderSettings() )
846 {
847 cfg->m_LibViewPanel.show_pin_electrical_type = renderSettings->m_ShowPinsElectricalType;
848 cfg->m_LibViewPanel.show_pin_numbers = renderSettings->m_ShowPinNumbers;
849 }
850 }
851}
852
853
855{
856 if( EESCHEMA_SETTINGS* cfg = dynamic_cast<EESCHEMA_SETTINGS*>( aCfg ) )
857 return &cfg->m_LibViewPanel.window;
858
859 wxFAIL_MSG( wxT( "SYMBOL_VIEWER not running with EESCHEMA_SETTINGS" ) );
860 return &aCfg->m_Window; // non-null fail-safe
861}
862
863
865{
867
869 GetGalDisplayOptions().ReadWindowSettings( cfg->m_LibViewPanel.window );
870
872 GetCanvas()->GetGAL()->DrawGrid();
874
875 if( aFlags & ENVVARS_CHANGED )
877}
878
879
880void SYMBOL_VIEWER_FRAME::OnActivate( wxActivateEvent& event )
881{
882 if( event.GetActive() )
884
885 event.Skip(); // required under wxMAC
886}
887
888
889void SYMBOL_VIEWER_FRAME::CloseLibraryViewer( wxCommandEvent& event )
890{
891 Close();
892}
893
894
895const BOX2I SYMBOL_VIEWER_FRAME::GetDocumentExtents( bool aIncludeAllVisible ) const
896{
897 if( LIB_SYMBOL* symbol = GetSelectedSymbol() )
898 return symbol->GetUnitBoundingBox( m_unit, m_bodyStyle );
899
900 return BOX2I( VECTOR2I( -200, -200 ), VECTOR2I( 400, 400 ) );
901}
902
903
904void SYMBOL_VIEWER_FRAME::OnLibFilter( wxCommandEvent& aEvent )
905{
907
908 // Required to avoid interaction with SetHint()
909 // See documentation for wxTextEntry::SetHint
910 aEvent.Skip();
911}
912
913
914void SYMBOL_VIEWER_FRAME::OnSymFilter( wxCommandEvent& aEvent )
915{
917
918 // Required to avoid interaction with SetHint()
919 // See documentation for wxTextEntry::SetHint
920 aEvent.Skip();
921}
922
923
924void SYMBOL_VIEWER_FRAME::OnCharHook( wxKeyEvent& aEvent )
925{
926 if( aEvent.GetKeyCode() == WXK_UP )
927 {
928 if( m_libFilter->HasFocus() || m_libList->HasFocus() )
929 {
930 int prev = m_libList->GetSelection() - 1;
931
932 if( prev >= 0 )
933 {
934 m_libList->SetSelection( prev );
935 m_libList->EnsureVisible( prev );
936
937 wxCommandEvent dummy;
939 }
940 }
941 else
942 {
944 }
945 }
946 else if( aEvent.GetKeyCode() == WXK_DOWN )
947 {
948 if( m_libFilter->HasFocus() || m_libList->HasFocus() )
949 {
950 int next = m_libList->GetSelection() + 1;
951
952 if( next < (int)m_libList->GetCount() )
953 {
954 m_libList->SetSelection( next );
955 m_libList->EnsureVisible( next );
956
957 wxCommandEvent dummy;
959 }
960 }
961 else
962 {
964 }
965 }
966 else if( aEvent.GetKeyCode() == WXK_TAB && m_libFilter->HasFocus() )
967 {
968 if( !aEvent.ShiftDown() )
969 m_symbolFilter->SetFocus();
970 else
971 aEvent.Skip();
972 }
973 else if( aEvent.GetKeyCode() == WXK_TAB && m_symbolFilter->HasFocus() )
974 {
975 if( aEvent.ShiftDown() )
976 m_libFilter->SetFocus();
977 else
978 aEvent.Skip();
979 }
980 else if( ( aEvent.GetKeyCode() == WXK_RETURN || aEvent.GetKeyCode() == WXK_NUMPAD_ENTER )
981 && m_symbolList->GetSelection() >= 0 )
982 {
983 wxCommandEvent dummy;
985 }
986 else
987 {
988 aEvent.Skip();
989 }
990}
991
992
994{
995 wxCommandEvent evt( wxEVT_COMMAND_LISTBOX_SELECTED, ID_LIBVIEW_SYM_LIST );
996 int ii = m_symbolList->GetSelection();
997
998 // Select the next symbol or stop at the end of the list.
999 if( ii != wxNOT_FOUND && ii < (int) ( m_symbolList->GetCount() - 1 ) )
1000 ii += 1;
1001
1002 m_symbolList->SetSelection( ii );
1003 ProcessEvent( evt );
1004}
1005
1006
1008{
1009 wxCommandEvent evt( wxEVT_COMMAND_LISTBOX_SELECTED, ID_LIBVIEW_SYM_LIST );
1010 int ii = m_symbolList->GetSelection();
1011
1012 // Select the previous symbol or stop at the beginning of list.
1013 if( ii != wxNOT_FOUND && ii != 0 )
1014 ii -= 1;
1015
1016 m_symbolList->SetSelection( ii );
1017 ProcessEvent( evt );
1018}
1019
1020
1021void SYMBOL_VIEWER_FRAME::onSelectSymbolUnit( wxCommandEvent& aEvent )
1022{
1023 int ii = m_unitChoice->GetSelection();
1024
1025 if( ii < 0 )
1026 return;
1027
1028 m_unit = ii + 1;
1029
1031}
1032
1033
1035{
1036 int ii = m_bodyStyleChoice->GetSelection();
1037
1038 if( ii < 0 )
1039 return;
1040
1041 m_bodyStyle = ii + 1;
1042
1044}
1045
1046
1048{
1049 wxString libName = m_currentSymbol.GetUniStringLibNickname();
1050
1051 if( m_libList && !m_libList->IsEmpty() && !libName.IsEmpty() )
1052 {
1054 LIBRARY_TABLE_ROW* row = adapter->GetRow( libName ).value_or( nullptr );
1055
1056 wxString title = row ? LIBRARY_MANAGER::GetFullURI( row, true )
1057 : _( "[no library selected]" );
1058
1059 title += wxT( " \u2014 " ) + _( "Symbol Library Browser" );
1060 SetTitle( title );
1061 }
1062}
1063
1064
1066{
1067 return m_toolManager->GetTool<SCH_SELECTION_TOOL>()->GetSelection();
1068}
1069
1070
1072{
1073
1074 switch( mail.Command() )
1075 {
1076 case MAIL_RELOAD_LIB:
1078 break;
1079
1081 {
1082 // A library reload can invalidate the LIB_SYMBOL borrowed from the adapter.
1083 const LIB_ID symbolId = m_currentSymbol;
1084
1085 if( !symbolId.IsValid() )
1086 break;
1087
1089 wxCHECK2( adapter, break );
1090
1091 LIBRARY_TABLE_ROW* row = adapter->GetRow( symbolId.GetLibNickname() ).value_or( nullptr );
1092
1093 if( !row )
1094 return;
1095
1096 wxString libfullname = LIBRARY_MANAGER::GetFullURI( row, true );
1097
1098 wxString lib( mail.GetPayload() );
1099 wxLogTrace( traceLibWatch, "Received refresh symbol request for %s, current symbols is %s", lib, libfullname );
1100
1101 if( lib == libfullname )
1102 {
1103 wxLogTrace( traceLibWatch, "Refreshing symbol %s", symbolId.GetLibItemName().wx_str() );
1106 }
1107
1108 break;
1109 }
1110 default:;
1111 }
1112}
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:917
BOX2< VECTOR2D > BOX2D
Definition box2.h:918
static TOOL_ACTION toggleGrid
Definition actions.h:195
static TOOL_ACTION showDatasheet
Definition actions.h:265
static TOOL_ACTION zoomFitScreen
Definition actions.h:139
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:240
constexpr void SetSize(const SizeVec &size)
Definition box2.h:251
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:2474
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:461
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:576
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:724
EVT_MENU(ID_COMPARE_PROJECT_BRANCHES, KICAD_MANAGER_FRAME::OnCompareProjectBranches) KICAD_MANAGER_FRAME
@ LAYER_SCHEMATIC_GRID_AXES
Definition layer_ids.h:518
@ 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.