Initial version of the drawing tool.

This commit is contained in:
Maciej Suminski 2014-02-06 15:09:38 +01:00
parent 363709e7a9
commit b21ce73c37
5 changed files with 14 additions and 0 deletions

View File

@ -251,6 +251,7 @@ set( PCBNEW_CLASS_SRCS
tools/selection_tool.cpp
tools/selection_area.cpp
tools/bright_box.cpp
tools/drawing_tool.cpp
tools/edit_tool.cpp
tools/pcb_tools.cpp
tools/common_actions.cpp

View File

@ -56,3 +56,7 @@ TOOL_ACTION COMMON_ACTIONS::remove( "pcbnew.InteractiveEdit.remove",
TOOL_ACTION COMMON_ACTIONS::properties( "pcbnew.InteractiveEdit.properties",
AS_GLOBAL, 'E',
"Properties...", "Displays properties window" );
TOOL_ACTION COMMON_ACTIONS::drawingLine( "pcbnew.InteractiveDrawing.line",
AS_GLOBAL, 'D',
"Draw a line", "Draw a line" );

View File

@ -56,4 +56,7 @@ public:
/// Deleting a BOARD_ITEM
static TOOL_ACTION remove;
/// Activation of the drawing tool (line)
static TOOL_ACTION drawingLine;
};

View File

@ -114,6 +114,9 @@ private:
m_updateFlag = aFlag;
}
///> Updates ratsnest for selected items.
///> @param aRedraw says if selected items should be drawn using the simple mode (e.g. one line
///> per item).
void updateRatsnest( bool aRedraw );
///> Returns the right modification point (e.g. for rotation), depending on the number of

View File

@ -36,6 +36,7 @@
#include "selection_tool.h"
#include "edit_tool.h"
#include "drawing_tool.h"
#include "common_actions.h"
#include <router/router_tool.h>
@ -54,11 +55,13 @@ void PCB_EDIT_FRAME::setupTools()
m_toolManager->RegisterAction( &COMMON_ACTIONS::flip );
m_toolManager->RegisterAction( &COMMON_ACTIONS::remove );
m_toolManager->RegisterAction( &COMMON_ACTIONS::properties );
m_toolManager->RegisterAction( &COMMON_ACTIONS::drawingLine );
// Register tools
m_toolManager->RegisterTool( new SELECTION_TOOL );
m_toolManager->RegisterTool( new ROUTER_TOOL );
m_toolManager->RegisterTool( new EDIT_TOOL );
m_toolManager->RegisterTool( new DRAWING_TOOL );
m_toolManager->SetEnvironment( NULL, GetGalCanvas()->GetView(),
GetGalCanvas()->GetViewControls(), this );