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
a93fd711
Commit
a93fd711
authored
Oct 10, 2007
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more pcbnew's onrightclick behavior
parent
b8ae79ed
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
10 deletions
+36
-10
basepcbframe.cpp
pcbnew/basepcbframe.cpp
+16
-2
editrack.cpp
pcbnew/editrack.cpp
+7
-4
onrightclick.cpp
pcbnew/onrightclick.cpp
+13
-4
No files found.
pcbnew/basepcbframe.cpp
View file @
a93fd711
...
@@ -205,13 +205,27 @@ void WinEDA_BasePcbFrame::SetCurItem( BOARD_ITEM* aItem )
...
@@ -205,13 +205,27 @@ void WinEDA_BasePcbFrame::SetCurItem( BOARD_ITEM* aItem )
/*****************************************************************/
/*****************************************************************/
{
{
m_CurrentScreen
->
SetCurItem
(
aItem
);
m_CurrentScreen
->
SetCurItem
(
aItem
);
if
(
aItem
)
if
(
aItem
)
{
aItem
->
Display_Infos
(
this
);
aItem
->
Display_Infos
(
this
);
#if defined(DEBUG)
aItem
->
Show
(
0
,
std
::
cout
);
#endif
}
else
else
{
{
// we can use either of these:
// we can use either of these two:
//MsgPanel->EraseMsgBox();
//MsgPanel->EraseMsgBox();
m_Pcb
->
Display_Infos
(
this
);
m_Pcb
->
Display_Infos
(
this
);
// show the BOARD stuff
#if defined(DEBUG)
std
::
cout
<<
"SetCurItem(NULL)
\n
"
;
#endif
}
}
}
}
...
...
pcbnew/editrack.cpp
View file @
a93fd711
...
@@ -37,28 +37,30 @@ static void Exit_Editrack( WinEDA_DrawPanel* Panel, wxDC* DC )
...
@@ -37,28 +37,30 @@ static void Exit_Editrack( WinEDA_DrawPanel* Panel, wxDC* DC )
*/
*/
{
{
WinEDA_PcbFrame
*
frame
=
(
WinEDA_PcbFrame
*
)
Panel
->
m_Parent
;
WinEDA_PcbFrame
*
frame
=
(
WinEDA_PcbFrame
*
)
Panel
->
m_Parent
;
TRACK
*
track
=
(
TRACK
*
)
frame
->
Get
Screen
()
->
Get
CurItem
();
TRACK
*
track
=
(
TRACK
*
)
frame
->
GetCurItem
();
if
(
track
!=
NULL
)
if
(
track
&&
(
track
->
Type
()
==
TYPEVIA
||
track
->
Type
()
==
TYPETRACK
)
)
{
{
/* Erase the current drawing */
/* Erase the current drawing */
ShowNewTrackWhenMovingCursor
(
Panel
,
DC
,
FALSE
);
ShowNewTrackWhenMovingCursor
(
Panel
,
DC
,
FALSE
);
if
(
g_HightLigt_Status
)
if
(
g_HightLigt_Status
)
frame
->
Hight_Light
(
DC
);
frame
->
Hight_Light
(
DC
);
g_HightLigth_NetCode
=
OldNetCodeSurbrillance
;
g_HightLigth_NetCode
=
OldNetCodeSurbrillance
;
if
(
OldEtatSurbrillance
)
if
(
OldEtatSurbrillance
)
frame
->
Hight_Light
(
DC
);
frame
->
Hight_Light
(
DC
);
frame
->
MsgPanel
->
EraseMsgBox
();
frame
->
MsgPanel
->
EraseMsgBox
();
TRACK
*
previoustrack
;
// Delete current (new) track
// Delete current (new) track
for
(
;
track
!=
NULL
;
track
=
previoustrack
)
TRACK
*
previoustrack
;
for
(
;
track
;
track
=
previoustrack
)
{
{
previoustrack
=
(
TRACK
*
)
track
->
Pback
;
previoustrack
=
(
TRACK
*
)
track
->
Pback
;
delete
track
;
delete
track
;
}
}
}
}
Panel
->
ManageCurseur
=
NULL
;
Panel
->
ManageCurseur
=
NULL
;
Panel
->
ForceCloseManageCurseur
=
NULL
;
Panel
->
ForceCloseManageCurseur
=
NULL
;
frame
->
SetCurItem
(
NULL
);
frame
->
SetCurItem
(
NULL
);
...
@@ -273,6 +275,7 @@ int Add_45_degrees_Segment( WinEDA_BasePcbFrame* frame, wxDC* DC, TRACK* pt_segm
...
@@ -273,6 +275,7 @@ int Add_45_degrees_Segment( WinEDA_BasePcbFrame* frame, wxDC* DC, TRACK* pt_segm
// les segments doivent etre de longueur suffisante:
// les segments doivent etre de longueur suffisante:
if
(
MAX
(
abs
(
dx0
),
abs
(
dy0
)
)
<
(
pas_45
*
2
)
)
if
(
MAX
(
abs
(
dx0
),
abs
(
dy0
)
)
<
(
pas_45
*
2
)
)
return
0
;
return
0
;
if
(
MAX
(
abs
(
dx1
),
abs
(
dy1
)
)
<
(
pas_45
*
2
)
)
if
(
MAX
(
abs
(
dx1
),
abs
(
dy1
)
)
<
(
pas_45
*
2
)
)
return
0
;
return
0
;
...
...
pcbnew/onrightclick.cpp
View file @
a93fd711
...
@@ -13,6 +13,8 @@
...
@@ -13,6 +13,8 @@
#include "id.h"
#include "id.h"
#include "hotkeys.h"
#include "hotkeys.h"
#include "collectors.h"
#include "collectors.h"
#include "protos.h"
/* Bitmaps */
/* Bitmaps */
#include "bitmaps.h"
#include "bitmaps.h"
...
@@ -170,10 +172,17 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
...
@@ -170,10 +172,17 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
PutOnGrid
(
&
selectPos
);
PutOnGrid
(
&
selectPos
);
// printf( "cursor=(%d, %d) select=(%d,%d)\n", cursorPos.x, cursorPos.y, selectPos.x, selectPos.y );
// printf( "cursor=(%d, %d) select=(%d,%d)\n", cursorPos.x, cursorPos.y, selectPos.x, selectPos.y );
// If there is no selected item or the right click happened at a position
/* If not editing a track, and there is no selected item or the right click
// other than where the selection was made
happened at a position other than where the selection was made.
if
(
!
item
||
cursorPos
!=
selectPos
)
We cannot call PcbGeneralLocateAndDisplay() when dragging a track because
editrack.cpp's void Exit_Editrack( WinEDA_DrawPanel* Panel, wxDC* DC )
uses GetCurItem(), thinking it is an aborted track, yet after calling
PcbGeneralLocateAndDisplay(), GetCurItem() is any arbitrary BOARD_ITEM,
not the aborted track.
*/
if
(
ShowNewTrackWhenMovingCursor
!=
DrawPanel
->
ManageCurseur
&&
(
!
item
||
cursorPos
!=
selectPos
)
)
{
{
DrawPanel
->
m_AbortRequest
=
false
;
DrawPanel
->
m_AbortRequest
=
false
;
item
=
PcbGeneralLocateAndDisplay
();
item
=
PcbGeneralLocateAndDisplay
();
...
...
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