From 8a720ef305ef5d6ee3f07dc181524d51423616e5 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 25 Dec 2020 23:37:01 +0000 Subject: [PATCH] Update naming. --- eeschema/CMakeLists.txt | 4 +- eeschema/dialogs/dialog_symbol_remap.cpp | 4 +- eeschema/dialogs/panel_sym_lib_table.cpp | 4 +- eeschema/eeschema.cpp | 5 +- eeschema/getpart.cpp | 34 +++--- eeschema/project_rescue.cpp | 2 +- eeschema/sch_base_frame.h | 4 +- eeschema/sch_edit_frame.cpp | 6 +- ...view_frame.cpp => symbol_viewer_frame.cpp} | 102 +++++++++--------- ...lib_view_frame.h => symbol_viewer_frame.h} | 8 +- ...ib_view.cpp => toolbars_symbol_viewer.cpp} | 11 +- eeschema/tools/ee_inspection_tool.cpp | 5 +- eeschema/tools/ee_selection_tool.cpp | 35 +++--- eeschema/tools/ee_selection_tool.h | 2 +- eeschema/tools/sch_editor_control.cpp | 4 +- eeschema/tools/symbol_editor_control.cpp | 24 ++--- 16 files changed, 126 insertions(+), 128 deletions(-) rename eeschema/{lib_view_frame.cpp => symbol_viewer_frame.cpp} (87%) rename eeschema/{lib_view_frame.h => symbol_viewer_frame.h} (96%) rename eeschema/{toolbars_lib_view.cpp => toolbars_symbol_viewer.cpp} (94%) diff --git a/eeschema/CMakeLists.txt b/eeschema/CMakeLists.txt index d2723bea59..010a57cded 100644 --- a/eeschema/CMakeLists.txt +++ b/eeschema/CMakeLists.txt @@ -187,7 +187,7 @@ set( EESCHEMA_SRCS lib_polyline.cpp lib_rectangle.cpp lib_text.cpp - lib_view_frame.cpp + symbol_viewer_frame.cpp libarch.cpp menubar.cpp pin_number.cpp @@ -233,7 +233,7 @@ set( EESCHEMA_SRCS symbol_lib_table.cpp symbol_tree_model_adapter.cpp symbol_tree_synchronizing_adapter.cpp - toolbars_lib_view.cpp + toolbars_symbol_viewer.cpp toolbars_sch_editor.cpp transform.cpp diff --git a/eeschema/dialogs/dialog_symbol_remap.cpp b/eeschema/dialogs/dialog_symbol_remap.cpp index 763a475d70..0ca990671b 100644 --- a/eeschema/dialogs/dialog_symbol_remap.cpp +++ b/eeschema/dialogs/dialog_symbol_remap.cpp @@ -33,7 +33,7 @@ #include #include -#include +#include #include #include #include @@ -95,7 +95,7 @@ void DIALOG_SYMBOL_REMAP::OnRemapSymbols( wxCommandEvent& aEvent ) if( RESCUER::RescueProject( this, rescuer, false ) ) { - LIB_VIEW_FRAME* viewer = (LIB_VIEW_FRAME*) parent->Kiway().Player( FRAME_SCH_VIEWER, false ); + auto viewer = (SYMBOL_VIEWER_FRAME*) parent->Kiway().Player( FRAME_SCH_VIEWER, false ); if( viewer ) viewer->ReCreateLibList(); diff --git a/eeschema/dialogs/panel_sym_lib_table.cpp b/eeschema/dialogs/panel_sym_lib_table.cpp index 137c1d17fd..a14a3e859f 100644 --- a/eeschema/dialogs/panel_sym_lib_table.cpp +++ b/eeschema/dialogs/panel_sym_lib_table.cpp @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include #include @@ -925,7 +925,7 @@ void InvokeSchEditSymbolLibTable( KIWAY* aKiway, wxWindow *aParent ) { auto* schEditor = (SCH_EDIT_FRAME*) aKiway->Player( FRAME_SCH, false ); auto* symbolEditor = (SYMBOL_EDIT_FRAME*) aKiway->Player( FRAME_SCH_SYMBOL_EDITOR, false ); - auto* symbolViewer = (LIB_VIEW_FRAME*) aKiway->Player( FRAME_SCH_VIEWER, false ); + auto* symbolViewer = (SYMBOL_VIEWER_FRAME*) aKiway->Player( FRAME_SCH_VIEWER, false ); SYMBOL_LIB_TABLE* globalTable = &SYMBOL_LIB_TABLE::GetGlobalLibTable(); wxString globalTablePath = SYMBOL_LIB_TABLE::GetGlobalTableFileName(); diff --git a/eeschema/eeschema.cpp b/eeschema/eeschema.cpp index 13e802691a..4da399b594 100644 --- a/eeschema/eeschema.cpp +++ b/eeschema/eeschema.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include #include @@ -155,7 +155,8 @@ static struct IFACE : public KIFACE_I case FRAME_SCH_VIEWER: case FRAME_SCH_VIEWER_MODAL: { - LIB_VIEW_FRAME* frame = new LIB_VIEW_FRAME( aKiway, aParent, FRAME_T( aClassId ) ); + SYMBOL_VIEWER_FRAME* frame = new SYMBOL_VIEWER_FRAME( aKiway, aParent, + FRAME_T( aClassId ) ); return frame; } diff --git a/eeschema/getpart.cpp b/eeschema/getpart.cpp index a8ff90ef9e..158eaa688b 100644 --- a/eeschema/getpart.cpp +++ b/eeschema/getpart.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include #include @@ -46,41 +46,41 @@ PICKED_SYMBOL SCH_BASE_FRAME::PickSymbolFromLibBrowser( wxTopLevelWindow* aParen int aUnit, int aConvert ) { // Close any open non-modal Lib browser, and open a new one, in "modal" mode: - LIB_VIEW_FRAME* viewlibFrame = (LIB_VIEW_FRAME*) Kiway().Player( FRAME_SCH_VIEWER, false ); + SYMBOL_VIEWER_FRAME* viewer = (SYMBOL_VIEWER_FRAME*) Kiway().Player( FRAME_SCH_VIEWER, false ); - if( viewlibFrame ) - viewlibFrame->Destroy(); + if( viewer ) + viewer->Destroy(); - viewlibFrame = (LIB_VIEW_FRAME*) Kiway().Player( FRAME_SCH_VIEWER_MODAL, true, aParent ); + viewer = (SYMBOL_VIEWER_FRAME*) Kiway().Player( FRAME_SCH_VIEWER_MODAL, true, aParent ); if( aFilter ) - viewlibFrame->SetFilter( aFilter ); + viewer->SetFilter( aFilter ); if( aPreselectedLibId.IsValid() ) { - viewlibFrame->SetSelectedLibrary( aPreselectedLibId.GetLibNickname() ); - viewlibFrame->SetSelectedComponent( aPreselectedLibId.GetLibItemName() ); + viewer->SetSelectedLibrary( aPreselectedLibId.GetLibNickname() ); + viewer->SetSelectedComponent( aPreselectedLibId.GetLibItemName() ); } - viewlibFrame->SetUnitAndConvert( aUnit, aConvert ); + viewer->SetUnitAndConvert( aUnit, aConvert ); - viewlibFrame->Refresh(); + viewer->Refresh(); PICKED_SYMBOL sel; wxString symbol; - if( viewlibFrame->ShowModal( &symbol, aParent ) ) + if( viewer->ShowModal( &symbol, aParent ) ) { LIB_ID id; if( id.Parse( symbol ) == -1 ) sel.LibId = id; - sel.Unit = viewlibFrame->GetUnit(); - sel.Convert = viewlibFrame->GetConvert(); + sel.Unit = viewer->GetUnit(); + sel.Convert = viewer->GetConvert(); } - viewlibFrame->Destroy(); + viewer->Destroy(); return sel; } @@ -88,10 +88,8 @@ PICKED_SYMBOL SCH_BASE_FRAME::PickSymbolFromLibBrowser( wxTopLevelWindow* aParen PICKED_SYMBOL SCH_BASE_FRAME::PickSymbolFromLibTree( const SCHLIB_FILTER* aFilter, std::vector& aHistoryList, - bool aUseLibBrowser, - int aUnit, int aConvert, - bool aShowFootprints, - const LIB_ID* aHighlight, + bool aUseLibBrowser, int aUnit, int aConvert, + bool aShowFootprints, const LIB_ID* aHighlight, bool aAllowFields ) { std::unique_lock dialogLock( DIALOG_CHOOSE_SYMBOL::g_Mutex, std::defer_lock ); diff --git a/eeschema/project_rescue.cpp b/eeschema/project_rescue.cpp index a5fed90355..96a522142f 100644 --- a/eeschema/project_rescue.cpp +++ b/eeschema/project_rescue.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/eeschema/sch_base_frame.h b/eeschema/sch_base_frame.h index 0078c40935..9a065f6363 100644 --- a/eeschema/sch_base_frame.h +++ b/eeschema/sch_base_frame.h @@ -50,7 +50,7 @@ namespace KIGFX class PAGE_INFO; class TITLE_BLOCK; -class LIB_VIEW_FRAME; +class SYMBOL_VIEWER_FRAME; class SYMBOL_EDIT_FRAME; class LIB_PART; class PART_LIB; @@ -80,7 +80,7 @@ LIB_PART* SchGetLibPart( const LIB_ID& aLibId, SYMBOL_LIB_TABLE* aLibTable, /** * A shim class between EDA_DRAW_FRAME and several derived classes: - * SYMBOL_EDIT_FRAME, LIB_VIEW_FRAME, and SCH_EDIT_FRAME, and it brings in a + * SYMBOL_EDIT_FRAME, SYMBOL_VIEWER_FRAME, and SCH_EDIT_FRAME, and it brings in a * common way of handling the provided virtual functions for the derived classes. * * The motivation here is to switch onto GetScreen() for the underlying data model. diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index e03b5c2f4f..84d34a5a74 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include #include @@ -600,12 +600,12 @@ bool SCH_EDIT_FRAME::canCloseWindow( wxCloseEvent& aEvent ) if( symbolEditor && !symbolEditor->Close() ) // Can close symbol editor? return false; - auto* symbolViewer = (LIB_VIEW_FRAME*) Kiway().Player( FRAME_SCH_VIEWER, false ); + auto* symbolViewer = (SYMBOL_VIEWER_FRAME*) Kiway().Player( FRAME_SCH_VIEWER, false ); if( symbolViewer && !symbolViewer->Close() ) // Can close symbol viewer? return false; - symbolViewer = (LIB_VIEW_FRAME*) Kiway().Player( FRAME_SCH_VIEWER_MODAL, false ); + symbolViewer = (SYMBOL_VIEWER_FRAME*) Kiway().Player( FRAME_SCH_VIEWER_MODAL, false ); if( symbolViewer && !symbolViewer->Close() ) // Can close modal symbol viewer? return false; diff --git a/eeschema/lib_view_frame.cpp b/eeschema/symbol_viewer_frame.cpp similarity index 87% rename from eeschema/lib_view_frame.cpp rename to eeschema/symbol_viewer_frame.cpp index 0e640f3f33..3f7e3b3f38 100644 --- a/eeschema/lib_view_frame.cpp +++ b/eeschema/symbol_viewer_frame.cpp @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include @@ -57,34 +57,34 @@ #include // Save previous component library viewer state. -wxString LIB_VIEW_FRAME::m_libraryName; -wxString LIB_VIEW_FRAME::m_entryName; +wxString SYMBOL_VIEWER_FRAME::m_libraryName; +wxString SYMBOL_VIEWER_FRAME::m_entryName; -int LIB_VIEW_FRAME::m_unit = 1; -int LIB_VIEW_FRAME::m_convert = 1; +int SYMBOL_VIEWER_FRAME::m_unit = 1; +int SYMBOL_VIEWER_FRAME::m_convert = 1; -BEGIN_EVENT_TABLE( LIB_VIEW_FRAME, EDA_DRAW_FRAME ) +BEGIN_EVENT_TABLE( SYMBOL_VIEWER_FRAME, EDA_DRAW_FRAME ) // Window events - EVT_SIZE( LIB_VIEW_FRAME::OnSize ) - EVT_ACTIVATE( LIB_VIEW_FRAME::OnActivate ) + EVT_SIZE( SYMBOL_VIEWER_FRAME::OnSize ) + EVT_ACTIVATE( SYMBOL_VIEWER_FRAME::OnActivate ) // Toolbar events - EVT_TOOL( ID_LIBVIEW_SELECT_PART, LIB_VIEW_FRAME::OnSelectSymbol ) - EVT_TOOL( ID_LIBVIEW_NEXT, LIB_VIEW_FRAME::onSelectNextSymbol ) - EVT_TOOL( ID_LIBVIEW_PREVIOUS, LIB_VIEW_FRAME::onSelectPreviousSymbol ) - EVT_CHOICE( ID_LIBVIEW_SELECT_PART_NUMBER, LIB_VIEW_FRAME::onSelectSymbolUnit ) + EVT_TOOL( ID_LIBVIEW_SELECT_PART, SYMBOL_VIEWER_FRAME::OnSelectSymbol ) + EVT_TOOL( ID_LIBVIEW_NEXT, SYMBOL_VIEWER_FRAME::onSelectNextSymbol ) + EVT_TOOL( ID_LIBVIEW_PREVIOUS, SYMBOL_VIEWER_FRAME::onSelectPreviousSymbol ) + EVT_CHOICE( ID_LIBVIEW_SELECT_PART_NUMBER, SYMBOL_VIEWER_FRAME::onSelectSymbolUnit ) // listbox events - EVT_LISTBOX( ID_LIBVIEW_LIB_LIST, LIB_VIEW_FRAME::ClickOnLibList ) - EVT_LISTBOX( ID_LIBVIEW_CMP_LIST, LIB_VIEW_FRAME::ClickOnCmpList ) - EVT_LISTBOX_DCLICK( ID_LIBVIEW_CMP_LIST, LIB_VIEW_FRAME::DClickOnCmpList ) + EVT_LISTBOX( ID_LIBVIEW_LIB_LIST, SYMBOL_VIEWER_FRAME::ClickOnLibList ) + EVT_LISTBOX( ID_LIBVIEW_CMP_LIST, SYMBOL_VIEWER_FRAME::ClickOnCmpList ) + EVT_LISTBOX_DCLICK( ID_LIBVIEW_CMP_LIST, SYMBOL_VIEWER_FRAME::DClickOnCmpList ) // Menu (and/or hotkey) events - EVT_MENU( wxID_CLOSE, LIB_VIEW_FRAME::CloseLibraryViewer ) + EVT_MENU( wxID_CLOSE, SYMBOL_VIEWER_FRAME::CloseLibraryViewer ) EVT_MENU( ID_GRID_SETTINGS, SCH_BASE_FRAME::OnGridSettings ) - EVT_UPDATE_UI( ID_LIBVIEW_SELECT_PART_NUMBER, LIB_VIEW_FRAME::onUpdateUnitChoice ) + EVT_UPDATE_UI( ID_LIBVIEW_SELECT_PART_NUMBER, SYMBOL_VIEWER_FRAME::onUpdateUnitChoice ) END_EVENT_TABLE() @@ -96,8 +96,8 @@ END_EVENT_TABLE() #define LIB_VIEW_STYLE_MODAL ( KICAD_DEFAULT_DRAWFRAME_STYLE | wxFRAME_FLOAT_ON_PARENT ) -LIB_VIEW_FRAME::LIB_VIEW_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrameType, - const wxString& aLibraryName ) : +SYMBOL_VIEWER_FRAME::SYMBOL_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrameType, + const wxString& aLibraryName ) : SCH_BASE_FRAME( aKiway, aParent, aFrameType, _( "Symbol Library Browser" ), wxDefaultPosition, wxDefaultSize, aFrameType == FRAME_SCH_VIEWER_MODAL ? LIB_VIEW_STYLE_MODAL : LIB_VIEW_STYLE, @@ -210,7 +210,7 @@ LIB_VIEW_FRAME::LIB_VIEW_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrame } -LIB_VIEW_FRAME::~LIB_VIEW_FRAME() +SYMBOL_VIEWER_FRAME::~SYMBOL_VIEWER_FRAME() { // Shutdown all running tools if( m_toolManager ) @@ -221,7 +221,7 @@ LIB_VIEW_FRAME::~LIB_VIEW_FRAME() } -void LIB_VIEW_FRAME::setupTools() +void SYMBOL_VIEWER_FRAME::setupTools() { // Create the manager and dispatcher & route draw panel events to the dispatcher m_toolManager = new TOOL_MANAGER; @@ -248,7 +248,7 @@ void LIB_VIEW_FRAME::setupTools() } -void LIB_VIEW_FRAME::setupUIConditions() +void SYMBOL_VIEWER_FRAME::setupUIConditions() { SCH_BASE_FRAME::setupUIConditions(); @@ -309,7 +309,7 @@ void LIB_VIEW_FRAME::setupUIConditions() } -void LIB_VIEW_FRAME::SetUnitAndConvert( int aUnit, int aConvert ) +void SYMBOL_VIEWER_FRAME::SetUnitAndConvert( int aUnit, int aConvert ) { m_unit = aUnit > 0 ? aUnit : 1; m_convert = aConvert > 0 ? aConvert : LIB_ITEM::LIB_CONVERT::BASE; @@ -319,7 +319,7 @@ void LIB_VIEW_FRAME::SetUnitAndConvert( int aUnit, int aConvert ) } -LIB_PART* LIB_VIEW_FRAME::GetSelectedSymbol() const +LIB_PART* SYMBOL_VIEWER_FRAME::GetSelectedSymbol() const { LIB_PART* symbol = nullptr; @@ -330,7 +330,7 @@ LIB_PART* LIB_VIEW_FRAME::GetSelectedSymbol() const } -void LIB_VIEW_FRAME::updatePreviewSymbol() +void SYMBOL_VIEWER_FRAME::updatePreviewSymbol() { LIB_PART* symbol = GetSelectedSymbol(); KIGFX::SCH_VIEW* view = GetCanvas()->GetView(); @@ -367,7 +367,7 @@ void LIB_VIEW_FRAME::updatePreviewSymbol() } -bool LIB_VIEW_FRAME::ShowModal( wxString* aSymbol, wxWindow* aParent ) +bool SYMBOL_VIEWER_FRAME::ShowModal( wxString* aSymbol, wxWindow* aParent ) { if( aSymbol && !aSymbol->IsEmpty() ) { @@ -407,7 +407,7 @@ bool LIB_VIEW_FRAME::ShowModal( wxString* aSymbol, wxWindow* aParent ) } -void LIB_VIEW_FRAME::doCloseWindow() +void SYMBOL_VIEWER_FRAME::doCloseWindow() { GetCanvas()->StopDrawing(); @@ -425,7 +425,7 @@ void LIB_VIEW_FRAME::doCloseWindow() } -void LIB_VIEW_FRAME::OnSize( wxSizeEvent& SizeEv ) +void SYMBOL_VIEWER_FRAME::OnSize( wxSizeEvent& SizeEv ) { if( m_auimgr.GetManagedWindow() ) m_auimgr.Update(); @@ -434,7 +434,7 @@ void LIB_VIEW_FRAME::OnSize( wxSizeEvent& SizeEv ) } -void LIB_VIEW_FRAME::onUpdateUnitChoice( wxUpdateUIEvent& aEvent ) +void SYMBOL_VIEWER_FRAME::onUpdateUnitChoice( wxUpdateUIEvent& aEvent ) { LIB_PART* part = GetSelectedSymbol(); @@ -465,7 +465,7 @@ void LIB_VIEW_FRAME::onUpdateUnitChoice( wxUpdateUIEvent& aEvent ) } -bool LIB_VIEW_FRAME::ReCreateLibList() +bool SYMBOL_VIEWER_FRAME::ReCreateLibList() { if( !m_libList ) return false; @@ -537,7 +537,7 @@ bool LIB_VIEW_FRAME::ReCreateLibList() } -bool LIB_VIEW_FRAME::ReCreateSymbolList() +bool SYMBOL_VIEWER_FRAME::ReCreateSymbolList() { if( m_symbolList == NULL ) return false; @@ -587,7 +587,7 @@ bool LIB_VIEW_FRAME::ReCreateSymbolList() } -void LIB_VIEW_FRAME::ClickOnLibList( wxCommandEvent& event ) +void SYMBOL_VIEWER_FRAME::ClickOnLibList( wxCommandEvent& event ) { int ii = m_libList->GetSelection(); @@ -600,7 +600,7 @@ void LIB_VIEW_FRAME::ClickOnLibList( wxCommandEvent& event ) } -void LIB_VIEW_FRAME::SetSelectedLibrary( const wxString& aLibraryName ) +void SYMBOL_VIEWER_FRAME::SetSelectedLibrary( const wxString& aLibraryName ) { if( m_libraryName == aLibraryName ) return; @@ -623,7 +623,7 @@ void LIB_VIEW_FRAME::SetSelectedLibrary( const wxString& aLibraryName ) } -void LIB_VIEW_FRAME::ClickOnCmpList( wxCommandEvent& event ) +void SYMBOL_VIEWER_FRAME::ClickOnCmpList( wxCommandEvent& event ) { int ii = m_symbolList->GetSelection(); @@ -642,7 +642,7 @@ void LIB_VIEW_FRAME::ClickOnCmpList( wxCommandEvent& event ) } -void LIB_VIEW_FRAME::SetSelectedComponent( const wxString& aComponentName ) +void SYMBOL_VIEWER_FRAME::SetSelectedComponent( const wxString& aComponentName ) { if( m_entryName != aComponentName ) { @@ -667,13 +667,13 @@ void LIB_VIEW_FRAME::SetSelectedComponent( const wxString& aComponentName ) } -void LIB_VIEW_FRAME::DClickOnCmpList( wxCommandEvent& event ) +void SYMBOL_VIEWER_FRAME::DClickOnCmpList( wxCommandEvent& event ) { m_toolManager->RunAction( EE_ACTIONS::addSymbolToSchematic, true ); } -void LIB_VIEW_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg ) +void SYMBOL_VIEWER_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg ) { auto cfg = Pgm().GetSettingsManager().GetAppSettings(); @@ -696,7 +696,7 @@ void LIB_VIEW_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg ) } -void LIB_VIEW_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg) +void SYMBOL_VIEWER_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg) { EESCHEMA_SETTINGS* cfg = Pgm().GetSettingsManager().GetAppSettings(); @@ -713,7 +713,7 @@ void LIB_VIEW_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg) } -WINDOW_SETTINGS* LIB_VIEW_FRAME::GetWindowSettings( APP_SETTINGS_BASE* aCfg ) +WINDOW_SETTINGS* SYMBOL_VIEWER_FRAME::GetWindowSettings( APP_SETTINGS_BASE* aCfg ) { auto cfg = dynamic_cast( aCfg ); wxASSERT( cfg ); @@ -721,7 +721,7 @@ WINDOW_SETTINGS* LIB_VIEW_FRAME::GetWindowSettings( APP_SETTINGS_BASE* aCfg ) } -void LIB_VIEW_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) +void SYMBOL_VIEWER_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) { SCH_BASE_FRAME::CommonSettingsChanged( aEnvVarsChanged, aTextVarsChanged ); @@ -730,7 +730,7 @@ void LIB_VIEW_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVars } -void LIB_VIEW_FRAME::OnActivate( wxActivateEvent& event ) +void SYMBOL_VIEWER_FRAME::OnActivate( wxActivateEvent& event ) { if( event.GetActive() ) { @@ -748,13 +748,13 @@ void LIB_VIEW_FRAME::OnActivate( wxActivateEvent& event ) } -void LIB_VIEW_FRAME::CloseLibraryViewer( wxCommandEvent& event ) +void SYMBOL_VIEWER_FRAME::CloseLibraryViewer( wxCommandEvent& event ) { Close(); } -void LIB_VIEW_FRAME::SetFilter( const SCHLIB_FILTER* aFilter ) +void SYMBOL_VIEWER_FRAME::SetFilter( const SCHLIB_FILTER* aFilter ) { m_listPowerCmpOnly = false; m_allowedLibs.Clear(); @@ -769,7 +769,7 @@ void LIB_VIEW_FRAME::SetFilter( const SCHLIB_FILTER* aFilter ) } -const BOX2I LIB_VIEW_FRAME::GetDocumentExtents( bool aIncludeAllVisible ) const +const BOX2I SYMBOL_VIEWER_FRAME::GetDocumentExtents( bool aIncludeAllVisible ) const { LIB_PART* part = GetSelectedSymbol(); @@ -791,7 +791,7 @@ const BOX2I LIB_VIEW_FRAME::GetDocumentExtents( bool aIncludeAllVisible ) const } -void LIB_VIEW_FRAME::FinishModal() +void SYMBOL_VIEWER_FRAME::FinishModal() { if( m_symbolList->GetSelection() >= 0 ) DismissModal( true, m_libraryName + ':' + m_symbolList->GetStringSelection() ); @@ -802,7 +802,7 @@ void LIB_VIEW_FRAME::FinishModal() } -void LIB_VIEW_FRAME::OnSelectSymbol( wxCommandEvent& aEvent ) +void SYMBOL_VIEWER_FRAME::OnSelectSymbol( wxCommandEvent& aEvent ) { std::unique_lock dialogLock( DIALOG_CHOOSE_SYMBOL::g_Mutex, std::defer_lock ); @@ -846,7 +846,7 @@ void LIB_VIEW_FRAME::OnSelectSymbol( wxCommandEvent& aEvent ) } -void LIB_VIEW_FRAME::onSelectNextSymbol( wxCommandEvent& aEvent ) +void SYMBOL_VIEWER_FRAME::onSelectNextSymbol( wxCommandEvent& aEvent ) { wxCommandEvent evt( wxEVT_COMMAND_LISTBOX_SELECTED, ID_LIBVIEW_CMP_LIST ); int ii = m_symbolList->GetSelection(); @@ -860,7 +860,7 @@ void LIB_VIEW_FRAME::onSelectNextSymbol( wxCommandEvent& aEvent ) } -void LIB_VIEW_FRAME::onSelectPreviousSymbol( wxCommandEvent& aEvent ) +void SYMBOL_VIEWER_FRAME::onSelectPreviousSymbol( wxCommandEvent& aEvent ) { wxCommandEvent evt( wxEVT_COMMAND_LISTBOX_SELECTED, ID_LIBVIEW_CMP_LIST ); int ii = m_symbolList->GetSelection(); @@ -874,7 +874,7 @@ void LIB_VIEW_FRAME::onSelectPreviousSymbol( wxCommandEvent& aEvent ) } -void LIB_VIEW_FRAME::onSelectSymbolUnit( wxCommandEvent& aEvent ) +void SYMBOL_VIEWER_FRAME::onSelectSymbolUnit( wxCommandEvent& aEvent ) { int ii = m_unitChoice->GetSelection(); @@ -887,7 +887,7 @@ void LIB_VIEW_FRAME::onSelectSymbolUnit( wxCommandEvent& aEvent ) } -void LIB_VIEW_FRAME::DisplayLibInfos() +void SYMBOL_VIEWER_FRAME::DisplayLibInfos() { if( m_libList && !m_libList->IsEmpty() && !m_libraryName.IsEmpty() ) { @@ -900,7 +900,7 @@ void LIB_VIEW_FRAME::DisplayLibInfos() } -SELECTION& LIB_VIEW_FRAME::GetCurrentSelection() +SELECTION& SYMBOL_VIEWER_FRAME::GetCurrentSelection() { return m_toolManager->GetTool()->GetSelection(); } diff --git a/eeschema/lib_view_frame.h b/eeschema/symbol_viewer_frame.h similarity index 96% rename from eeschema/lib_view_frame.h rename to eeschema/symbol_viewer_frame.h index e9c8e600e9..a67d95972f 100644 --- a/eeschema/lib_view_frame.h +++ b/eeschema/symbol_viewer_frame.h @@ -40,7 +40,7 @@ class SYMBOL_LIB_TABLE_ROW; /** * Symbol library viewer main window. */ -class LIB_VIEW_FRAME : public SCH_BASE_FRAME +class SYMBOL_VIEWER_FRAME : public SCH_BASE_FRAME { public: @@ -51,10 +51,10 @@ public: * @param aFrameType must be either FRAME_SCH_LIB_VIEWER or FRAME_SCH_LIB_VIEWER_MODAL * @param aLibrary = the library to open when starting (default = NULL) */ - LIB_VIEW_FRAME( KIWAY* aKiway, wxWindow* aParent, - FRAME_T aFrameType, const wxString& aLibraryName = wxEmptyString ); + SYMBOL_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrameType, + const wxString& aLibraryName = wxEmptyString ); - ~LIB_VIEW_FRAME(); + ~SYMBOL_VIEWER_FRAME(); /** * Function ShowModal diff --git a/eeschema/toolbars_lib_view.cpp b/eeschema/toolbars_symbol_viewer.cpp similarity index 94% rename from eeschema/toolbars_lib_view.cpp rename to eeschema/toolbars_symbol_viewer.cpp index 7e6941498d..1e7a9c20cf 100644 --- a/eeschema/toolbars_lib_view.cpp +++ b/eeschema/toolbars_symbol_viewer.cpp @@ -24,7 +24,7 @@ #include #include "class_library.h" #include "eeschema_id.h" -#include "lib_view_frame.h" +#include "symbol_viewer_frame.h" #include "sch_painter.h" #include #include @@ -33,7 +33,7 @@ #include #include -void LIB_VIEW_FRAME::ReCreateHToolbar() +void SYMBOL_VIEWER_FRAME::ReCreateHToolbar() { if( m_mainToolBar ) { @@ -41,8 +41,7 @@ void LIB_VIEW_FRAME::ReCreateHToolbar() } else { - m_mainToolBar = new ACTION_TOOLBAR( this, ID_H_TOOLBAR, - wxDefaultPosition, wxDefaultSize, + m_mainToolBar = new ACTION_TOOLBAR( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize, KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT | wxAUI_TB_HORIZONTAL ); m_mainToolBar->SetAuiManager( &m_auimgr ); } @@ -89,12 +88,12 @@ void LIB_VIEW_FRAME::ReCreateHToolbar() } -void LIB_VIEW_FRAME::ReCreateVToolbar() +void SYMBOL_VIEWER_FRAME::ReCreateVToolbar() { } -void LIB_VIEW_FRAME::ReCreateMenuBar() +void SYMBOL_VIEWER_FRAME::ReCreateMenuBar() { SYMBOL_EDITOR_CONTROL* libControl = m_toolManager->GetTool(); // wxWidgets handles the OSX Application menu behind the scenes, but that means diff --git a/eeschema/tools/ee_inspection_tool.cpp b/eeschema/tools/ee_inspection_tool.cpp index 611142aea5..6d00ae4872 100644 --- a/eeschema/tools/ee_inspection_tool.cpp +++ b/eeschema/tools/ee_inspection_tool.cpp @@ -32,11 +32,10 @@ #include #include #include -#include #include #include #include -#include +#include #include #include #include @@ -394,7 +393,7 @@ int EE_INSPECTION_TOOL::ShowDatasheet( const TOOL_EVENT& aEvent ) } else if( m_frame->IsType( FRAME_SCH_VIEWER ) || m_frame->IsType( FRAME_SCH_VIEWER_MODAL ) ) { - LIB_PART* entry = static_cast( m_frame )->GetSelectedSymbol(); + LIB_PART* entry = static_cast( m_frame )->GetSelectedSymbol(); if( !entry ) return 0; diff --git a/eeschema/tools/ee_selection_tool.cpp b/eeschema/tools/ee_selection_tool.cpp index b603515827..6088621bec 100644 --- a/eeschema/tools/ee_selection_tool.cpp +++ b/eeschema/tools/ee_selection_tool.cpp @@ -31,7 +31,7 @@ #include // For MAX_SELECT_ITEM_IDS #include #include -#include +#include #include #include #include @@ -107,7 +107,7 @@ EE_SELECTION_TOOL::EE_SELECTION_TOOL() : m_skip_heuristics( false ), m_nonModifiedCursor( KICURSOR::ARROW ), m_isSymbolEditor( false ), - m_isLibView( false ), + m_isSymbolViewer( false ), m_unit( 0 ), m_convert( 0 ) { @@ -128,8 +128,8 @@ bool EE_SELECTION_TOOL::Init() { m_frame = getEditFrame(); - LIB_VIEW_FRAME* libViewFrame = dynamic_cast( m_frame ); - SYMBOL_EDIT_FRAME* symbolEditorFrame = dynamic_cast( m_frame ); + SYMBOL_VIEWER_FRAME* symbolViewerFrame = dynamic_cast( m_frame ); + SYMBOL_EDIT_FRAME* symbolEditorFrame = dynamic_cast( m_frame ); if( symbolEditorFrame ) { @@ -139,7 +139,7 @@ bool EE_SELECTION_TOOL::Init() } else { - m_isLibView = libViewFrame != nullptr; + m_isSymbolViewer = symbolViewerFrame != nullptr; } static KICAD_T wireOrBusTypes[] = { SCH_LINE_LOCATE_WIRE_T, SCH_LINE_LOCATE_BUS_T, EOT }; @@ -156,23 +156,24 @@ bool EE_SELECTION_TOOL::Init() auto schEditSheetPageNumberCondition = [this] ( const SELECTION& aSel ) { - return ( !m_isSymbolEditor && !m_isLibView ) && ( E_C::Empty || ( E_C::Count( 1 ) && E_C::OnlyType( SCH_SHEET_T ) ) ); + return !m_isSymbolEditor + && !m_isSymbolViewer + && ( E_C::Empty || ( E_C::Count( 1 ) && E_C::OnlyType( SCH_SHEET_T ) ) ); }; auto schEditCondition = [this] ( const SELECTION& aSel ) { - return !m_isSymbolEditor && !m_isLibView; + return !m_isSymbolEditor && !m_isSymbolViewer; }; auto belowRootSheetCondition = [&]( const SELECTION& aSel ) { - SCH_EDIT_FRAME* schEditFrame = dynamic_cast( m_frame ); + SCH_EDIT_FRAME* editFrame = dynamic_cast( m_frame ); - return ( schEditFrame && - schEditFrame->GetCurrentSheet().Last() != - &schEditFrame->Schematic().Root() ); + return editFrame + && editFrame->GetCurrentSheet().Last() != &editFrame->Schematic().Root(); }; auto havePartCondition = @@ -231,17 +232,17 @@ void EE_SELECTION_TOOL::Reset( RESET_REASON aReason ) m_selection.Clear(); getView()->GetPainter()->GetSettings()->SetHighlight( false ); - SYMBOL_EDIT_FRAME* libEditFrame = dynamic_cast( m_frame ); - LIB_VIEW_FRAME* libViewFrame = dynamic_cast( m_frame ); + SYMBOL_EDIT_FRAME* symbolEditFrame = dynamic_cast( m_frame ); + SYMBOL_VIEWER_FRAME* symbolViewerFrame = dynamic_cast( m_frame ); - if( libEditFrame ) + if( symbolEditFrame ) { m_isSymbolEditor = true; - m_unit = libEditFrame->GetUnit(); - m_convert = libEditFrame->GetConvert(); + m_unit = symbolEditFrame->GetUnit(); + m_convert = symbolEditFrame->GetConvert(); } else - m_isLibView = libViewFrame != nullptr; + m_isSymbolViewer = symbolViewerFrame != nullptr; } else // Restore previous properties of selected items and remove them from containers diff --git a/eeschema/tools/ee_selection_tool.h b/eeschema/tools/ee_selection_tool.h index 8eed0e68d5..d126442883 100644 --- a/eeschema/tools/ee_selection_tool.h +++ b/eeschema/tools/ee_selection_tool.h @@ -294,7 +294,7 @@ private: KICURSOR m_nonModifiedCursor; // Cursor in the absence of shift/ctrl/alt bool m_isSymbolEditor; // True when the symbol editor is the parent frame - bool m_isLibView; // True when libview is the parent frame + bool m_isSymbolViewer; // True when the symbol browser is the parent frame int m_unit; // Fixed unit filter (for symbol editor) int m_convert; // Fixed DeMorgan filter (for symbol editor) }; diff --git a/eeschema/tools/sch_editor_control.cpp b/eeschema/tools/sch_editor_control.cpp index 2ae5927285..465cf097b5 100644 --- a/eeschema/tools/sch_editor_control.cpp +++ b/eeschema/tools/sch_editor_control.cpp @@ -48,7 +48,7 @@ #include #include #include -#include +#include #include #include #include @@ -157,7 +157,7 @@ bool SCH_EDITOR_CONTROL::rescueProject( RESCUER& aRescuer, bool aRunningOnDemand KIWAY_PLAYER* viewer = m_frame->Kiway().Player( FRAME_SCH_VIEWER, false ); if( viewer ) - static_cast( viewer )->ReCreateLibList(); + static_cast( viewer )->ReCreateLibList(); if( aRunningOnDemand ) { diff --git a/eeschema/tools/symbol_editor_control.cpp b/eeschema/tools/symbol_editor_control.cpp index c3a00693cb..f1a063d395 100644 --- a/eeschema/tools/symbol_editor_control.cpp +++ b/eeschema/tools/symbol_editor_control.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include @@ -221,16 +221,16 @@ int SYMBOL_EDITOR_CONTROL::OnDeMorgan( const TOOL_EVENT& aEvent ) m_toolMgr->RunAction( ACTIONS::cancelInteractive, true ); m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); - SYMBOL_EDIT_FRAME* libEditFrame = static_cast( m_frame ); - libEditFrame->SetConvert( convert ); + SYMBOL_EDIT_FRAME* symbolEditor = static_cast( m_frame ); + symbolEditor->SetConvert( convert ); m_toolMgr->ResetTools( TOOL_BASE::MODEL_RELOAD ); - libEditFrame->RebuildView(); + symbolEditor->RebuildView(); } else if( m_frame->IsType( FRAME_SCH_VIEWER ) || m_frame->IsType( FRAME_SCH_VIEWER_MODAL ) ) { - LIB_VIEW_FRAME* libViewFrame = static_cast( m_frame ); - libViewFrame->SetUnitAndConvert( libViewFrame->GetUnit(), convert ); + SYMBOL_VIEWER_FRAME* symbolViewer = static_cast( m_frame ); + symbolViewer->SetUnitAndConvert( symbolViewer->GetUnit(), convert ); } return 0; @@ -414,20 +414,20 @@ int SYMBOL_EDITOR_CONTROL::AddSymbolToSchematic( const TOOL_EVENT& aEvent ) } else { - LIB_VIEW_FRAME* viewFrame = getEditFrame(); + SYMBOL_VIEWER_FRAME* viewerFrame = getEditFrame(); - if( viewFrame->IsModal() ) + if( viewerFrame->IsModal() ) { // if we're modal then we just need to return the symbol selection; the caller is // already in a EE_ACTIONS::placeSymbol coroutine. - viewFrame->FinishModal(); + viewerFrame->FinishModal(); return 0; } else { - part = viewFrame->GetSelectedSymbol(); - unit = viewFrame->GetUnit(); - convert = viewFrame->GetConvert(); + part = viewerFrame->GetSelectedSymbol(); + unit = viewerFrame->GetUnit(); + convert = viewerFrame->GetConvert(); if( part ) libId = part->GetLibId();