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
0d734e88
Commit
0d734e88
authored
Jun 04, 2014
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Placing the grid origin is possible with GAL.
parent
20f512e5
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
2 deletions
+47
-2
common_actions.cpp
pcbnew/tools/common_actions.cpp
+10
-1
common_actions.h
pcbnew/tools/common_actions.h
+1
-0
pcbnew_control.cpp
pcbnew/tools/pcbnew_control.cpp
+34
-0
pcbnew_control.h
pcbnew/tools/pcbnew_control.h
+1
-0
point_editor.cpp
pcbnew/tools/point_editor.cpp
+1
-1
No files found.
pcbnew/tools/common_actions.cpp
View file @
0d734e88
...
...
@@ -223,6 +223,10 @@ TOOL_ACTION COMMON_ACTIONS::gridPrev( "pcbnew.gridPrev",
AS_GLOBAL
,
MD_CTRL
+
int
(
'`'
),
""
,
""
);
TOOL_ACTION
COMMON_ACTIONS
::
gridSetOrigin
(
"pcbnew.gridSetOrigin"
,
AS_GLOBAL
,
0
,
""
,
""
);
// Track & via size control
TOOL_ACTION
COMMON_ACTIONS
::
trackWidthInc
(
"pcbnew.trackWidthInc"
,
...
...
@@ -241,7 +245,9 @@ TOOL_ACTION COMMON_ACTIONS::viaSizeDec( "pcbnew.viaSizeDec",
AS_GLOBAL
,
'\\'
,
""
,
""
);
TOOL_ACTION
COMMON_ACTIONS
::
trackViaSizeChanged
(
"pcbnew.trackViaSizeChanged"
,
AS_GLOBAL
,
0
,
""
,
""
);
TOOL_ACTION
COMMON_ACTIONS
::
trackViaSizeChanged
(
"pcbnew.trackViaSizeChanged"
,
AS_GLOBAL
,
0
,
""
,
""
);
// Miscellaneous
TOOL_ACTION
COMMON_ACTIONS
::
resetCoords
(
"pcbnew.resetCoords"
,
...
...
@@ -290,6 +296,9 @@ std::string COMMON_ACTIONS::TranslateLegacyId( int aId )
case
ID_PCB_MIRE_BUTT
:
return
COMMON_ACTIONS
::
placeTarget
.
GetName
();
case
ID_PCB_PLACE_GRID_COORD_BUTT
:
return
COMMON_ACTIONS
::
gridSetOrigin
.
GetName
();
}
return
""
;
...
...
pcbnew/tools/common_actions.h
View file @
0d734e88
...
...
@@ -130,6 +130,7 @@ public:
static
TOOL_ACTION
gridFast2
;
static
TOOL_ACTION
gridNext
;
static
TOOL_ACTION
gridPrev
;
static
TOOL_ACTION
gridSetOrigin
;
// Track & via size control
static
TOOL_ACTION
trackWidthInc
;
...
...
pcbnew/tools/pcbnew_control.cpp
View file @
0d734e88
...
...
@@ -412,6 +412,39 @@ int PCBNEW_CONTROL::GridPrev( TOOL_EVENT& aEvent )
}
int
PCBNEW_CONTROL
::
GridSetOrigin
(
TOOL_EVENT
&
aEvent
)
{
Activate
();
getEditFrame
<
PCB_EDIT_FRAME
>
()
->
SetToolID
(
ID_PCB_PLACE_GRID_COORD_BUTT
,
wxCURSOR_PENCIL
,
_
(
"Adjust grid origin"
)
);
KIGFX
::
VIEW_CONTROLS
*
controls
=
getViewControls
();
controls
->
ShowCursor
(
true
);
controls
->
SetSnapping
(
true
);
controls
->
SetAutoPan
(
true
);
while
(
OPT_TOOL_EVENT
evt
=
Wait
()
)
{
if
(
evt
->
IsClick
(
BUT_LEFT
)
)
{
getView
()
->
GetGAL
()
->
SetGridOrigin
(
controls
->
GetCursorPosition
()
);
getView
()
->
MarkDirty
();
}
else
if
(
evt
->
IsCancel
()
)
break
;
}
controls
->
SetAutoPan
(
false
);
controls
->
SetSnapping
(
false
);
controls
->
ShowCursor
(
false
);
setTransitions
();
m_frame
->
SetToolID
(
ID_NO_TOOL_SELECTED
,
wxCURSOR_DEFAULT
,
wxEmptyString
);
return
0
;
}
// Track & via size control
int
PCBNEW_CONTROL
::
TrackWidthInc
(
TOOL_EVENT
&
aEvent
)
{
...
...
@@ -574,6 +607,7 @@ void PCBNEW_CONTROL::setTransitions()
Go
(
&
PCBNEW_CONTROL
::
GridFast2
,
COMMON_ACTIONS
::
gridFast2
.
MakeEvent
()
);
Go
(
&
PCBNEW_CONTROL
::
GridNext
,
COMMON_ACTIONS
::
gridNext
.
MakeEvent
()
);
Go
(
&
PCBNEW_CONTROL
::
GridPrev
,
COMMON_ACTIONS
::
gridPrev
.
MakeEvent
()
);
Go
(
&
PCBNEW_CONTROL
::
GridSetOrigin
,
COMMON_ACTIONS
::
gridSetOrigin
.
MakeEvent
()
);
// Track & via size control
Go
(
&
PCBNEW_CONTROL
::
TrackWidthInc
,
COMMON_ACTIONS
::
trackWidthInc
.
MakeEvent
()
);
...
...
pcbnew/tools/pcbnew_control.h
View file @
0d734e88
...
...
@@ -79,6 +79,7 @@ public:
int
GridFast2
(
TOOL_EVENT
&
aEvent
);
int
GridNext
(
TOOL_EVENT
&
aEvent
);
int
GridPrev
(
TOOL_EVENT
&
aEvent
);
int
GridSetOrigin
(
TOOL_EVENT
&
aEvent
);
// Track & via size control
int
TrackWidthInc
(
TOOL_EVENT
&
aEvent
);
...
...
pcbnew/tools/point_editor.cpp
View file @
0d734e88
...
...
@@ -212,7 +212,7 @@ int POINT_EDITOR::OnSelectionChange( TOOL_EVENT& aEvent )
PCB_EDIT_FRAME
*
editFrame
=
getEditFrame
<
PCB_EDIT_FRAME
>
();
EDA_ITEM
*
item
=
selection
.
items
.
GetPickedItem
(
0
);
m_editPoints
=
EDIT_POINTS_FACTORY
::
Make
(
item
,
m_toolMgr
->
G
etView
()
->
GetGAL
()
);
m_editPoints
=
EDIT_POINTS_FACTORY
::
Make
(
item
,
g
etView
()
->
GetGAL
()
);
if
(
!
m_editPoints
)
{
setTransitions
();
...
...
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