Renamed MODULE_TOOLS to MODULE_EDITOR_TOOLS

This commit is contained in:
Maciej Suminski 2017-01-27 12:07:29 +01:00
parent 498e8b122a
commit 750eed7ff5
4 changed files with 27 additions and 28 deletions

View File

@ -289,7 +289,7 @@ set( PCBNEW_CLASS_SRCS
tools/edit_tool.cpp tools/edit_tool.cpp
tools/pcbnew_control.cpp tools/pcbnew_control.cpp
tools/pcb_editor_control.cpp tools/pcb_editor_control.cpp
tools/module_tools.cpp tools/module_editor_tools.cpp
tools/placement_tool.cpp tools/placement_tool.cpp
tools/common_actions.cpp tools/common_actions.cpp
tools/grid_helper.cpp tools/grid_helper.cpp

View File

@ -64,7 +64,7 @@
#include "tools/drawing_tool.h" #include "tools/drawing_tool.h"
#include "tools/point_editor.h" #include "tools/point_editor.h"
#include "tools/pcbnew_control.h" #include "tools/pcbnew_control.h"
#include "tools/module_tools.h" #include "tools/module_editor_tools.h"
#include "tools/placement_tool.h" #include "tools/placement_tool.h"
#include "tools/picker_tool.h" #include "tools/picker_tool.h"
#include "tools/pad_tool.h" #include "tools/pad_tool.h"
@ -955,11 +955,10 @@ void FOOTPRINT_EDIT_FRAME::setupTools()
m_toolManager->RegisterTool( new DRAWING_TOOL ); m_toolManager->RegisterTool( new DRAWING_TOOL );
m_toolManager->RegisterTool( new POINT_EDITOR ); m_toolManager->RegisterTool( new POINT_EDITOR );
m_toolManager->RegisterTool( new PCBNEW_CONTROL ); m_toolManager->RegisterTool( new PCBNEW_CONTROL );
m_toolManager->RegisterTool( new MODULE_TOOLS ); m_toolManager->RegisterTool( new MODULE_EDITOR_TOOLS );
m_toolManager->RegisterTool( new PLACEMENT_TOOL ); m_toolManager->RegisterTool( new PLACEMENT_TOOL );
m_toolManager->RegisterTool( new PICKER_TOOL ); m_toolManager->RegisterTool( new PICKER_TOOL );
m_toolManager->GetTool<SELECTION_TOOL>()->SetEditModules( true ); m_toolManager->GetTool<SELECTION_TOOL>()->SetEditModules( true );
m_toolManager->GetTool<EDIT_TOOL>()->SetEditModules( true ); m_toolManager->GetTool<EDIT_TOOL>()->SetEditModules( true );
m_toolManager->GetTool<DRAWING_TOOL>()->SetEditModules( true ); m_toolManager->GetTool<DRAWING_TOOL>()->SetEditModules( true );

View File

@ -22,7 +22,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "module_tools.h" #include "module_editor_tools.h"
#include "selection_tool.h" #include "selection_tool.h"
#include "common_actions.h" #include "common_actions.h"
#include <tool/tool_manager.h> #include <tool/tool_manager.h>
@ -49,7 +49,7 @@
using namespace std::placeholders; using namespace std::placeholders;
#include <wx/defs.h> #include <wx/defs.h>
MODULE_TOOLS::MODULE_TOOLS() : MODULE_EDITOR_TOOLS::MODULE_EDITOR_TOOLS() :
TOOL_INTERACTIVE( "pcbnew.ModuleEditor" ), m_view( NULL ), m_controls( NULL ), TOOL_INTERACTIVE( "pcbnew.ModuleEditor" ), m_view( NULL ), m_controls( NULL ),
m_board( NULL ), m_frame( NULL ) m_board( NULL ), m_frame( NULL )
{ {
@ -62,13 +62,13 @@ MODULE_TOOLS::MODULE_TOOLS() :
} }
MODULE_TOOLS::~MODULE_TOOLS() MODULE_EDITOR_TOOLS::~MODULE_EDITOR_TOOLS()
{ {
delete m_axisOrigin; delete m_axisOrigin;
} }
void MODULE_TOOLS::Reset( RESET_REASON aReason ) void MODULE_EDITOR_TOOLS::Reset( RESET_REASON aReason )
{ {
// Init variables used by every drawing tool // Init variables used by every drawing tool
m_view = getView(); m_view = getView();
@ -85,7 +85,7 @@ void MODULE_TOOLS::Reset( RESET_REASON aReason )
} }
bool MODULE_TOOLS::Init() bool MODULE_EDITOR_TOOLS::Init()
{ {
// Find the selection tool, so they can cooperate // Find the selection tool, so they can cooperate
SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<SELECTION_TOOL>(); SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<SELECTION_TOOL>();
@ -102,7 +102,7 @@ bool MODULE_TOOLS::Init()
} }
int MODULE_TOOLS::PlacePad( const TOOL_EVENT& aEvent ) int MODULE_EDITOR_TOOLS::PlacePad( const TOOL_EVENT& aEvent )
{ {
m_frame->SetToolID( ID_MODEDIT_PAD_TOOL, wxCURSOR_PENCIL, _( "Add pads" ) ); m_frame->SetToolID( ID_MODEDIT_PAD_TOOL, wxCURSOR_PENCIL, _( "Add pads" ) );
@ -189,7 +189,7 @@ int MODULE_TOOLS::PlacePad( const TOOL_EVENT& aEvent )
} }
int MODULE_TOOLS::EnumeratePads( const TOOL_EVENT& aEvent ) int MODULE_EDITOR_TOOLS::EnumeratePads( const TOOL_EVENT& aEvent )
{ {
std::list<D_PAD*> pads; std::list<D_PAD*> pads;
std::set<D_PAD*> allPads; std::set<D_PAD*> allPads;
@ -331,7 +331,7 @@ int MODULE_TOOLS::EnumeratePads( const TOOL_EVENT& aEvent )
} }
int MODULE_TOOLS::CopyItems( const TOOL_EVENT& aEvent ) int MODULE_EDITOR_TOOLS::CopyItems( const TOOL_EVENT& aEvent )
{ {
const SELECTION& selection = m_toolMgr->GetTool<SELECTION_TOOL>()->GetSelection(); const SELECTION& selection = m_toolMgr->GetTool<SELECTION_TOOL>()->GetSelection();
@ -401,7 +401,7 @@ int MODULE_TOOLS::CopyItems( const TOOL_EVENT& aEvent )
} }
int MODULE_TOOLS::PasteItems( const TOOL_EVENT& aEvent ) int MODULE_EDITOR_TOOLS::PasteItems( const TOOL_EVENT& aEvent )
{ {
// Parse clipboard // Parse clipboard
PCB_IO io( CTL_FOR_CLIPBOARD ); PCB_IO io( CTL_FOR_CLIPBOARD );
@ -519,7 +519,7 @@ int MODULE_TOOLS::PasteItems( const TOOL_EVENT& aEvent )
} }
int MODULE_TOOLS::ModuleTextOutlines( const TOOL_EVENT& aEvent ) int MODULE_EDITOR_TOOLS::ModuleTextOutlines( const TOOL_EVENT& aEvent )
{ {
KIGFX::VIEW* view = getView(); KIGFX::VIEW* view = getView();
KIGFX::PCB_RENDER_SETTINGS* settings = KIGFX::PCB_RENDER_SETTINGS* settings =
@ -554,7 +554,7 @@ int MODULE_TOOLS::ModuleTextOutlines( const TOOL_EVENT& aEvent )
} }
int MODULE_TOOLS::ModuleEdgeOutlines( const TOOL_EVENT& aEvent ) int MODULE_EDITOR_TOOLS::ModuleEdgeOutlines( const TOOL_EVENT& aEvent )
{ {
KIGFX::VIEW* view = getView(); KIGFX::VIEW* view = getView();
KIGFX::PCB_RENDER_SETTINGS* settings = KIGFX::PCB_RENDER_SETTINGS* settings =
@ -584,12 +584,12 @@ int MODULE_TOOLS::ModuleEdgeOutlines( const TOOL_EVENT& aEvent )
} }
void MODULE_TOOLS::SetTransitions() void MODULE_EDITOR_TOOLS::SetTransitions()
{ {
Go( &MODULE_TOOLS::PlacePad, COMMON_ACTIONS::placePad.MakeEvent() ); Go( &MODULE_EDITOR_TOOLS::PlacePad, COMMON_ACTIONS::placePad.MakeEvent() );
Go( &MODULE_TOOLS::EnumeratePads, COMMON_ACTIONS::enumeratePads.MakeEvent() ); Go( &MODULE_EDITOR_TOOLS::EnumeratePads, COMMON_ACTIONS::enumeratePads.MakeEvent() );
Go( &MODULE_TOOLS::CopyItems, COMMON_ACTIONS::copyItems.MakeEvent() ); Go( &MODULE_EDITOR_TOOLS::CopyItems, COMMON_ACTIONS::copyItems.MakeEvent() );
Go( &MODULE_TOOLS::PasteItems, COMMON_ACTIONS::pasteItems.MakeEvent() ); Go( &MODULE_EDITOR_TOOLS::PasteItems, COMMON_ACTIONS::pasteItems.MakeEvent() );
Go( &MODULE_TOOLS::ModuleTextOutlines, COMMON_ACTIONS::moduleTextOutlines.MakeEvent() ); Go( &MODULE_EDITOR_TOOLS::ModuleTextOutlines, COMMON_ACTIONS::moduleTextOutlines.MakeEvent() );
Go( &MODULE_TOOLS::ModuleEdgeOutlines, COMMON_ACTIONS::moduleEdgeOutlines.MakeEvent() ); Go( &MODULE_EDITOR_TOOLS::ModuleEdgeOutlines, COMMON_ACTIONS::moduleEdgeOutlines.MakeEvent() );
} }

View File

@ -22,8 +22,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#ifndef MODULE_TOOLS_H #ifndef MODULE_EDITOR_TOOLS_H
#define MODULE_TOOLS_H #define MODULE_EDITOR_TOOLS_H
#include <tool/tool_interactive.h> #include <tool/tool_interactive.h>
#include <origin_viewitem.h> #include <origin_viewitem.h>
@ -37,15 +37,15 @@ class BOARD;
class PCB_EDIT_FRAME; class PCB_EDIT_FRAME;
/** /**
* Class MODULE_TOOLS * Class MODULE_EDITOR_TOOLS
* *
* Module editor specific tools. * Module editor specific tools.
*/ */
class MODULE_TOOLS : public TOOL_INTERACTIVE class MODULE_EDITOR_TOOLS : public TOOL_INTERACTIVE
{ {
public: public:
MODULE_TOOLS(); MODULE_EDITOR_TOOLS();
~MODULE_TOOLS(); ~MODULE_EDITOR_TOOLS();
/// @copydoc TOOL_INTERACTIVE::Reset() /// @copydoc TOOL_INTERACTIVE::Reset()
void Reset( RESET_REASON aReason ) override; void Reset( RESET_REASON aReason ) override;