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
23b7e766
Commit
23b7e766
authored
Aug 29, 2010
by
Marco Mattila
Committed by
Dick Hollenbeck
Aug 29, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
https://lists.launchpad.net/kicad-developers/msg05245.html
parent
84a009f7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
77 additions
and
23 deletions
+77
-23
edit.cpp
pcbnew/edit.cpp
+77
-3
hotkeys.cpp
pcbnew/hotkeys.cpp
+0
-20
No files found.
pcbnew/edit.cpp
View file @
23b7e766
...
...
@@ -38,6 +38,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
int
itmp
;
INSTALL_DC
(
dc
,
DrawPanel
);
BOARD_ITEM
*
DrawStruct
=
GetCurItem
();
MODULE
*
module
;
DrawPanel
->
CursorOff
(
&
dc
);
...
...
@@ -608,6 +609,15 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
g_Drag_Pistes_On
=
false
;
break
;
}
module
=
(
MODULE
*
)
GetCurItem
();
if
(
module
->
IsLocked
()
)
{
wxString
msg
;
msg
.
Printf
(
_
(
"Footprint %s found, but it is locked"
),
module
->
m_Reference
->
m_Text
.
GetData
()
);
DisplayInfoMessage
(
this
,
msg
);
break
;
}
GetScreen
()
->
m_Curseur
=
((
MODULE
*
)
GetCurItem
())
->
m_Pos
;
DrawPanel
->
MouseToCursorSchema
();
StartMove_Module
(
(
MODULE
*
)
GetCurItem
(),
&
dc
);
...
...
@@ -615,6 +625,15 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
case
ID_POPUP_PCB_GET_AND_MOVE_MODULE_REQUEST
:
/* get module by name and move it */
SetCurItem
(
GetModuleByName
()
);
module
=
(
MODULE
*
)
GetCurItem
();
if
(
module
->
IsLocked
()
)
{
wxString
msg
;
msg
.
Printf
(
_
(
"Footprint %s found, but it is locked"
),
module
->
m_Reference
->
m_Text
.
GetData
()
);
DisplayInfoMessage
(
this
,
msg
);
break
;
}
if
(
GetCurItem
()
)
{
DrawPanel
->
MouseToCursorSchema
();
...
...
@@ -631,6 +650,15 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
if
(
!
GetCurItem
()
||
GetCurItem
()
->
Type
()
!=
TYPE_MODULE
)
break
;
module
=
(
MODULE
*
)
GetCurItem
();
if
(
module
->
IsLocked
()
)
{
wxString
msg
;
msg
.
Printf
(
_
(
"Footprint %s found, but it is locked"
),
module
->
m_Reference
->
m_Text
.
GetData
()
);
DisplayInfoMessage
(
this
,
msg
);
break
;
}
if
(
Delete_Module
(
(
MODULE
*
)
GetCurItem
(),
&
dc
,
true
)
)
{
SetCurItem
(
NULL
);
...
...
@@ -646,7 +674,15 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
if
(
!
GetCurItem
()
||
GetCurItem
()
->
Type
()
!=
TYPE_MODULE
)
break
;
module
=
(
MODULE
*
)
GetCurItem
();
if
(
module
->
IsLocked
()
)
{
wxString
msg
;
msg
.
Printf
(
_
(
"Footprint %s found, but it is locked"
),
module
->
m_Reference
->
m_Text
.
GetData
()
);
DisplayInfoMessage
(
this
,
msg
);
break
;
}
if
(
!
(
GetCurItem
()
->
m_Flags
&
IS_MOVED
)
)
/* This is a simple rotation, no other edition in progress */
SaveCopyInUndoList
(
GetCurItem
(),
UR_ROTATED
,
((
MODULE
*
)
GetCurItem
())
->
m_Pos
);
Rotate_Module
(
&
dc
,
(
MODULE
*
)
GetCurItem
(),
900
,
true
);
...
...
@@ -661,6 +697,15 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
if
(
!
GetCurItem
()
||
GetCurItem
()
->
Type
()
!=
TYPE_MODULE
)
break
;
module
=
(
MODULE
*
)
GetCurItem
();
if
(
module
->
IsLocked
()
)
{
wxString
msg
;
msg
.
Printf
(
_
(
"Footprint %s found, but it is locked"
),
module
->
m_Reference
->
m_Text
.
GetData
()
);
DisplayInfoMessage
(
this
,
msg
);
break
;
}
if
(
!
(
GetCurItem
()
->
m_Flags
&
IS_MOVED
)
)
/* This is a simple rotation, no other edition in progress */
SaveCopyInUndoList
(
GetCurItem
(),
UR_ROTATED_CLOCKWISE
,
((
MODULE
*
)
GetCurItem
())
->
m_Pos
);
Rotate_Module
(
&
dc
,
(
MODULE
*
)
GetCurItem
(),
-
900
,
true
);
...
...
@@ -674,10 +719,17 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
SetCurItem
(
GetCurItem
()
->
GetParent
()
);
if
(
!
GetCurItem
()
||
GetCurItem
()
->
Type
()
!=
TYPE_MODULE
)
break
;
module
=
(
MODULE
*
)
GetCurItem
();
if
(
module
->
IsLocked
()
)
{
wxString
msg
;
msg
.
Printf
(
_
(
"Footprint %s found, but it is locked"
),
module
->
m_Reference
->
m_Text
.
GetData
()
);
DisplayInfoMessage
(
this
,
msg
);
break
;
}
if
(
!
(
GetCurItem
()
->
m_Flags
&
IS_MOVED
)
)
/* This is a simple flip, no other edition in progress */
SaveCopyInUndoList
(
GetCurItem
(),
UR_FLIPPED
,
((
MODULE
*
)
GetCurItem
())
->
m_Pos
);
Change_Side_Module
(
(
MODULE
*
)
GetCurItem
(),
&
dc
);
break
;
...
...
@@ -693,12 +745,34 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
break
;
case
ID_POPUP_PCB_DRAG_PAD_REQUEST
:
module
=
(
MODULE
*
)
GetCurItem
()
->
GetParent
();
if
(
!
module
||
module
->
Type
()
!=
TYPE_MODULE
)
break
;
if
(
module
->
IsLocked
()
)
{
wxString
msg
;
msg
.
Printf
(
_
(
"The parent (%s) of the pad is locked"
),
module
->
m_Reference
->
m_Text
.
GetData
()
);
DisplayInfoMessage
(
this
,
msg
);
break
;
}
g_Drag_Pistes_On
=
true
;
DrawPanel
->
MouseToCursorSchema
();
StartMovePad
(
(
D_PAD
*
)
GetCurItem
(),
&
dc
);
break
;
case
ID_POPUP_PCB_MOVE_PAD_REQUEST
:
module
=
(
MODULE
*
)
GetCurItem
()
->
GetParent
();
if
(
!
module
||
module
->
Type
()
!=
TYPE_MODULE
)
break
;
if
(
module
->
IsLocked
()
)
{
wxString
msg
;
msg
.
Printf
(
_
(
"The parent (%s) of the pad is locked"
),
module
->
m_Reference
->
m_Text
.
GetData
()
);
DisplayInfoMessage
(
this
,
msg
);
break
;
}
g_Drag_Pistes_On
=
false
;
DrawPanel
->
MouseToCursorSchema
();
StartMovePad
(
(
D_PAD
*
)
GetCurItem
(),
&
dc
);
...
...
pcbnew/hotkeys.cpp
View file @
23b7e766
...
...
@@ -945,17 +945,6 @@ bool WinEDA_PcbFrame::OnHotkeyMoveItem( int aIdCommand )
case
TYPE_MODULE
:
{
MODULE
*
module
=
(
MODULE
*
)
item
;
// a footprint is found, but locked or on an other layer
if
(
module
->
IsLocked
()
)
{
wxString
msg
;
msg
.
Printf
(
_
(
"Footprint %s found, but locked"
),
module
->
m_Reference
->
m_Text
.
GetData
()
);
DisplayInfoMessage
(
this
,
msg
);
break
;
}
if
(
aIdCommand
==
HK_MOVE_ITEM
)
evt_type
=
ID_POPUP_PCB_MOVE_MODULE_REQUEST
;
if
(
aIdCommand
==
HK_DRAG_ITEM
)
...
...
@@ -1040,15 +1029,6 @@ bool WinEDA_PcbFrame::OnHotkeyRotateItem( int aIdCommand )
{
case
TYPE_MODULE
:
{
MODULE
*
module
=
(
MODULE
*
)
item
;
if
(
module
->
IsLocked
()
)
{
wxString
msg
;
msg
.
Printf
(
_
(
"Footprint %s is locked"
),
module
->
m_Reference
->
m_Text
.
GetData
()
);
DisplayInfoMessage
(
this
,
msg
);
break
;
}
if
(
aIdCommand
==
HK_ROTATE_ITEM
)
// Rotation
evt_type
=
ID_POPUP_PCB_ROTATE_MODULE_COUNTERCLOCKWISE
;
if
(
aIdCommand
==
HK_FLIP_FOOTPRINT
)
// move to other side
...
...
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