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", ...@@ -73,11 +73,7 @@ TOOL_ACTION COMMON_ACTIONS::drawArc( "pcbnew.InteractiveDrawing.arc",
AS_GLOBAL, 0, AS_GLOBAL, 0,
"Draw an arc", "Draw an arc", AF_ACTIVATE ); "Draw an arc", "Draw an arc", AF_ACTIVATE );
TOOL_ACTION COMMON_ACTIONS::placeTextModule( "pcbnew.InteractiveDrawing.textPcb", TOOL_ACTION COMMON_ACTIONS::placeText( "pcbnew.InteractiveDrawing.text",
AS_GLOBAL, 0,
"Add a text", "Add a text", AF_ACTIVATE );
TOOL_ACTION COMMON_ACTIONS::placeTextPcb( "pcbnew.InteractiveDrawing.textModule",
AS_GLOBAL, 0, AS_GLOBAL, 0,
"Add a text", "Add a text", AF_ACTIVATE ); "Add a text", "Add a text", AF_ACTIVATE );
...@@ -299,10 +295,8 @@ boost::optional<TOOL_EVENT> COMMON_ACTIONS::TranslateLegacyId( int aId ) ...@@ -299,10 +295,8 @@ boost::optional<TOOL_EVENT> COMMON_ACTIONS::TranslateLegacyId( int aId )
return COMMON_ACTIONS::drawArc.MakeEvent(); return COMMON_ACTIONS::drawArc.MakeEvent();
case ID_PCB_ADD_TEXT_BUTT: case ID_PCB_ADD_TEXT_BUTT:
return COMMON_ACTIONS::placeTextPcb.MakeEvent();
case ID_MODEDIT_TEXT_TOOL: case ID_MODEDIT_TEXT_TOOL:
return COMMON_ACTIONS::placeTextModule.MakeEvent(); return COMMON_ACTIONS::placeText.MakeEvent();
case ID_PCB_DIMENSION_BUTT: case ID_PCB_DIMENSION_BUTT:
return COMMON_ACTIONS::drawDimension.MakeEvent(); return COMMON_ACTIONS::drawDimension.MakeEvent();
......
...@@ -73,8 +73,7 @@ public: ...@@ -73,8 +73,7 @@ public:
static TOOL_ACTION drawArc; static TOOL_ACTION drawArc;
/// Activation of the drawing tool (text) /// Activation of the drawing tool (text)
static TOOL_ACTION placeTextPcb; static TOOL_ACTION placeText;
static TOOL_ACTION placeTextModule;
/// Activation of the drawing tool (dimension) /// Activation of the drawing tool (dimension)
static TOOL_ACTION drawDimension; static TOOL_ACTION drawDimension;
......
This diff is collapsed.
...@@ -76,18 +76,11 @@ public: ...@@ -76,18 +76,11 @@ public:
int DrawArc( TOOL_EVENT& aEvent ); 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 * 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 ); int PlaceText( 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 );
/** /**
* Function DrawDimension() * Function DrawDimension()
...@@ -127,6 +120,17 @@ public: ...@@ -127,6 +120,17 @@ public:
*/ */
int PlaceModule( TOOL_EVENT& aEvent ); 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: private:
///> Starts drawing a selected shape (i.e. DRAWSEGMENT). ///> Starts drawing a selected shape (i.e. DRAWSEGMENT).
///> @param aShape is the type of created shape (@see STROKE_T). ///> @param aShape is the type of created shape (@see STROKE_T).
...@@ -147,6 +151,20 @@ private: ...@@ -147,6 +151,20 @@ private:
///> @param aKeepout decides if the drawn polygon is a zone or a keepout area. ///> @param aKeepout decides if the drawn polygon is a zone or a keepout area.
int drawZone( bool aKeepout ); 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 ///> 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 ///> stays the same, the end of the aSegment is modified according to the
///> current cursor position. ///> current cursor position.
...@@ -162,6 +180,9 @@ private: ...@@ -162,6 +180,9 @@ private:
BOARD* m_board; BOARD* m_board;
PCB_EDIT_FRAME* m_frame; PCB_EDIT_FRAME* m_frame;
/// Edit module mode flag
bool m_editModules;
// How does line width change after one -/+ key press. // How does line width change after one -/+ key press.
static const int WIDTH_STEP = 100000; 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