tools: moved tools registration outside pcbframe.cpp
This commit is contained in:
parent
4da839f30f
commit
9f0b02268b
|
@ -275,6 +275,7 @@ set( PCBNEW_CLASS_SRCS
|
||||||
tools/module_tools.cpp
|
tools/module_tools.cpp
|
||||||
tools/placement_tool.cpp
|
tools/placement_tool.cpp
|
||||||
tools/common_actions.cpp
|
tools/common_actions.cpp
|
||||||
|
tools/tools_common.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
set( PCBNEW_SRCS ${PCBNEW_AUTOROUTER_SRCS} ${PCBNEW_CLASS_SRCS} ${PCBNEW_DIALOGS} )
|
set( PCBNEW_SRCS ${PCBNEW_AUTOROUTER_SRCS} ${PCBNEW_CLASS_SRCS} ${PCBNEW_DIALOGS} )
|
||||||
|
|
|
@ -68,17 +68,9 @@
|
||||||
|
|
||||||
#include <tool/tool_manager.h>
|
#include <tool/tool_manager.h>
|
||||||
#include <tool/tool_dispatcher.h>
|
#include <tool/tool_dispatcher.h>
|
||||||
|
|
||||||
#include <tools/selection_tool.h>
|
|
||||||
#include <router/router_tool.h>
|
|
||||||
#include <tools/edit_tool.h>
|
|
||||||
#include <tools/drawing_tool.h>
|
|
||||||
#include <tools/point_editor.h>
|
|
||||||
#include <tools/pcbnew_control.h>
|
|
||||||
#include <tools/pcb_editor_control.h>
|
|
||||||
#include <tools/placement_tool.h>
|
|
||||||
#include <tools/common_actions.h>
|
#include <tools/common_actions.h>
|
||||||
|
|
||||||
|
|
||||||
#include <scripting/python_console_frame.h>
|
#include <scripting/python_console_frame.h>
|
||||||
|
|
||||||
#if defined(KICAD_SCRIPTING) || defined(KICAD_SCRIPTING_WXPYTHON)
|
#if defined(KICAD_SCRIPTING) || defined(KICAD_SCRIPTING_WXPYTHON)
|
||||||
|
@ -545,14 +537,8 @@ void PCB_EDIT_FRAME::setupTools()
|
||||||
m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager );
|
m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager );
|
||||||
|
|
||||||
// Register tools
|
// Register tools
|
||||||
m_toolManager->RegisterTool( new SELECTION_TOOL );
|
registerAllTools ( m_toolManager );
|
||||||
m_toolManager->RegisterTool( new ROUTER_TOOL );
|
|
||||||
m_toolManager->RegisterTool( new EDIT_TOOL );
|
|
||||||
m_toolManager->RegisterTool( new DRAWING_TOOL );
|
|
||||||
m_toolManager->RegisterTool( new POINT_EDITOR );
|
|
||||||
m_toolManager->RegisterTool( new PCBNEW_CONTROL );
|
|
||||||
m_toolManager->RegisterTool( new PCB_EDITOR_CONTROL );
|
|
||||||
m_toolManager->RegisterTool( new PLACEMENT_TOOL );
|
|
||||||
m_toolManager->ResetTools( TOOL_BASE::RUN );
|
m_toolManager->ResetTools( TOOL_BASE::RUN );
|
||||||
|
|
||||||
// Run the selection tool, it is supposed to be always active
|
// Run the selection tool, it is supposed to be always active
|
||||||
|
|
|
@ -22,10 +22,14 @@
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef __COMMON_ACTIONS_H
|
||||||
|
#define __COMMON_ACTIONS_H
|
||||||
|
|
||||||
#include <tool/tool_action.h>
|
#include <tool/tool_action.h>
|
||||||
#include <boost/optional.hpp>
|
#include <boost/optional.hpp>
|
||||||
|
|
||||||
class TOOL_EVENT;
|
class TOOL_EVENT;
|
||||||
|
class TOOL_MANAGER;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class COMMON_ACTIONS
|
* Class COMMON_ACTIONS
|
||||||
|
@ -241,3 +245,7 @@ public:
|
||||||
*/
|
*/
|
||||||
static boost::optional<TOOL_EVENT> TranslateLegacyId( int aId );
|
static boost::optional<TOOL_EVENT> TranslateLegacyId( int aId );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void registerAllTools ( TOOL_MANAGER *aToolManager );
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue