KiCad PCB EDA Suite
Loading...
Searching...
No Matches
symbol_viewer_frame.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr
5 * Copyright (C) 2008 Wayne Stambaugh <[email protected]>
6 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, you may find one here:
20 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21 * or you may search the http://www.gnu.org website for the version 2 license,
22 * or you may write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24 */
25
26#include <wx/tokenzr.h>
27#include <bitmaps.h>
29#include <confirm.h>
31#include <eeschema_id.h>
32#include <eeschema_settings.h>
35#include <kiface_base.h>
36#include <kiway.h>
37#include <kiway_mail.h>
38#include <locale_io.h>
39#include <symbol_viewer_frame.h>
40#include <widgets/msgpanel.h>
41#include <widgets/wx_listbox.h>
44#include <sch_view.h>
45#include <sch_painter.h>
47#include <pgm_base.h>
49#include <project_sch.h>
51#include <tool/action_toolbar.h>
52#include <tool/common_control.h>
53#include <tool/common_tools.h>
55#include <tool/selection.h>
57#include <tool/tool_manager.h>
58#include <tool/zoom_tool.h>
59#include <tools/sch_actions.h>
62#include <view/view_controls.h>
63#include <wx/srchctrl.h>
64#include <wx/log.h>
65#include <wx/choice.h>
67#include <trace_helpers.h>
68
69#include <default_values.h>
70#include <string_utils.h>
72
73#include "eda_pattern_match.h"
74
75// Save previous symbol library viewer state.
77
80
81
82BEGIN_EVENT_TABLE( SYMBOL_VIEWER_FRAME, SCH_BASE_FRAME )
83 // Window events
86
87 // Toolbar events
94
95 // listbox events
101
102 // Menu (and/or hotkey) events
103 EVT_MENU( wxID_CLOSE, SYMBOL_VIEWER_FRAME::CloseLibraryViewer )
104
105END_EVENT_TABLE()
106
107
108SYMBOL_VIEWER_FRAME::SYMBOL_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
109 SCH_BASE_FRAME( aKiway, aParent, FRAME_SCH_VIEWER, _( "Symbol Library Browser" ),
110 wxDefaultPosition, wxDefaultSize, KICAD_DEFAULT_DRAWFRAME_STYLE,
112 m_unitChoice( nullptr ),
113 m_bodyStyleChoice( nullptr ),
114 m_libList( nullptr ),
115 m_symbolList( nullptr )
116{
117 m_aboutTitle = _HKI( "KiCad Symbol Library Browser" );
118
119 // Force the frame name used in config. the lib viewer frame has a name
120 // depending on aFrameType (needed to identify the frame by wxWidgets),
121 // but only one configuration is preferable.
123
124 // Give an icon
125 wxIcon icon;
126 icon.CopyFromBitmap( KiBitmap( BITMAPS::library_browser ) );
127 SetIcon( icon );
128
129 m_libListWidth = 200;
130 m_symbolListWidth = 300;
131 m_listPowerOnly = false;
132
133 SetScreen( new SCH_SCREEN );
134 GetScreen()->m_Center = true; // Axis origin centered on screen.
135 LoadSettings( config() );
136
137 // Ensure axis are always drawn (initial default display was not drawn)
139 gal_opts.m_axesEnabled = true;
140 gal_opts.m_gridMinSpacing = 10.0;
141 gal_opts.NotifyChanged();
142
143 GetRenderSettings()->LoadColors( GetColorSettings() );
144 GetCanvas()->GetGAL()->SetAxesColor( m_colorSettings->GetColor( LAYER_SCHEMATIC_GRID_AXES ) );
145
146 GetRenderSettings()->SetDefaultPenWidth( DEFAULT_LINE_WIDTH_MILS * schIUScale.IU_PER_MILS );
147
148 setupTools();
150
154
156
157 wxPanel* libPanel = new wxPanel( this );
158 wxSizer* libSizer = new wxBoxSizer( wxVERTICAL );
159
160 m_libFilter = new wxSearchCtrl( libPanel, ID_LIBVIEW_LIB_FILTER, wxEmptyString,
161 wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
162 m_libFilter->SetDescriptiveText( _( "Filter" ) );
163 libSizer->Add( m_libFilter, 0, wxEXPAND, 5 );
164
165 m_libList = new WX_LISTBOX( libPanel, ID_LIBVIEW_LIB_LIST, wxDefaultPosition, wxDefaultSize,
166 0, nullptr, wxLB_HSCROLL | wxNO_BORDER );
167 libSizer->Add( m_libList, 1, wxEXPAND, 5 );
168
169 libPanel->SetSizer( libSizer );
170 libPanel->Fit();
171
172 wxPanel* symbolPanel = new wxPanel( this );
173 wxSizer* symbolSizer = new wxBoxSizer( wxVERTICAL );
174
175 m_symbolFilter = new wxSearchCtrl( symbolPanel, ID_LIBVIEW_SYM_FILTER, wxEmptyString,
176 wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
177 m_symbolFilter->SetDescriptiveText( _( "Filter" ) );
178 m_symbolFilter->SetToolTip(
179 _( "Filter on symbol name, keywords, description and pin count.\n"
180 "Search terms are separated by spaces. All search terms must match.\n"
181 "A term which is a number will also match against the pin count." ) );
182 symbolSizer->Add( m_symbolFilter, 0, wxEXPAND, 5 );
183
184#ifdef __WXGTK__
185 // wxSearchCtrl vertical height is not calculated correctly on some GTK setups
186 // See https://gitlab.com/kicad/code/kicad/-/issues/9019
187 m_libFilter->SetMinSize( wxSize( -1, GetTextExtent( wxT( "qb" ) ).y + 10 ) );
188 m_symbolFilter->SetMinSize( wxSize( -1, GetTextExtent( wxT( "qb" ) ).y + 10 ) );
189#endif
190
191 m_symbolList = new WX_LISTBOX( symbolPanel, ID_LIBVIEW_SYM_LIST, wxDefaultPosition,
192 wxDefaultSize, 0, nullptr, wxLB_HSCROLL | wxNO_BORDER );
193 symbolSizer->Add( m_symbolList, 1, wxEXPAND, 5 );
194
195 symbolPanel->SetSizer( symbolSizer );
196 symbolPanel->Fit();
197
198 // Preload libraries
200
201 m_selection_changed = false;
202
204
205 m_auimgr.SetManagedWindow( this );
206
208
209 // Manage main toolbar
210 m_auimgr.AddPane( m_tbTopMain, EDA_PANE().HToolbar().Name( "TopMainToolbar" ).Top().Layer(6) );
211 m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" ) .Bottom().Layer(6) );
212
213 m_auimgr.AddPane( libPanel, EDA_PANE().Palette().Name( "Libraries" ).Left().Layer(2)
214 .CaptionVisible( false ).MinSize( 100, -1 ).BestSize( 200, -1 ) );
215 m_auimgr.AddPane( symbolPanel, EDA_PANE().Palette().Name( "Symbols" ).Left().Layer(1)
216 .CaptionVisible( false ).MinSize( 100, -1 ).BestSize( 300, -1 ) );
217
218 m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" ).Center() );
219
221 m_auimgr.Update();
222
223 if( m_libListWidth > 0 )
224 SetAuiPaneSize( m_auimgr, m_auimgr.GetPane( "Libraries" ), m_libListWidth, -1 );
225
226 if( m_symbolListWidth > 0 )
227 SetAuiPaneSize( m_auimgr, m_auimgr.GetPane( "Symbols" ), m_symbolListWidth, -1 );
228
230
231 Raise();
232 Show( true );
233
234 SyncView();
235 GetCanvas()->SetCanFocus( false );
236
237 setupUnits( config() );
238
239 // Set the working/draw area size to display a symbol to a reasonable value:
240 // A 450mm x 450mm with a origin at the area center looks like a large working area
241 double max_size_x = schIUScale.mmToIU( 450 );
242 double max_size_y = schIUScale.mmToIU( 450 );
243 BOX2D bbox;
244 bbox.SetOrigin( -max_size_x / 2, -max_size_y / 2 );
245 bbox.SetSize( max_size_x, max_size_y );
246 GetCanvas()->GetView()->SetBoundary( bbox );
248
249 // If a symbol was previously selected in m_symbolList from a previous run, show it
250 wxString symbName = m_symbolList->GetStringSelection();
251
252 if( !symbName.IsEmpty() )
253 {
254 SetSelectedSymbol( symbName );
256 }
257}
258
259
261{
262 // Shutdown all running tools
263 if( m_toolManager )
264 m_toolManager->ShutdownAllTools();
265
266 if( m_previewItem )
267 {
268 GetCanvas()->GetView()->Remove( m_previewItem.get() );
269 m_previewItem = nullptr;
270 }
271}
272
273
275{
276 // Create the manager and dispatcher & route draw panel events to the dispatcher
278 m_toolManager->SetEnvironment( GetScreen(), GetCanvas()->GetView(),
279 GetCanvas()->GetViewControls(), config(), this );
280 m_actions = new SCH_ACTIONS();
282
283 // Register tools
284 m_toolManager->RegisterTool( new COMMON_TOOLS );
285 m_toolManager->RegisterTool( new COMMON_CONTROL );
286 m_toolManager->RegisterTool( new ZOOM_TOOL );
287 m_toolManager->RegisterTool( new SCH_INSPECTION_TOOL ); // manage show datasheet
288 m_toolManager->RegisterTool( new SCH_SELECTION_TOOL ); // manage context menu
289 m_toolManager->RegisterTool( new SYMBOL_EDITOR_CONTROL ); // manage render settings
290
291 m_toolManager->InitTools();
292
293 // Run the selection tool, it is supposed to be always active
294 // It also manages the mouse right click to show the context menu
295 m_toolManager->InvokeTool( "common.InteractiveSelection" );
296
298}
299
300
302{
304
305 ACTION_MANAGER* mgr = m_toolManager->GetActionManager();
306 EDITOR_CONDITIONS cond( this );
307
308 wxASSERT( mgr );
309
310#define ENABLE( x ) ACTION_CONDITIONS().Enable( x )
311#define CHECK( x ) ACTION_CONDITIONS().Check( x )
312
314
315 auto electricalTypesShownCondition =
316 [this]( const SELECTION& aSel )
317 {
319 };
320
321 auto pinNumbersShownCondition =
322 [this]( const SELECTION& )
323 {
325 };
326
327 auto haveDatasheetCond =
328 [this]( const SELECTION& )
329 {
330 LIB_SYMBOL* symbol = GetSelectedSymbol();
331 return symbol && !symbol->GetDatasheetField().GetText().IsEmpty();
332 };
333
334 mgr->SetConditions( ACTIONS::showDatasheet, ENABLE( haveDatasheetCond ) );
335 mgr->SetConditions( SCH_ACTIONS::showElectricalTypes, CHECK( electricalTypesShownCondition ) );
336 mgr->SetConditions( SCH_ACTIONS::showPinNumbers, CHECK( pinNumbersShownCondition ) );
337
338#undef CHECK
339#undef ENABLE
340}
341
342
343void SYMBOL_VIEWER_FRAME::SetUnitAndBodyStyle( int aUnit, int aBodyStyle )
344{
345 m_unit = aUnit > 0 ? aUnit : 1;
346 m_bodyStyle = aBodyStyle > 0 ? aBodyStyle : BODY_STYLE::BASE;
347 m_selection_changed = false;
348
350}
351
352
354{
355 LIB_SYMBOL* symbol = nullptr;
356
357 if( m_currentSymbol.IsValid() )
359
360 return symbol;
361}
362
363
365{
366 LIB_SYMBOL* symbol = GetSelectedSymbol();
367 KIGFX::SCH_VIEW* view = GetCanvas()->GetView();
368
369 if( m_previewItem )
370 {
371 view->Remove( m_previewItem.get() );
372 m_previewItem = nullptr;
373 }
374
376
377 if( symbol )
378 {
381
382 m_previewItem = symbol->Flatten();
383 view->Add( m_previewItem.get() );
384
385 wxString parentName;
386
387 if( std::shared_ptr<LIB_SYMBOL> parent = symbol->GetParent().lock() )
388 parentName = parent->GetName();
389
390 AppendMsgPanel( _( "Name" ), UnescapeString( m_previewItem->GetName() ) );
391 AppendMsgPanel( _( "Parent" ), UnescapeString( parentName ) );
392 AppendMsgPanel( _( "Description" ), m_previewItem->GetDescription() );
393 AppendMsgPanel( _( "Keywords" ), m_previewItem->GetKeyWords() );
394 }
395
397 GetCanvas()->Refresh();
398
401}
402
403
405{
407
408 delete m_toolManager;
409 m_toolManager = nullptr;
410
411 Destroy();
412}
413
414
415void SYMBOL_VIEWER_FRAME::OnSize( wxSizeEvent& SizeEv )
416{
417 if( m_auimgr.GetManagedWindow() )
418 m_auimgr.Update();
419
420 SizeEv.Skip();
421}
422
423
425{
426 LIB_SYMBOL* symbol = GetSelectedSymbol();
427
428 int unit_count = 1;
429
430 if( symbol )
431 unit_count = std::max( symbol->GetUnitCount(), 1 );
432
433 m_unitChoice->Enable( unit_count > 1 );
434 m_unitChoice->Clear();
435
436 if( unit_count > 1 )
437 {
438 // rebuild the unit list if it is not suitable (after a new selection for instance)
439 if( unit_count != (int) m_unitChoice->GetCount() )
440 {
441 for( int ii = 0; ii < unit_count; ii++ )
442 m_unitChoice->Append( symbol->GetUnitDisplayName( ii + 1, true ) );
443 }
444
445 if( m_unitChoice->GetSelection() != std::max( 0, m_unit - 1 ) )
446 m_unitChoice->SetSelection( std::max( 0, m_unit - 1 ) );
447 }
448}
449
450
452{
453 LIB_SYMBOL* symbol = GetSelectedSymbol();
454
455 int bodyStyle_count = 1;
456
457 if( symbol )
458 bodyStyle_count = std::max( symbol->GetBodyStyleCount(), 1 );
459
460 m_bodyStyleChoice->Enable( bodyStyle_count > 1 );
461 m_bodyStyleChoice->Clear();
462
463 if( bodyStyle_count > 1 )
464 {
465 if( symbol && symbol->HasDeMorganBodyStyles() )
466 {
467 m_bodyStyleChoice->Append( wxGetTranslation( DEMORGAN_STD ) );
468 m_bodyStyleChoice->Append( wxGetTranslation( DEMORGAN_ALT ) );
469 }
470 else if( symbol )
471 {
472 for( int i = 0; i < symbol->GetBodyStyleCount(); i++ )
473 m_bodyStyleChoice->Append( symbol->GetBodyStyleNames()[i] );
474 }
475
476 if( m_bodyStyleChoice->GetSelection() != std::max( 0, m_bodyStyle - 1 ) )
477 m_bodyStyleChoice->SetSelection( std::max( 0, m_bodyStyle - 1 ) );
478 }
479}
480
481
483{
484 if( !m_libList )
485 return false;
486
487 m_libList->Clear();
488
492 std::vector<wxString> libNicknames = adapter->GetLibraryNames();
493 std::vector<wxString> pinnedMatches;
494 std::vector<wxString> otherMatches;
495
496 auto doAddLib =
497 [&]( const wxString& aLib )
498 {
499 if( alg::contains( project.m_PinnedSymbolLibs, aLib )
501 {
502 pinnedMatches.push_back( aLib );
503 }
504 else
505 {
506 otherMatches.push_back( aLib );
507 }
508 };
509
510 auto process =
511 [&]( const wxString& aLib )
512 {
513 // Remove not allowed libs, if the allowed lib list is not empty
514 if( m_allowedLibs.GetCount() )
515 {
516 if( m_allowedLibs.Index( aLib ) == wxNOT_FOUND )
517 return;
518 }
519
520 // Remove libs which have no power symbols, if this filter is activated
521 if( m_listPowerOnly )
522 {
523 std::vector<wxString> symbolNames = adapter->GetSymbolNames(
525
526 if( symbolNames.empty() )
527 return;
528 }
529
530 LIBRARY_TABLE_ROW* row = adapter->GetRow( aLib ).value_or( nullptr );
531 wxCHECK( row, /* void */ );
532
533 if( row->Hidden() )
534 return;
535
536 if( adapter->SupportsSubLibraries( aLib ) )
537 {
538 for( const auto& [nickname, description] : adapter->GetSubLibraries( aLib ) )
539 {
540 wxString suffix = nickname.IsEmpty()
541 ? wxString( wxT( "" ) )
542 : wxString::Format( wxT( " - %s" ), nickname );
543 wxString name = wxString::Format( wxT( "%s%s" ), aLib, suffix );
544
545 doAddLib( name );
546 }
547 }
548 else
549 {
550 doAddLib( aLib );
551 }
552 };
553
554 if( m_libFilter->GetValue().IsEmpty() )
555 {
556 for( const wxString& lib : libNicknames )
557 process( lib );
558 }
559 else
560 {
561 wxStringTokenizer tokenizer( m_libFilter->GetValue(), " \t\r\n", wxTOKEN_STRTOK );
562
563 while( tokenizer.HasMoreTokens() )
564 {
565 const wxString term = tokenizer.GetNextToken().Lower();
566 EDA_COMBINED_MATCHER matcher( term, CTX_LIBITEM );
567
568 for( const wxString& lib : libNicknames )
569 {
570 if( matcher.Find( lib.Lower() ) )
571 process( lib );
572 }
573 }
574 }
575
576 if( libNicknames.empty() )
577 return true;
578
579 for( const wxString& name : pinnedMatches )
581
582 for( const wxString& name : otherMatches )
583 m_libList->Append( UnescapeString( name ) );
584
585 // Search for a previous selection:
586 int index =
587 m_libList->FindString( UnescapeString( m_currentSymbol.GetUniStringLibNickname() ) );
588
589 if( index != wxNOT_FOUND )
590 {
591 m_libList->SetSelection( index, true );
592 }
593 else
594 {
595 // If not found, clear current library selection because it can be deleted after a
596 // config change.
597 m_currentSymbol.SetLibNickname( m_libList->GetCount() > 0 ? m_libList->GetBaseString( 0 )
598 : wxString( wxEmptyString ) );
599 m_currentSymbol.SetLibItemName( wxEmptyString );
600 m_unit = 1;
602 }
603
604 bool cmp_changed = ReCreateSymbolList();
606 GetCanvas()->Refresh();
607
608 return cmp_changed;
609}
610
611
613{
614 if( m_symbolList == nullptr )
615 return false;
616
617 m_symbolList->Clear();
618
619 wxString libName = m_currentSymbol.GetUniStringLibNickname();
620
621 if( libName.IsEmpty() )
622 return false;
623
625 std::vector<LIB_SYMBOL*> symbols = adapter->GetSymbols( libName );
626
627 std::set<wxString> excludes;
628
629 if( !m_symbolFilter->GetValue().IsEmpty() )
630 {
631 wxStringTokenizer tokenizer( m_symbolFilter->GetValue(), " \t\r\n", wxTOKEN_STRTOK );
632
633 while( tokenizer.HasMoreTokens() )
634 {
635 const wxString filterTerm = tokenizer.GetNextToken().Lower();
636 EDA_COMBINED_MATCHER matcher( filterTerm, CTX_LIBITEM );
637
638 for( LIB_SYMBOL* symbol : symbols )
639 {
640 std::vector<SEARCH_TERM> searchTerms = symbol->GetSearchTerms();
641 int matched = matcher.ScoreTerms( searchTerms );
642
643 if( filterTerm.IsNumber() && wxAtoi( filterTerm ) == (int)symbol->GetPinCount() )
644 matched++;
645
646 if( !matched )
647 excludes.insert( symbol->GetName() );
648 }
649 }
650 }
651
652 wxString subLib = m_currentSymbol.GetSubLibraryName();
653
654 for( const LIB_SYMBOL* symbol : symbols )
655 {
656 if( adapter->SupportsSubLibraries( libName )
657 && !subLib.IsSameAs( symbol->GetLibId().GetSubLibraryName() ) )
658 {
659 continue;
660 }
661
662 if( !excludes.count( symbol->GetName() ) )
663 m_symbolList->Append( UnescapeString( symbol->GetName() ) );
664 }
665
666 if( m_symbolList->IsEmpty() )
667 {
668 SetSelectedSymbol( wxEmptyString );
670 m_unit = 1;
671 return true;
672 }
673
674 int index =
675 m_symbolList->FindString( UnescapeString( m_currentSymbol.GetUniStringLibItemName() ) );
676 bool changed = false;
677
678 if( index == wxNOT_FOUND )
679 {
680 // Select the first library entry when the previous entry name does not exist in
681 // the current library.
683 m_unit = 1;
684 index = -1;
685 changed = true;
686 SetSelectedSymbol( wxEmptyString );
687 }
688
689 m_symbolList->SetSelection( index, true );
690
691 return changed;
692}
693
694
695void SYMBOL_VIEWER_FRAME::ClickOnLibList( wxCommandEvent& event )
696{
697 int ii = m_libList->GetSelection();
698
699 if( ii < 0 )
700 return;
701
702 m_selection_changed = true;
703
704 wxString selection = EscapeString( m_libList->GetBaseString( ii ), CTX_LIBID );
705
707
708 if( !adapter->HasLibrary( selection ) && selection.Find( '-' ) != wxNOT_FOUND )
709 {
710 // Probably a sub-library
711 wxString sublib;
712 selection = selection.BeforeLast( '-', &sublib ).Trim();
713 sublib.Trim( false );
714 SetSelectedLibrary( selection, sublib );
715 }
716 else
717 {
718 SetSelectedLibrary( selection );
719 }
720}
721
722
723void SYMBOL_VIEWER_FRAME::SetSelectedLibrary( const wxString& aLibraryName,
724 const wxString& aSubLibName )
725{
726 if( m_currentSymbol.GetUniStringLibNickname() == aLibraryName
727 && wxString( m_currentSymbol.GetSubLibraryName().wx_str() ) == aSubLibName )
728 return;
729
730 m_currentSymbol.SetLibNickname( aLibraryName );
731 m_currentSymbol.SetSubLibraryName( aSubLibName );
733 GetCanvas()->Refresh();
735
736 // Ensure the corresponding line in m_libList is selected
737 // (which is not necessary the case if SetSelectedLibrary is called
738 // by another caller than ClickOnLibList.
739 m_libList->SetStringSelection( UnescapeString( m_currentSymbol.GetFullLibraryName() ), true );
740
741 // The m_libList has now the focus, in order to be able to use arrow keys
742 // to navigate inside the list.
743 // the gal canvas must not steal the focus to allow navigation
744 GetCanvas()->SetStealsFocus( false );
745 m_libList->SetFocus();
746}
747
748
749void SYMBOL_VIEWER_FRAME::ClickOnSymbolList( wxCommandEvent& event )
750{
751 int ii = m_symbolList->GetSelection();
752
753 if( ii < 0 )
754 return;
755
756 m_selection_changed = true;
757
758 SetSelectedSymbol( EscapeString( m_symbolList->GetBaseString( ii ), CTX_LIBID ) );
759
760 // The m_symbolList 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_symbolList->SetFocus();
765}
766
767
768void SYMBOL_VIEWER_FRAME::SetSelectedSymbol( const wxString& aSymbolName )
769{
770 if( m_currentSymbol.GetUniStringLibItemName() != aSymbolName )
771 {
772 m_currentSymbol.SetLibItemName( aSymbolName );
773
774 // Ensure the corresponding line in m_symbolList is selected
775 // (which is not necessarily the case if SetSelectedSymbol is called
776 // by another caller than ClickOnSymbolList.
777 m_symbolList->SetStringSelection( UnescapeString( aSymbolName ), true );
779
781 {
782 m_unit = 1;
784 m_selection_changed = false;
785 }
786
788 }
789}
790
791
792void SYMBOL_VIEWER_FRAME::DClickOnSymbolList( wxCommandEvent& event )
793{
795}
796
797
799{
801
803 {
804 // Grid shape, etc.
805 GetGalDisplayOptions().ReadWindowSettings( cfg->m_LibViewPanel.window );
806
807 m_libListWidth = cfg->m_LibViewPanel.lib_list_width;
808 m_symbolListWidth = cfg->m_LibViewPanel.cmp_list_width;
809
810 GetRenderSettings()->m_ShowPinsElectricalType = cfg->m_LibViewPanel.show_pin_electrical_type;
811 GetRenderSettings()->m_ShowPinNumbers = cfg->m_LibViewPanel.show_pin_numbers;
812
813 // Set parameters to a reasonable value.
814 int maxWidth = cfg->m_LibViewPanel.window.state.size_x - 80;
815
816 if( m_libListWidth + m_symbolListWidth > maxWidth )
817 {
820 }
821 }
822}
823
824
826{
828
830 m_libListWidth = m_libList->GetSize().x;
831
832 m_symbolListWidth = m_symbolList->GetSize().x;
833
835 {
836 cfg->m_LibViewPanel.lib_list_width = m_libListWidth;
837 cfg->m_LibViewPanel.cmp_list_width = m_symbolListWidth;
838
839 if( SCH_RENDER_SETTINGS* renderSettings = GetRenderSettings() )
840 {
841 cfg->m_LibViewPanel.show_pin_electrical_type = renderSettings->m_ShowPinsElectricalType;
842 cfg->m_LibViewPanel.show_pin_numbers = renderSettings->m_ShowPinNumbers;
843 }
844 }
845}
846
847
849{
850 if( EESCHEMA_SETTINGS* cfg = dynamic_cast<EESCHEMA_SETTINGS*>( aCfg ) )
851 return &cfg->m_LibViewPanel.window;
852
853 wxFAIL_MSG( wxT( "SYMBOL_VIEWER not running with EESCHEMA_SETTINGS" ) );
854 return &aCfg->m_Window; // non-null fail-safe
855}
856
857
859{
861
863 GetGalDisplayOptions().ReadWindowSettings( cfg->m_LibViewPanel.window );
864
866 GetCanvas()->GetGAL()->DrawGrid();
868
869 if( aFlags && ENVVARS_CHANGED )
871}
872
873
874void SYMBOL_VIEWER_FRAME::OnActivate( wxActivateEvent& event )
875{
876 if( event.GetActive() )
877 {
878 bool changed = m_libList ? ReCreateLibList() : false;
879
880 if (changed)
881 m_selection_changed = true;
882
884
886 }
887
888 event.Skip(); // required under wxMAC
889}
890
891
892void SYMBOL_VIEWER_FRAME::CloseLibraryViewer( wxCommandEvent& event )
893{
894 Close();
895}
896
897
898const BOX2I SYMBOL_VIEWER_FRAME::GetDocumentExtents( bool aIncludeAllVisible ) const
899{
900 if( LIB_SYMBOL* symbol = GetSelectedSymbol() )
901 return symbol->GetUnitBoundingBox( m_unit, m_bodyStyle );
902
903 return BOX2I( VECTOR2I( -200, -200 ), VECTOR2I( 400, 400 ) );
904}
905
906
907void SYMBOL_VIEWER_FRAME::OnLibFilter( wxCommandEvent& aEvent )
908{
910
911 // Required to avoid interaction with SetHint()
912 // See documentation for wxTextEntry::SetHint
913 aEvent.Skip();
914}
915
916
917void SYMBOL_VIEWER_FRAME::OnSymFilter( wxCommandEvent& aEvent )
918{
920
921 // Required to avoid interaction with SetHint()
922 // See documentation for wxTextEntry::SetHint
923 aEvent.Skip();
924}
925
926
927void SYMBOL_VIEWER_FRAME::OnCharHook( wxKeyEvent& aEvent )
928{
929 if( aEvent.GetKeyCode() == WXK_UP )
930 {
931 if( m_libFilter->HasFocus() || m_libList->HasFocus() )
932 {
933 int prev = m_libList->GetSelection() - 1;
934
935 if( prev >= 0 )
936 {
937 m_libList->SetSelection( prev );
938 m_libList->EnsureVisible( prev );
939
940 wxCommandEvent dummy;
942 }
943 }
944 else
945 {
946 wxCommandEvent dummy;
948 }
949 }
950 else if( aEvent.GetKeyCode() == WXK_DOWN )
951 {
952 if( m_libFilter->HasFocus() || m_libList->HasFocus() )
953 {
954 int next = m_libList->GetSelection() + 1;
955
956 if( next < (int)m_libList->GetCount() )
957 {
958 m_libList->SetSelection( next );
959 m_libList->EnsureVisible( next );
960
961 wxCommandEvent dummy;
963 }
964 }
965 else
966 {
967 wxCommandEvent dummy;
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
998void SYMBOL_VIEWER_FRAME::onSelectNextSymbol( wxCommandEvent& aEvent )
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
1062 ? LIBRARY_MANAGER::GetFullURI( row, true )
1063 : _( "[no library selected]" );
1064
1065 title += wxT( " \u2014 " ) + _( "Symbol Library Browser" );
1066 SetTitle( title );
1067 }
1068}
1069
1070
1072{
1073 return m_toolManager->GetTool<SCH_SELECTION_TOOL>()->GetSelection();
1074}
1075
1076
1078{
1079
1080 switch( mail.Command() )
1081 {
1082 case MAIL_RELOAD_LIB:
1084 break;
1085
1087 {
1088 LIB_SYMBOL* symbol = GetSelectedSymbol();
1089 wxCHECK2( symbol, break );
1090
1092 LIBRARY_TABLE_ROW* row =
1093 adapter->GetRow( symbol->GetLibId().GetLibNickname() ).value_or( nullptr );
1094
1095 if( !row )
1096 return;
1097
1098 wxString libfullname = LIBRARY_MANAGER::GetFullURI( row, true );
1099
1100 wxString lib( mail.GetPayload() );
1101 wxLogTrace( traceLibWatch, "Received refresh symbol request for %s, current symbols is %s",
1102 lib, libfullname );
1103
1104 if( lib == libfullname )
1105 {
1106 wxLogTrace( traceLibWatch, "Refreshing symbol %s", symbol->GetName() );
1109 }
1110
1111 break;
1112 }
1113 default:;
1114 }
1115}
int index
const char * name
constexpr EDA_IU_SCALE schIUScale
Definition base_units.h:114
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
Definition bitmap.cpp:104
@ library_browser
BOX2< VECTOR2I > BOX2I
Definition box2.h:922
BOX2< VECTOR2D > BOX2D
Definition box2.h:923
static TOOL_ACTION toggleGrid
Definition actions.h:198
static TOOL_ACTION showDatasheet
Definition actions.h:267
static TOOL_ACTION zoomFitScreen
Definition actions.h:142
Manage TOOL_ACTION objects.
void SetConditions(const TOOL_ACTION &aAction, const ACTION_CONDITIONS &aConditions)
Set the conditions the UI elements for activating a specific tool action should use for determining t...
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
WINDOW_SETTINGS m_Window
constexpr void SetOrigin(const Vec &pos)
Definition box2.h:237
constexpr void SetSize(const SizeVec &size)
Definition box2.h:248
Handle actions that are shared between different applications.
Handles action that are shared between different applications.
virtual APP_SETTINGS_BASE * config() const
Return the settings object used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME.
virtual void setupUIConditions()
Setup the UI conditions for the various actions and their controls in this frame.
TOOLBAR_SETTINGS * m_toolbarSettings
wxString m_configName
wxAuiManager m_auimgr
virtual void RecreateToolbars()
bool ProcessEvent(wxEvent &aEvent) override
Override the default process event handler to implement the auto save feature.
ACTION_TOOLBAR * m_tbTopMain
wxString m_aboutTitle
void ReCreateMenuBar()
Recreate the menu bar.
int ScoreTerms(std::vector< SEARCH_TERM > &aWeightedTerms)
bool Find(const wxString &aTerm, int &aMatchersTriggered, int &aPosition)
Look in all existing matchers, return the earliest match of any of the existing.
virtual void ClearMsgPanel()
Clear all messages from the message panel.
COLOR_SETTINGS * m_colorSettings
void 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.
double m_gridMinSpacing
Whether or not to draw the coordinate system axes.
bool m_axesEnabled
Crosshair drawing mode.
void SetAxesColor(const COLOR4D &aAxesColor)
Set the axes color.
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Add a VIEW_ITEM to the view.
Definition view.cpp:299
virtual void Remove(VIEW_ITEM *aItem)
Remove a VIEW_ITEM from the view.
Definition view.cpp:342
void UpdateAllItems(int aUpdateFlags)
Update all items in the view according to the given flags.
Definition view.cpp:1576
Carry a payload from one KIWAY_PLAYER to another within a PROJECT.
Definition kiway_mail.h:38
std::string & GetPayload()
Return the payload, which can be any text but it typically self identifying s-expression.
Definition kiway_mail.h:56
MAIL_T Command()
Returns the MAIL_T associated with this mail.
Definition kiway_mail.h:48
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:295
virtual PROJECT & Prj() const
Return the PROJECT associated with this KIWAY.
Definition kiway.cpp:207
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) const
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:49
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Definition lib_id.h:87
Define a library symbol object.
Definition lib_symbol.h:83
const LIB_ID & GetLibId() const override
Definition lib_symbol.h:152
std::weak_ptr< LIB_SYMBOL > & GetParent()
Definition lib_symbol.h:114
SCH_FIELD & GetDatasheetField()
Return reference to the datasheet field.
Definition lib_symbol.h:344
wxString GetName() const override
Definition lib_symbol.h:145
const std::vector< wxString > & GetBodyStyleNames() const
Definition lib_symbol.h:787
bool HasDeMorganBodyStyles() const override
Definition lib_symbol.h:784
int GetBodyStyleCount() const override
Definition lib_symbol.h:776
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:541
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:203
Gather all the actions that are shared by tools.
Definition sch_actions.h:40
static TOOL_ACTION showElectricalTypes
static TOOL_ACTION showPinNumbers
static TOOL_ACTION addSymbolToSchematic
A shim class between EDA_DRAW_FRAME and several derived classes: SYMBOL_EDIT_FRAME,...
SCH_BASE_FRAME(KIWAY *aKiway, wxWindow *aParent, FRAME_T aWindowType, const wxString &aTitle, const wxPoint &aPosition, const wxSize &aSize, long aStyle, const wxString &aFrameName)
SCH_RENDER_SETTINGS * GetRenderSettings()
void doCloseWindow() override
void SaveSettings(APP_SETTINGS_BASE *aCfg) override
Save common frame parameters to a configuration data file.
void LoadSettings(APP_SETTINGS_BASE *aCfg) override
Load common frame parameters from a configuration file.
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
void CommonSettingsChanged(int aFlags) override
Notification event that some of the common (suite-wide) settings have changed.
void SyncView()
Mark all items for refresh.
KIGFX::SCH_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
virtual const wxString & GetText() const override
Return the string associated with the text object.
Definition sch_field.h:116
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 onSelectNextSymbol(wxCommandEvent &aEvent)
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_ROUTED_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 onSelectPreviousSymbol(wxCommandEvent &aEvent)
void SaveSettings(APP_SETTINGS_BASE *aCfg) override
Save common frame parameters to a configuration data file.
void onSelectSymbolBodyStyle(wxCommandEvent &aEvent)
bool m_selection_changed
Updated to true if a list rewrite on GUI activation resulted in the symbol selection changing,...
bool ReCreateSymbolList()
Create or recreate the list of symbols in the currently selected library.
void CommonSettingsChanged(int aFlags) override
Notification event that some of the common (suite-wide) settings have changed.
TOOL_MANAGER * m_toolManager
TOOL_DISPATCHER * m_toolDispatcher
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
ACTIONS * m_actions
Master controller class:
This file is part of the common library.
#define CHECK(x)
#define ENABLE(x)
#define DEFAULT_LINE_WIDTH_MILS
The default wire width in mils. (can be changed in preference menu)
#define _(s)
#define KICAD_DEFAULT_DRAWFRAME_STYLE
#define LIB_VIEW_FRAME_NAME
Abstract pattern-matching tool and implementations.
@ CTX_LIBITEM
@ ID_LIBVIEW_SELECT_UNIT_NUMBER
Definition eeschema_id.h:71
@ ID_LIBVIEW_SYM_LIST
Definition eeschema_id.h:76
@ ID_LIBVIEW_NEXT
Definition eeschema_id.h:69
@ ID_LIBVIEW_SELECT_BODY_STYLE
Definition eeschema_id.h:72
@ ID_LIBVIEW_LIB_FILTER
Definition eeschema_id.h:73
@ ID_LIBVIEW_LIB_LIST
Definition eeschema_id.h:74
@ ID_LIBVIEW_SYM_FILTER
Definition eeschema_id.h:75
@ ID_LIBVIEW_PREVIOUS
Definition eeschema_id.h:70
@ FRAME_SCH_VIEWER
Definition frame_type.h:36
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:642
@ LAYER_SCHEMATIC_GRID_AXES
Definition layer_ids.h:487
@ MAIL_REFRESH_SYMBOL
Definition mail_type.h:59
@ MAIL_RELOAD_LIB
Definition mail_type.h:57
Message panel definition file.
@ ALL
All except INITIAL_ADD.
Definition view_item.h:59
bool contains(const _Container &__container, _Value __value)
Returns true if the container contains the given value.
Definition kicad_algo.h:100
#define _HKI(x)
Definition page_info.cpp:44
static PGM_BASE * process
PGM_BASE & Pgm()
The global program "get" accessor.
see class PGM_BASE
CITER next(CITER it)
Definition ptree.cpp:124
@ BASE
Definition sch_item.h:60
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:695
void SetAuiPaneSize(wxAuiManager &aManager, wxAuiPaneInfo &aPane, int aWidth, int aHeight)
Sets the size of an AUI pane, working around http://trac.wxwidgets.org/ticket/13180.