diff --git a/common/tool/common_tools.cpp b/common/tool/common_tools.cpp index 3ca8f2f95a..06d01bce58 100644 --- a/common/tool/common_tools.cpp +++ b/common/tool/common_tools.cpp @@ -301,9 +301,7 @@ int COMMON_TOOLS::doZoomFit( ZOOM_FIT_TYPE_T aFitType ) if( aFitType == ZOOM_FIT_OBJECTS ) { if( frame->IsType( FRAME_SCH ) || frame->IsType( FRAME_PCB_EDITOR ) ) - { bBox = m_frame->GetDocumentExtents( false ); - } else aFitType = ZOOM_FIT_ALL; // Just do a "Zoom to Fit" for unsupported editors } diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index e8cd969e97..219301a092 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -331,7 +331,7 @@ set( PCBNEW_CLASS_SRCS tools/edit_tool.cpp tools/global_edit_tool.cpp tools/group_tool.cpp - tools/footprint_editor_tools.cpp + tools/footprint_editor_control.cpp tools/pad_tool.cpp tools/pcb_bright_box.cpp tools/pcb_control.cpp diff --git a/pcbnew/dialogs/dialog_footprint_checker.cpp b/pcbnew/dialogs/dialog_footprint_checker.cpp index 3cd510d1a7..b7a0bc3908 100644 --- a/pcbnew/dialogs/dialog_footprint_checker.cpp +++ b/pcbnew/dialogs/dialog_footprint_checker.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include DIALOG_FOOTPRINT_CHECKER::DIALOG_FOOTPRINT_CHECKER( FOOTPRINT_EDIT_FRAME* aParent ) : @@ -128,7 +128,7 @@ void DIALOG_FOOTPRINT_CHECKER::OnCancelClick( wxCommandEvent& aEvent ) SetReturnCode( wxID_CANCEL ); // Leave the tool to destroy (or not) the dialog - FOOTPRINT_EDITOR_TOOLS* tool = m_frame->GetToolManager()->GetTool(); + FOOTPRINT_EDITOR_CONTROL* tool = m_frame->GetToolManager()->GetTool(); tool->DestroyCheckerDialog(); } diff --git a/pcbnew/footprint_edit_frame.cpp b/pcbnew/footprint_edit_frame.cpp index cf916bc2b7..72f047f7c7 100644 --- a/pcbnew/footprint_edit_frame.cpp +++ b/pcbnew/footprint_edit_frame.cpp @@ -23,7 +23,7 @@ #include "tools/convert_tool.h" #include "tools/drawing_tool.h" #include "tools/edit_tool.h" -#include "tools/footprint_editor_tools.h" +#include "tools/footprint_editor_control.h" #include "tools/pad_tool.h" #include "tools/pcb_actions.h" #include "tools/pcb_control.h" @@ -933,7 +933,7 @@ void FOOTPRINT_EDIT_FRAME::setupTools() m_toolManager->RegisterTool( new DRAWING_TOOL ); m_toolManager->RegisterTool( new POINT_EDITOR ); m_toolManager->RegisterTool( new PCB_CONTROL ); // copy/paste - m_toolManager->RegisterTool( new FOOTPRINT_EDITOR_TOOLS ); + m_toolManager->RegisterTool( new FOOTPRINT_EDITOR_CONTROL ); m_toolManager->RegisterTool( new ALIGN_DISTRIBUTE_TOOL ); m_toolManager->RegisterTool( new PCB_PICKER_TOOL ); m_toolManager->RegisterTool( new POSITION_RELATIVE_TOOL ); diff --git a/pcbnew/fp_tree_synchronizing_adapter.cpp b/pcbnew/fp_tree_synchronizing_adapter.cpp index 1d766d86c8..686e594a9b 100644 --- a/pcbnew/fp_tree_synchronizing_adapter.cpp +++ b/pcbnew/fp_tree_synchronizing_adapter.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include wxObjectDataPtr @@ -52,7 +52,7 @@ FP_TREE_SYNCHRONIZING_ADAPTER::FP_TREE_SYNCHRONIZING_ADAPTER( FOOTPRINT_EDIT_FRA TOOL_INTERACTIVE* FP_TREE_SYNCHRONIZING_ADAPTER::GetContextMenuTool() { - return m_frame->GetToolManager()->GetTool(); + return m_frame->GetToolManager()->GetTool(); } diff --git a/pcbnew/tools/footprint_editor_tools.cpp b/pcbnew/tools/footprint_editor_control.cpp similarity index 77% rename from pcbnew/tools/footprint_editor_tools.cpp rename to pcbnew/tools/footprint_editor_control.cpp index bacb66cd46..1bc62a6fd6 100644 --- a/pcbnew/tools/footprint_editor_tools.cpp +++ b/pcbnew/tools/footprint_editor_control.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2014-2019 CERN - * Copyright (C) 2019 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2019-2020 KiCad Developers, see AUTHORS.txt for contributors. * @author Maciej Suminski * * This program is free software; you can redistribute it and/or @@ -23,7 +23,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "footprint_editor_tools.h" +#include "footprint_editor_control.h" #include "kicad_clipboard.h" #include #include @@ -42,7 +42,7 @@ #include -FOOTPRINT_EDITOR_TOOLS::FOOTPRINT_EDITOR_TOOLS() : +FOOTPRINT_EDITOR_CONTROL::FOOTPRINT_EDITOR_CONTROL() : PCB_TOOL_BASE( "pcbnew.ModuleEditor" ), m_frame( nullptr ), m_checkerDialog( nullptr ) @@ -50,12 +50,12 @@ FOOTPRINT_EDITOR_TOOLS::FOOTPRINT_EDITOR_TOOLS() : } -FOOTPRINT_EDITOR_TOOLS::~FOOTPRINT_EDITOR_TOOLS() +FOOTPRINT_EDITOR_CONTROL::~FOOTPRINT_EDITOR_CONTROL() { } -void FOOTPRINT_EDITOR_TOOLS::Reset( RESET_REASON aReason ) +void FOOTPRINT_EDITOR_CONTROL::Reset( RESET_REASON aReason ) { m_frame = getEditFrame(); @@ -64,7 +64,7 @@ void FOOTPRINT_EDITOR_TOOLS::Reset( RESET_REASON aReason ) } -bool FOOTPRINT_EDITOR_TOOLS::Init() +bool FOOTPRINT_EDITOR_CONTROL::Init() { // Build a context menu for the footprint tree // @@ -131,7 +131,7 @@ bool FOOTPRINT_EDITOR_TOOLS::Init() } -int FOOTPRINT_EDITOR_TOOLS::NewFootprint( const TOOL_EVENT& aEvent ) +int FOOTPRINT_EDITOR_CONTROL::NewFootprint( const TOOL_EVENT& aEvent ) { LIB_ID selected = m_frame->GetTreeFPID(); FOOTPRINT* newFootprint = m_frame->CreateNewFootprint( wxEmptyString ); @@ -172,7 +172,7 @@ int FOOTPRINT_EDITOR_TOOLS::NewFootprint( const TOOL_EVENT& aEvent ) } -int FOOTPRINT_EDITOR_TOOLS::CreateFootprint( const TOOL_EVENT& aEvent ) +int FOOTPRINT_EDITOR_CONTROL::CreateFootprint( const TOOL_EVENT& aEvent ) { LIB_ID selected = m_frame->GetTreeFPID(); @@ -237,7 +237,7 @@ int FOOTPRINT_EDITOR_TOOLS::CreateFootprint( const TOOL_EVENT& aEvent ) } -int FOOTPRINT_EDITOR_TOOLS::Save( const TOOL_EVENT& aEvent ) +int FOOTPRINT_EDITOR_CONTROL::Save( const TOOL_EVENT& aEvent ) { if( !footprint() ) // no loaded footprint return 0; @@ -258,7 +258,7 @@ int FOOTPRINT_EDITOR_TOOLS::Save( const TOOL_EVENT& aEvent ) } -int FOOTPRINT_EDITOR_TOOLS::SaveAs( const TOOL_EVENT& aEvent ) +int FOOTPRINT_EDITOR_CONTROL::SaveAs( const TOOL_EVENT& aEvent ) { if( m_frame->GetTargetFPID().GetLibItemName().empty() ) { @@ -295,14 +295,14 @@ int FOOTPRINT_EDITOR_TOOLS::SaveAs( const TOOL_EVENT& aEvent ) } -int FOOTPRINT_EDITOR_TOOLS::Revert( const TOOL_EVENT& aEvent ) +int FOOTPRINT_EDITOR_CONTROL::Revert( const TOOL_EVENT& aEvent ) { getEditFrame()->RevertFootprint(); return 0; } -int FOOTPRINT_EDITOR_TOOLS::CutCopyFootprint( const TOOL_EVENT& aEvent ) +int FOOTPRINT_EDITOR_CONTROL::CutCopyFootprint( const TOOL_EVENT& aEvent ) { LIB_ID fpID = m_frame->GetTreeFPID(); @@ -318,7 +318,7 @@ int FOOTPRINT_EDITOR_TOOLS::CutCopyFootprint( const TOOL_EVENT& aEvent ) } -int FOOTPRINT_EDITOR_TOOLS::PasteFootprint( const TOOL_EVENT& aEvent ) +int FOOTPRINT_EDITOR_CONTROL::PasteFootprint( const TOOL_EVENT& aEvent ) { if( m_copiedFootprint && !m_frame->GetTreeFPID().GetLibNickname().empty() ) { @@ -339,7 +339,7 @@ int FOOTPRINT_EDITOR_TOOLS::PasteFootprint( const TOOL_EVENT& aEvent ) } -int FOOTPRINT_EDITOR_TOOLS::DeleteFootprint( const TOOL_EVENT& aEvent ) +int FOOTPRINT_EDITOR_CONTROL::DeleteFootprint( const TOOL_EVENT& aEvent ) { FOOTPRINT_EDIT_FRAME* frame = getEditFrame(); @@ -355,7 +355,7 @@ int FOOTPRINT_EDITOR_TOOLS::DeleteFootprint( const TOOL_EVENT& aEvent ) } -int FOOTPRINT_EDITOR_TOOLS::ImportFootprint( const TOOL_EVENT& aEvent ) +int FOOTPRINT_EDITOR_CONTROL::ImportFootprint( const TOOL_EVENT& aEvent ) { if( !m_frame->Clear_Pcb( true ) ) return -1; // this command is aborted @@ -374,7 +374,7 @@ int FOOTPRINT_EDITOR_TOOLS::ImportFootprint( const TOOL_EVENT& aEvent ) } -int FOOTPRINT_EDITOR_TOOLS::ExportFootprint( const TOOL_EVENT& aEvent ) +int FOOTPRINT_EDITOR_CONTROL::ExportFootprint( const TOOL_EVENT& aEvent ) { LIB_ID fpID = m_frame->GetTreeFPID(); FOOTPRINT* fp; @@ -389,14 +389,14 @@ int FOOTPRINT_EDITOR_TOOLS::ExportFootprint( const TOOL_EVENT& aEvent ) } -int FOOTPRINT_EDITOR_TOOLS::EditFootprint( const TOOL_EVENT& aEvent ) +int FOOTPRINT_EDITOR_CONTROL::EditFootprint( const TOOL_EVENT& aEvent ) { m_frame->LoadFootprintFromLibrary( m_frame->GetTreeFPID() ); return 0; } -int FOOTPRINT_EDITOR_TOOLS::PinLibrary( const TOOL_EVENT& aEvent ) +int FOOTPRINT_EDITOR_CONTROL::PinLibrary( const TOOL_EVENT& aEvent ) { LIB_TREE_NODE* currentNode = m_frame->GetCurrentTreeNode(); @@ -410,7 +410,7 @@ int FOOTPRINT_EDITOR_TOOLS::PinLibrary( const TOOL_EVENT& aEvent ) } -int FOOTPRINT_EDITOR_TOOLS::UnpinLibrary( const TOOL_EVENT& aEvent ) +int FOOTPRINT_EDITOR_CONTROL::UnpinLibrary( const TOOL_EVENT& aEvent ) { LIB_TREE_NODE* currentNode = m_frame->GetCurrentTreeNode(); @@ -424,14 +424,14 @@ int FOOTPRINT_EDITOR_TOOLS::UnpinLibrary( const TOOL_EVENT& aEvent ) } -int FOOTPRINT_EDITOR_TOOLS::ToggleFootprintTree( const TOOL_EVENT& aEvent ) +int FOOTPRINT_EDITOR_CONTROL::ToggleFootprintTree( const TOOL_EVENT& aEvent ) { m_frame->ToggleSearchTree(); return 0; } -int FOOTPRINT_EDITOR_TOOLS::Properties( const TOOL_EVENT& aEvent ) +int FOOTPRINT_EDITOR_CONTROL::Properties( const TOOL_EVENT& aEvent ) { FOOTPRINT* footprint = m_frame->GetBoard()->GetFirstFootprint(); @@ -444,14 +444,14 @@ int FOOTPRINT_EDITOR_TOOLS::Properties( const TOOL_EVENT& aEvent ) } -int FOOTPRINT_EDITOR_TOOLS::DefaultPadProperties( const TOOL_EVENT& aEvent ) +int FOOTPRINT_EDITOR_CONTROL::DefaultPadProperties( const TOOL_EVENT& aEvent ) { getEditFrame()->ShowPadPropertiesDialog( nullptr ); return 0; } -int FOOTPRINT_EDITOR_TOOLS::CleanupGraphics( const TOOL_EVENT& aEvent ) +int FOOTPRINT_EDITOR_CONTROL::CleanupGraphics( const TOOL_EVENT& aEvent ) { FOOTPRINT_EDIT_FRAME* editFrame = getEditFrame(); DIALOG_CLEANUP_GRAPHICS dlg( editFrame, true ); @@ -461,7 +461,7 @@ int FOOTPRINT_EDITOR_TOOLS::CleanupGraphics( const TOOL_EVENT& aEvent ) } -int FOOTPRINT_EDITOR_TOOLS::CheckFootprint( const TOOL_EVENT& aEvent ) +int FOOTPRINT_EDITOR_CONTROL::CheckFootprint( const TOOL_EVENT& aEvent ) { if( !m_checkerDialog ) { @@ -478,7 +478,7 @@ int FOOTPRINT_EDITOR_TOOLS::CheckFootprint( const TOOL_EVENT& aEvent ) } -void FOOTPRINT_EDITOR_TOOLS::DestroyCheckerDialog() +void FOOTPRINT_EDITOR_CONTROL::DestroyCheckerDialog() { if( m_checkerDialog ) { @@ -488,33 +488,33 @@ void FOOTPRINT_EDITOR_TOOLS::DestroyCheckerDialog() } -void FOOTPRINT_EDITOR_TOOLS::setTransitions() +void FOOTPRINT_EDITOR_CONTROL::setTransitions() { - Go( &FOOTPRINT_EDITOR_TOOLS::NewFootprint, PCB_ACTIONS::newFootprint.MakeEvent() ); - Go( &FOOTPRINT_EDITOR_TOOLS::CreateFootprint, PCB_ACTIONS::createFootprint.MakeEvent() ); - Go( &FOOTPRINT_EDITOR_TOOLS::Save, ACTIONS::save.MakeEvent() ); - Go( &FOOTPRINT_EDITOR_TOOLS::Save, PCB_ACTIONS::saveToBoard.MakeEvent() ); - Go( &FOOTPRINT_EDITOR_TOOLS::Save, PCB_ACTIONS::saveToLibrary.MakeEvent() ); - Go( &FOOTPRINT_EDITOR_TOOLS::SaveAs, ACTIONS::saveAs.MakeEvent() ); - Go( &FOOTPRINT_EDITOR_TOOLS::SaveAs, ACTIONS::saveCopyAs.MakeEvent() ); - Go( &FOOTPRINT_EDITOR_TOOLS::Revert, ACTIONS::revert.MakeEvent() ); - Go( &FOOTPRINT_EDITOR_TOOLS::DeleteFootprint, PCB_ACTIONS::deleteFootprint.MakeEvent() ); + Go( &FOOTPRINT_EDITOR_CONTROL::NewFootprint, PCB_ACTIONS::newFootprint.MakeEvent() ); + Go( &FOOTPRINT_EDITOR_CONTROL::CreateFootprint, PCB_ACTIONS::createFootprint.MakeEvent() ); + Go( &FOOTPRINT_EDITOR_CONTROL::Save, ACTIONS::save.MakeEvent() ); + Go( &FOOTPRINT_EDITOR_CONTROL::Save, PCB_ACTIONS::saveToBoard.MakeEvent() ); + Go( &FOOTPRINT_EDITOR_CONTROL::Save, PCB_ACTIONS::saveToLibrary.MakeEvent() ); + Go( &FOOTPRINT_EDITOR_CONTROL::SaveAs, ACTIONS::saveAs.MakeEvent() ); + Go( &FOOTPRINT_EDITOR_CONTROL::SaveAs, ACTIONS::saveCopyAs.MakeEvent() ); + Go( &FOOTPRINT_EDITOR_CONTROL::Revert, ACTIONS::revert.MakeEvent() ); + Go( &FOOTPRINT_EDITOR_CONTROL::DeleteFootprint, PCB_ACTIONS::deleteFootprint.MakeEvent() ); - Go( &FOOTPRINT_EDITOR_TOOLS::EditFootprint, PCB_ACTIONS::editFootprint.MakeEvent() ); - Go( &FOOTPRINT_EDITOR_TOOLS::CutCopyFootprint, PCB_ACTIONS::cutFootprint.MakeEvent() ); - Go( &FOOTPRINT_EDITOR_TOOLS::CutCopyFootprint, PCB_ACTIONS::copyFootprint.MakeEvent() ); - Go( &FOOTPRINT_EDITOR_TOOLS::PasteFootprint, PCB_ACTIONS::pasteFootprint.MakeEvent() ); + Go( &FOOTPRINT_EDITOR_CONTROL::EditFootprint, PCB_ACTIONS::editFootprint.MakeEvent() ); + Go( &FOOTPRINT_EDITOR_CONTROL::CutCopyFootprint, PCB_ACTIONS::cutFootprint.MakeEvent() ); + Go( &FOOTPRINT_EDITOR_CONTROL::CutCopyFootprint, PCB_ACTIONS::copyFootprint.MakeEvent() ); + Go( &FOOTPRINT_EDITOR_CONTROL::PasteFootprint, PCB_ACTIONS::pasteFootprint.MakeEvent() ); - Go( &FOOTPRINT_EDITOR_TOOLS::ImportFootprint, PCB_ACTIONS::importFootprint.MakeEvent() ); - Go( &FOOTPRINT_EDITOR_TOOLS::ExportFootprint, PCB_ACTIONS::exportFootprint.MakeEvent() ); + Go( &FOOTPRINT_EDITOR_CONTROL::ImportFootprint, PCB_ACTIONS::importFootprint.MakeEvent() ); + Go( &FOOTPRINT_EDITOR_CONTROL::ExportFootprint, PCB_ACTIONS::exportFootprint.MakeEvent() ); - Go( &FOOTPRINT_EDITOR_TOOLS::CleanupGraphics, PCB_ACTIONS::cleanupGraphics.MakeEvent() ); + Go( &FOOTPRINT_EDITOR_CONTROL::CleanupGraphics, PCB_ACTIONS::cleanupGraphics.MakeEvent() ); - Go( &FOOTPRINT_EDITOR_TOOLS::CheckFootprint, PCB_ACTIONS::checkFootprint.MakeEvent() ); + Go( &FOOTPRINT_EDITOR_CONTROL::CheckFootprint, PCB_ACTIONS::checkFootprint.MakeEvent() ); - Go( &FOOTPRINT_EDITOR_TOOLS::PinLibrary, ACTIONS::pinLibrary.MakeEvent() ); - Go( &FOOTPRINT_EDITOR_TOOLS::UnpinLibrary, ACTIONS::unpinLibrary.MakeEvent() ); - Go( &FOOTPRINT_EDITOR_TOOLS::ToggleFootprintTree, PCB_ACTIONS::toggleFootprintTree.MakeEvent() ); - Go( &FOOTPRINT_EDITOR_TOOLS::Properties, PCB_ACTIONS::footprintProperties.MakeEvent() ); - Go( &FOOTPRINT_EDITOR_TOOLS::DefaultPadProperties, PCB_ACTIONS::defaultPadProperties.MakeEvent() ); + Go( &FOOTPRINT_EDITOR_CONTROL::PinLibrary, ACTIONS::pinLibrary.MakeEvent() ); + Go( &FOOTPRINT_EDITOR_CONTROL::UnpinLibrary, ACTIONS::unpinLibrary.MakeEvent() ); + Go( &FOOTPRINT_EDITOR_CONTROL::ToggleFootprintTree, PCB_ACTIONS::toggleFootprintTree.MakeEvent() ); + Go( &FOOTPRINT_EDITOR_CONTROL::Properties, PCB_ACTIONS::footprintProperties.MakeEvent() ); + Go( &FOOTPRINT_EDITOR_CONTROL::DefaultPadProperties, PCB_ACTIONS::defaultPadProperties.MakeEvent() ); } diff --git a/pcbnew/tools/footprint_editor_tools.h b/pcbnew/tools/footprint_editor_control.h similarity index 91% rename from pcbnew/tools/footprint_editor_tools.h rename to pcbnew/tools/footprint_editor_control.h index 002f137b43..4da28546e1 100644 --- a/pcbnew/tools/footprint_editor_tools.h +++ b/pcbnew/tools/footprint_editor_control.h @@ -22,8 +22,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#ifndef FOOTPRINT_EDITOR_TOOLS_H -#define FOOTPRINT_EDITOR_TOOLS_H +#ifndef FOOTPRINT_EDITOR_CONTROL_H +#define FOOTPRINT_EDITOR_CONTROL_H #include @@ -32,15 +32,15 @@ class FOOTPRINT_EDIT_FRAME; class DIALOG_FOOTPRINT_CHECKER; /** - * FOOTPRINT_EDITOR_TOOLS + * FOOTPRINT_EDITOR_CONTROL * * Module editor specific tools. */ -class FOOTPRINT_EDITOR_TOOLS : public PCB_TOOL_BASE +class FOOTPRINT_EDITOR_CONTROL : public PCB_TOOL_BASE { public: - FOOTPRINT_EDITOR_TOOLS(); - ~FOOTPRINT_EDITOR_TOOLS() override; + FOOTPRINT_EDITOR_CONTROL(); + ~FOOTPRINT_EDITOR_CONTROL() override; /// @copydoc TOOL_INTERACTIVE::Reset() void Reset( RESET_REASON aReason ) override; @@ -89,4 +89,4 @@ private: std::unique_ptr m_copiedFootprint; }; -#endif +#endif // FOOTPRINT_EDITOR_CONTROL_H diff --git a/pcbnew/tools/pcb_actions.cpp b/pcbnew/tools/pcb_actions.cpp index 01f2a3a899..d04243a4bc 100644 --- a/pcbnew/tools/pcb_actions.cpp +++ b/pcbnew/tools/pcb_actions.cpp @@ -315,7 +315,7 @@ TOOL_ACTION PCB_ACTIONS::properties( "pcbnew.InteractiveEdit.properties", config_xpm ); -// FOOTPRINT_EDITOR_TOOLS +// FOOTPRINT_EDITOR_CONTROL // TOOL_ACTION PCB_ACTIONS::toggleFootprintTree( "pcbnew.ModuleEditor.toggleFootprintTree", AS_GLOBAL, 0, "",