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
a55d2580
Commit
a55d2580
authored
Apr 01, 2014
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Activation of any drawing/placement tool clears current selection.
parent
1fa49ce7
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
15 deletions
+23
-15
common_actions.cpp
pcbnew/tools/common_actions.cpp
+2
-2
common_actions.h
pcbnew/tools/common_actions.h
+1
-1
drawing_tool.cpp
pcbnew/tools/drawing_tool.cpp
+19
-11
drawing_tool.h
pcbnew/tools/drawing_tool.h
+1
-1
No files found.
pcbnew/tools/common_actions.cpp
View file @
a55d2580
...
...
@@ -71,7 +71,7 @@ TOOL_ACTION COMMON_ACTIONS::drawArc( "pcbnew.InteractiveDrawing.arc",
AS_GLOBAL
,
0
,
"Draw an arc"
,
"Draw an arc"
);
TOOL_ACTION
COMMON_ACTIONS
::
draw
Text
(
"pcbnew.InteractiveDrawing.text"
,
TOOL_ACTION
COMMON_ACTIONS
::
place
Text
(
"pcbnew.InteractiveDrawing.text"
,
AS_GLOBAL
,
0
,
"Add a text"
,
"Add a text"
);
...
...
@@ -281,7 +281,7 @@ std::string COMMON_ACTIONS::TranslateLegacyId( int aId )
return
COMMON_ACTIONS
::
drawArc
.
GetName
();
case
ID_PCB_ADD_TEXT_BUTT
:
return
COMMON_ACTIONS
::
draw
Text
.
GetName
();
return
COMMON_ACTIONS
::
place
Text
.
GetName
();
case
ID_PCB_DIMENSION_BUTT
:
return
COMMON_ACTIONS
::
drawDimension
.
GetName
();
...
...
pcbnew/tools/common_actions.h
View file @
a55d2580
...
...
@@ -70,7 +70,7 @@ public:
static
TOOL_ACTION
drawArc
;
/// Activation of the drawing tool (text)
static
TOOL_ACTION
draw
Text
;
static
TOOL_ACTION
place
Text
;
/// Activation of the drawing tool (dimension)
static
TOOL_ACTION
drawDimension
;
...
...
pcbnew/tools/drawing_tool.cpp
View file @
a55d2580
...
...
@@ -94,6 +94,7 @@ int DRAWING_TOOL::DrawArc( TOOL_EVENT& aEvent )
KIGFX
::
VIEW_GROUP
preview
(
m_view
);
m_view
->
Add
(
&
preview
);
m_toolMgr
->
RunAction
(
COMMON_ACTIONS
::
selectionClear
);
m_controls
->
ShowCursor
(
true
);
m_controls
->
SetSnapping
(
true
);
...
...
@@ -270,7 +271,7 @@ int DRAWING_TOOL::DrawArc( TOOL_EVENT& aEvent )
}
int
DRAWING_TOOL
::
Draw
Text
(
TOOL_EVENT
&
aEvent
)
int
DRAWING_TOOL
::
Place
Text
(
TOOL_EVENT
&
aEvent
)
{
TEXTE_PCB
*
text
=
NULL
;
...
...
@@ -278,6 +279,7 @@ int DRAWING_TOOL::DrawText( TOOL_EVENT& aEvent )
KIGFX
::
VIEW_GROUP
preview
(
m_view
);
m_view
->
Add
(
&
preview
);
m_toolMgr
->
RunAction
(
COMMON_ACTIONS
::
selectionClear
);
m_controls
->
ShowCursor
(
true
);
m_controls
->
SetSnapping
(
true
);
m_controls
->
SetAutoPan
(
true
);
...
...
@@ -325,6 +327,7 @@ int DRAWING_TOOL::DrawText( TOOL_EVENT& aEvent )
{
// Init the new item attributes
text
=
m_frame
->
CreateTextePcb
(
NULL
);
if
(
text
==
NULL
)
continue
;
...
...
@@ -381,6 +384,7 @@ int DRAWING_TOOL::DrawDimension( TOOL_EVENT& aEvent )
KIGFX
::
VIEW_GROUP
preview
(
m_view
);
m_view
->
Add
(
&
preview
);
m_toolMgr
->
RunAction
(
COMMON_ACTIONS
::
selectionClear
);
m_controls
->
ShowCursor
(
true
);
m_controls
->
SetSnapping
(
true
);
...
...
@@ -571,6 +575,7 @@ int DRAWING_TOOL::PlaceTarget( TOOL_EVENT& aEvent )
m_view
->
Add
(
&
preview
);
preview
.
ViewUpdate
(
KIGFX
::
VIEW_ITEM
::
GEOMETRY
);
m_toolMgr
->
RunAction
(
COMMON_ACTIONS
::
selectionClear
);
m_controls
->
SetSnapping
(
true
);
m_controls
->
SetAutoPan
(
true
);
...
...
@@ -644,6 +649,7 @@ int DRAWING_TOOL::PlaceModule( TOOL_EVENT& aEvent )
KIGFX
::
VIEW_GROUP
preview
(
m_view
);
m_view
->
Add
(
&
preview
);
m_toolMgr
->
RunAction
(
COMMON_ACTIONS
::
selectionClear
);
m_controls
->
ShowCursor
(
true
);
m_controls
->
SetSnapping
(
true
);
m_controls
->
SetAutoPan
(
true
);
...
...
@@ -659,7 +665,7 @@ int DRAWING_TOOL::PlaceModule( TOOL_EVENT& aEvent )
{
if
(
module
)
{
m_board
->
Delete
(
module
);
// it was added by LoadModuleFromLibrary
m_board
->
Delete
(
module
);
// it was added by LoadModuleFromLibrary
()
module
=
NULL
;
preview
.
Clear
();
...
...
@@ -755,6 +761,7 @@ int DRAWING_TOOL::drawSegment( int aShape, bool aContinous )
KIGFX
::
VIEW_GROUP
preview
(
m_view
);
m_view
->
Add
(
&
preview
);
m_toolMgr
->
RunAction
(
COMMON_ACTIONS
::
selectionClear
);
m_controls
->
ShowCursor
(
true
);
m_controls
->
SetSnapping
(
true
);
...
...
@@ -930,6 +937,7 @@ int DRAWING_TOOL::drawZone( bool aKeepout )
KIGFX
::
VIEW_GROUP
preview
(
m_view
);
m_view
->
Add
(
&
preview
);
m_toolMgr
->
RunAction
(
COMMON_ACTIONS
::
selectionClear
);
m_controls
->
ShowCursor
(
true
);
m_controls
->
SetSnapping
(
true
);
...
...
@@ -1152,10 +1160,10 @@ void DRAWING_TOOL::setTransitions()
Go
(
&
DRAWING_TOOL
::
DrawLine
,
COMMON_ACTIONS
::
drawLine
.
MakeEvent
()
);
Go
(
&
DRAWING_TOOL
::
DrawCircle
,
COMMON_ACTIONS
::
drawCircle
.
MakeEvent
()
);
Go
(
&
DRAWING_TOOL
::
DrawArc
,
COMMON_ACTIONS
::
drawArc
.
MakeEvent
()
);
Go
(
&
DRAWING_TOOL
::
DrawText
,
COMMON_ACTIONS
::
drawText
.
MakeEvent
()
);
Go
(
&
DRAWING_TOOL
::
DrawDimension
,
COMMON_ACTIONS
::
drawDimension
.
MakeEvent
()
);
Go
(
&
DRAWING_TOOL
::
DrawZone
,
COMMON_ACTIONS
::
drawZone
.
MakeEvent
()
);
Go
(
&
DRAWING_TOOL
::
DrawKeepout
,
COMMON_ACTIONS
::
drawKeepout
.
MakeEvent
()
);
Go
(
&
DRAWING_TOOL
::
PlaceText
,
COMMON_ACTIONS
::
placeText
.
MakeEvent
()
);
Go
(
&
DRAWING_TOOL
::
PlaceTarget
,
COMMON_ACTIONS
::
placeTarget
.
MakeEvent
()
);
Go
(
&
DRAWING_TOOL
::
PlaceModule
,
COMMON_ACTIONS
::
placeModule
.
MakeEvent
()
);
}
pcbnew/tools/drawing_tool.h
View file @
a55d2580
...
...
@@ -80,7 +80,7 @@ public:
* Displays a dialog that allows to input text and its settings and then lets the user decide
* where to place the text.
*/
int
Draw
Text
(
TOOL_EVENT
&
aEvent
);
int
Place
Text
(
TOOL_EVENT
&
aEvent
);
/**
* Function DrawDimension()
...
...
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