Commit ba320ac7 authored by Maciej Suminski's avatar Maciej Suminski

Added "edit modules" mode for DRAWING_TOOL.

parent fc44f34a
......@@ -73,11 +73,7 @@ TOOL_ACTION COMMON_ACTIONS::drawArc( "pcbnew.InteractiveDrawing.arc",
AS_GLOBAL, 0,
"Draw an arc", "Draw an arc", AF_ACTIVATE );
TOOL_ACTION COMMON_ACTIONS::placeTextModule( "pcbnew.InteractiveDrawing.textPcb",
AS_GLOBAL, 0,
"Add a text", "Add a text", AF_ACTIVATE );
TOOL_ACTION COMMON_ACTIONS::placeTextPcb( "pcbnew.InteractiveDrawing.textModule",
TOOL_ACTION COMMON_ACTIONS::placeText( "pcbnew.InteractiveDrawing.text",
AS_GLOBAL, 0,
"Add a text", "Add a text", AF_ACTIVATE );
......@@ -299,10 +295,8 @@ boost::optional<TOOL_EVENT> COMMON_ACTIONS::TranslateLegacyId( int aId )
return COMMON_ACTIONS::drawArc.MakeEvent();
case ID_PCB_ADD_TEXT_BUTT:
return COMMON_ACTIONS::placeTextPcb.MakeEvent();
case ID_MODEDIT_TEXT_TOOL:
return COMMON_ACTIONS::placeTextModule.MakeEvent();
return COMMON_ACTIONS::placeText.MakeEvent();
case ID_PCB_DIMENSION_BUTT:
return COMMON_ACTIONS::drawDimension.MakeEvent();
......
......@@ -73,8 +73,7 @@ public:
static TOOL_ACTION drawArc;
/// Activation of the drawing tool (text)
static TOOL_ACTION placeTextPcb;
static TOOL_ACTION placeTextModule;
static TOOL_ACTION placeText;
/// Activation of the drawing tool (dimension)
static TOOL_ACTION drawDimension;
......
This diff is collapsed.
......@@ -76,18 +76,11 @@ public:
int DrawArc( TOOL_EVENT& aEvent );
/**
* Function PlaceTextModule()
* Function PlaceText()
* Displays a dialog that allows to input text and its settings and then lets the user decide
* where to place the text in module editor.
* where to place the text in editor.
*/
int PlaceTextModule( TOOL_EVENT& aEvent );
/**
* Function PlaceTextPcb()
* Displays a dialog that allows to input text and its settings and then lets the user decide
* where to place the text in board editor.
*/
int PlaceTextPcb( TOOL_EVENT& aEvent );
int PlaceText( TOOL_EVENT& aEvent );
/**
* Function DrawDimension()
......@@ -127,6 +120,17 @@ public:
*/
int PlaceModule( TOOL_EVENT& aEvent );
/**
* Function EditModules()
* Toggles edit module mode. When enabled, one may select parts of modules individually
* (graphics, pads, etc.), so they can be modified.
* @param aEnabled decides if the mode should be enabled.
*/
void EditModules( bool aEnabled )
{
m_editModules = aEnabled;
}
private:
///> Starts drawing a selected shape (i.e. DRAWSEGMENT).
///> @param aShape is the type of created shape (@see STROKE_T).
......@@ -147,6 +151,20 @@ private:
///> @param aKeepout decides if the drawn polygon is a zone or a keepout area.
int drawZone( bool aKeepout );
/**
* Function placeTextModule()
* Displays a dialog that allows to input text and its settings and then lets the user decide
* where to place the text in module .
*/
int placeTextModule();
/**
* Function placeTextPcb()
* Displays a dialog that allows to input text and its settings and then lets the user decide
* where to place the text in board editor.
*/
int placeTextPcb();
///> Forces a DRAWSEGMENT to be drawn at multiple of 45 degrees. The origin
///> stays the same, the end of the aSegment is modified according to the
///> current cursor position.
......@@ -162,6 +180,9 @@ private:
BOARD* m_board;
PCB_EDIT_FRAME* m_frame;
/// Edit module mode flag
bool m_editModules;
// How does line width change after one -/+ key press.
static const int WIDTH_STEP = 100000;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment