Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
ba320ac7
Commit
ba320ac7
authored
Jul 09, 2014
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added "edit modules" mode for DRAWING_TOOL.
parent
fc44f34a
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
277 additions
and
255 deletions
+277
-255
common_actions.cpp
pcbnew/tools/common_actions.cpp
+2
-8
common_actions.h
pcbnew/tools/common_actions.h
+1
-2
drawing_tool.cpp
pcbnew/tools/drawing_tool.cpp
+243
-235
drawing_tool.h
pcbnew/tools/drawing_tool.h
+31
-10
No files found.
pcbnew/tools/common_actions.cpp
View file @
ba320ac7
...
@@ -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
::
placeText
Module
.
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
();
...
...
pcbnew/tools/common_actions.h
View file @
ba320ac7
...
@@ -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
;
...
...
pcbnew/tools/drawing_tool.cpp
View file @
ba320ac7
This diff is collapsed.
Click to expand it.
pcbnew/tools/drawing_tool.h
View file @
ba320ac7
...
@@ -76,18 +76,11 @@ public:
...
@@ -76,18 +76,11 @@ public:
int
DrawArc
(
TOOL_EVENT
&
aEvent
);
int
DrawArc
(
TOOL_EVENT
&
aEvent
);
/**
/**
* Function PlaceText
Module
()
* 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
;
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment