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
8ee7de09
Commit
8ee7de09
authored
Sep 29, 2007
by
raburton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
set eol-style native on new file
parent
bfb03b8f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
434 additions
and
434 deletions
+434
-434
onleftclick.cpp
pcbnew/onleftclick.cpp
+434
-434
No files found.
pcbnew/onleftclick.cpp
View file @
8ee7de09
/**************************************************************/
/**************************************************************/
/* onleftclick.cpp: */
/* onleftclick.cpp: */
/* function called when the left button is clicked (released) */
/* function called when the left button is clicked (released) */
/* function called when the left button is double clicked */
/* function called when the left button is double clicked */
/**************************************************************/
/**************************************************************/
#include "fctsys.h"
#include "fctsys.h"
#include "gr_basic.h"
#include "gr_basic.h"
#include "common.h"
#include "common.h"
#include "pcbnew.h"
#include "pcbnew.h"
#include "autorout.h"
#include "autorout.h"
#include "id.h"
#include "id.h"
#include "protos.h"
#include "protos.h"
#include "eda_dde.h"
#include "eda_dde.h"
/********************************************************************/
/********************************************************************/
void
WinEDA_PcbFrame
::
OnLeftClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
)
void
WinEDA_PcbFrame
::
OnLeftClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
)
/********************************************************************/
/********************************************************************/
/* Handle the left buttom mouse click, when a tool is active
/* Handle the left buttom mouse click, when a tool is active
*/
*/
{
{
BOARD_ITEM
*
DrawStruct
=
GetCurItem
();
BOARD_ITEM
*
DrawStruct
=
GetCurItem
();
bool
exit
=
false
;
bool
exit
=
false
;
if
(
(
m_ID_current_state
==
0
)
||
(
DrawStruct
&&
DrawStruct
->
m_Flags
)
)
if
(
(
m_ID_current_state
==
0
)
||
(
DrawStruct
&&
DrawStruct
->
m_Flags
)
)
{
{
DrawPanel
->
m_AutoPAN_Request
=
FALSE
;
DrawPanel
->
m_AutoPAN_Request
=
FALSE
;
if
(
DrawStruct
&&
DrawStruct
->
m_Flags
)
// "POPUP" in progress
if
(
DrawStruct
&&
DrawStruct
->
m_Flags
)
// "POPUP" in progress
{
{
DrawPanel
->
m_IgnoreMouseEvents
=
TRUE
;
DrawPanel
->
m_IgnoreMouseEvents
=
TRUE
;
DrawPanel
->
CursorOff
(
DC
);
DrawPanel
->
CursorOff
(
DC
);
switch
(
DrawStruct
->
Type
()
)
switch
(
DrawStruct
->
Type
()
)
{
{
case
TYPETRACK
:
case
TYPETRACK
:
case
TYPEVIA
:
case
TYPEVIA
:
if
(
DrawStruct
->
m_Flags
&
IS_DRAGGED
)
if
(
DrawStruct
->
m_Flags
&
IS_DRAGGED
)
{
{
PlaceDraggedTrackSegment
(
(
TRACK
*
)
DrawStruct
,
DC
);
PlaceDraggedTrackSegment
(
(
TRACK
*
)
DrawStruct
,
DC
);
exit
=
true
;
exit
=
true
;
}
}
break
;
break
;
case
TYPETEXTE
:
case
TYPETEXTE
:
Place_Texte_Pcb
(
(
TEXTE_PCB
*
)
DrawStruct
,
DC
);
Place_Texte_Pcb
(
(
TEXTE_PCB
*
)
DrawStruct
,
DC
);
exit
=
true
;
exit
=
true
;
break
;
break
;
case
TYPETEXTEMODULE
:
case
TYPETEXTEMODULE
:
PlaceTexteModule
(
(
TEXTE_MODULE
*
)
DrawStruct
,
DC
);
PlaceTexteModule
(
(
TEXTE_MODULE
*
)
DrawStruct
,
DC
);
exit
=
true
;
exit
=
true
;
break
;
break
;
case
TYPEPAD
:
case
TYPEPAD
:
PlacePad
(
(
D_PAD
*
)
DrawStruct
,
DC
);
PlacePad
(
(
D_PAD
*
)
DrawStruct
,
DC
);
exit
=
true
;
exit
=
true
;
break
;
break
;
case
TYPEMODULE
:
case
TYPEMODULE
:
Place_Module
(
(
MODULE
*
)
DrawStruct
,
DC
);
Place_Module
(
(
MODULE
*
)
DrawStruct
,
DC
);
exit
=
true
;
exit
=
true
;
break
;
break
;
case
TYPEMIRE
:
case
TYPEMIRE
:
Place_Mire
(
(
MIREPCB
*
)
DrawStruct
,
DC
);
Place_Mire
(
(
MIREPCB
*
)
DrawStruct
,
DC
);
exit
=
true
;
exit
=
true
;
break
;
break
;
case
TYPEDRAWSEGMENT
:
case
TYPEDRAWSEGMENT
:
if
(
m_ID_current_state
==
0
)
if
(
m_ID_current_state
==
0
)
{
{
Place_DrawItem
(
(
DRAWSEGMENT
*
)
DrawStruct
,
DC
);
Place_DrawItem
(
(
DRAWSEGMENT
*
)
DrawStruct
,
DC
);
exit
=
true
;
exit
=
true
;
}
}
break
;
break
;
default
:
default
:
if
(
m_ID_current_state
==
0
)
if
(
m_ID_current_state
==
0
)
{
{
DisplayError
(
this
,
DisplayError
(
this
,
wxT
(
"WinEDA_PcbFrame::OnLeftClick() err: m_Flags != 0"
)
);
wxT
(
"WinEDA_PcbFrame::OnLeftClick() err: m_Flags != 0"
)
);
exit
=
true
;
exit
=
true
;
}
}
break
;
break
;
}
}
DrawPanel
->
m_IgnoreMouseEvents
=
FALSE
;
DrawPanel
->
m_IgnoreMouseEvents
=
FALSE
;
DrawPanel
->
CursorOn
(
DC
);
DrawPanel
->
CursorOn
(
DC
);
if
(
exit
)
return
;
if
(
exit
)
return
;
}
}
else
if
(
!
wxGetKeyState
(
WXK_SHIFT
)
&&
!
wxGetKeyState
(
WXK_ALT
)
&&
else
if
(
!
wxGetKeyState
(
WXK_SHIFT
)
&&
!
wxGetKeyState
(
WXK_ALT
)
&&
!
wxGetKeyState
(
WXK_CONTROL
)
)
!
wxGetKeyState
(
WXK_CONTROL
)
)
{
{
DrawStruct
=
PcbGeneralLocateAndDisplay
();
DrawStruct
=
PcbGeneralLocateAndDisplay
();
if
(
DrawStruct
)
if
(
DrawStruct
)
SendMessageToEESCHEMA
(
DrawStruct
);
SendMessageToEESCHEMA
(
DrawStruct
);
}
}
}
}
switch
(
m_ID_current_state
)
switch
(
m_ID_current_state
)
{
{
case
ID_MAIN_MENUBAR
:
case
ID_MAIN_MENUBAR
:
case
0
:
case
0
:
break
;
break
;
case
ID_NO_SELECT_BUTT
:
case
ID_NO_SELECT_BUTT
:
break
;
break
;
case
ID_PCB_MUWAVE_TOOL_SELF_CMD
:
case
ID_PCB_MUWAVE_TOOL_SELF_CMD
:
case
ID_PCB_MUWAVE_TOOL_GAP_CMD
:
case
ID_PCB_MUWAVE_TOOL_GAP_CMD
:
case
ID_PCB_MUWAVE_TOOL_STUB_CMD
:
case
ID_PCB_MUWAVE_TOOL_STUB_CMD
:
case
ID_PCB_MUWAVE_TOOL_STUB_ARC_CMD
:
case
ID_PCB_MUWAVE_TOOL_STUB_ARC_CMD
:
case
ID_PCB_MUWAVE_TOOL_FUNCTION_SHAPE_CMD
:
case
ID_PCB_MUWAVE_TOOL_FUNCTION_SHAPE_CMD
:
MuWaveCommand
(
DC
,
MousePos
);
MuWaveCommand
(
DC
,
MousePos
);
break
;
break
;
case
ID_PCB_HIGHLIGHT_BUTT
:
case
ID_PCB_HIGHLIGHT_BUTT
:
{
{
int
netcode
=
Select_High_Light
(
DC
);
int
netcode
=
Select_High_Light
(
DC
);
if
(
netcode
<
0
)
if
(
netcode
<
0
)
m_Pcb
->
Display_Infos
(
this
);
m_Pcb
->
Display_Infos
(
this
);
else
else
Affiche_Infos_Equipot
(
netcode
,
this
);
Affiche_Infos_Equipot
(
netcode
,
this
);
}
}
break
;
break
;
case
ID_PCB_SHOW_1_RATSNEST_BUTT
:
case
ID_PCB_SHOW_1_RATSNEST_BUTT
:
#if 0
#if 0
DrawStruct = m_Pcb->FindPadOrModule( GetScreen()->RefPos(true),
DrawStruct = m_Pcb->FindPadOrModule( GetScreen()->RefPos(true),
GetScreen()->m_Active_Layer );
GetScreen()->m_Active_Layer );
#else
#else
DrawStruct
=
PcbGeneralLocateAndDisplay
();
DrawStruct
=
PcbGeneralLocateAndDisplay
();
#endif
#endif
Show_1_Ratsnest
(
DrawStruct
,
DC
);
Show_1_Ratsnest
(
DrawStruct
,
DC
);
if
(
DrawStruct
)
if
(
DrawStruct
)
SendMessageToEESCHEMA
(
DrawStruct
);
SendMessageToEESCHEMA
(
DrawStruct
);
break
;
break
;
case
ID_PCB_MIRE_BUTT
:
case
ID_PCB_MIRE_BUTT
:
if
(
(
DrawStruct
==
NULL
)
||
(
DrawStruct
->
m_Flags
==
0
)
)
if
(
(
DrawStruct
==
NULL
)
||
(
DrawStruct
->
m_Flags
==
0
)
)
{
{
SetCurItem
(
Create_Mire
(
DC
)
);
SetCurItem
(
Create_Mire
(
DC
)
);
DrawPanel
->
MouseToCursorSchema
();
DrawPanel
->
MouseToCursorSchema
();
}
}
else
if
(
DrawStruct
->
Type
()
==
TYPEMIRE
)
else
if
(
DrawStruct
->
Type
()
==
TYPEMIRE
)
{
{
Place_Mire
(
(
MIREPCB
*
)
DrawStruct
,
DC
);
Place_Mire
(
(
MIREPCB
*
)
DrawStruct
,
DC
);
}
}
else
else
DisplayError
(
this
,
wxT
(
"Internal err: Struct not TYPEMIRE"
)
);
DisplayError
(
this
,
wxT
(
"Internal err: Struct not TYPEMIRE"
)
);
break
;
break
;
case
ID_PCB_CIRCLE_BUTT
:
case
ID_PCB_CIRCLE_BUTT
:
case
ID_PCB_ARC_BUTT
:
case
ID_PCB_ARC_BUTT
:
case
ID_LINE_COMMENT_BUTT
:
case
ID_LINE_COMMENT_BUTT
:
{
{
int
shape
=
S_SEGMENT
;
int
shape
=
S_SEGMENT
;
if
(
m_ID_current_state
==
ID_PCB_CIRCLE_BUTT
)
if
(
m_ID_current_state
==
ID_PCB_CIRCLE_BUTT
)
shape
=
S_CIRCLE
;
shape
=
S_CIRCLE
;
if
(
m_ID_current_state
==
ID_PCB_ARC_BUTT
)
if
(
m_ID_current_state
==
ID_PCB_ARC_BUTT
)
shape
=
S_ARC
;
shape
=
S_ARC
;
if
(
GetScreen
()
->
m_Active_Layer
<=
CMP_N
)
if
(
GetScreen
()
->
m_Active_Layer
<=
CMP_N
)
{
{
DisplayError
(
this
,
_
(
"Graphic not autorized on Copper layers"
)
);
DisplayError
(
this
,
_
(
"Graphic not autorized on Copper layers"
)
);
break
;
break
;
}
}
if
(
(
DrawStruct
==
NULL
)
||
(
DrawStruct
->
m_Flags
==
0
)
)
if
(
(
DrawStruct
==
NULL
)
||
(
DrawStruct
->
m_Flags
==
0
)
)
{
{
DrawStruct
=
Begin_DrawSegment
(
NULL
,
shape
,
DC
);
DrawStruct
=
Begin_DrawSegment
(
NULL
,
shape
,
DC
);
SetCurItem
(
DrawStruct
);
SetCurItem
(
DrawStruct
);
DrawPanel
->
m_AutoPAN_Request
=
TRUE
;
DrawPanel
->
m_AutoPAN_Request
=
TRUE
;
}
}
else
if
(
DrawStruct
else
if
(
DrawStruct
&&
(
DrawStruct
->
Type
()
==
TYPEDRAWSEGMENT
)
&&
(
DrawStruct
->
Type
()
==
TYPEDRAWSEGMENT
)
&&
(
DrawStruct
->
m_Flags
&
IS_NEW
)
)
&&
(
DrawStruct
->
m_Flags
&
IS_NEW
)
)
{
{
DrawStruct
=
Begin_DrawSegment
(
(
DRAWSEGMENT
*
)
DrawStruct
,
shape
,
DC
);
DrawStruct
=
Begin_DrawSegment
(
(
DRAWSEGMENT
*
)
DrawStruct
,
shape
,
DC
);
SetCurItem
(
DrawStruct
);
SetCurItem
(
DrawStruct
);
DrawPanel
->
m_AutoPAN_Request
=
TRUE
;
DrawPanel
->
m_AutoPAN_Request
=
TRUE
;
}
}
break
;
break
;
}
}
case
ID_TRACK_BUTT
:
case
ID_TRACK_BUTT
:
if
(
GetScreen
()
->
m_Active_Layer
>
CMP_N
)
if
(
GetScreen
()
->
m_Active_Layer
>
CMP_N
)
{
{
DisplayError
(
this
,
_
(
"Tracks on Copper layers only "
)
);
DisplayError
(
this
,
_
(
"Tracks on Copper layers only "
)
);
break
;
break
;
}
}
if
(
(
DrawStruct
==
NULL
)
||
(
DrawStruct
->
m_Flags
==
0
)
)
if
(
(
DrawStruct
==
NULL
)
||
(
DrawStruct
->
m_Flags
==
0
)
)
{
{
DrawStruct
=
Begin_Route
(
NULL
,
DC
);
DrawStruct
=
Begin_Route
(
NULL
,
DC
);
SetCurItem
(
DrawStruct
);
SetCurItem
(
DrawStruct
);
if
(
DrawStruct
)
if
(
DrawStruct
)
DrawPanel
->
m_AutoPAN_Request
=
TRUE
;
DrawPanel
->
m_AutoPAN_Request
=
TRUE
;
}
}
else
if
(
DrawStruct
&&
else
if
(
DrawStruct
&&
// (DrawStruct->Type() == TYPETRACK) &&
// (DrawStruct->Type() == TYPETRACK) &&
(
DrawStruct
->
m_Flags
&
IS_NEW
)
)
(
DrawStruct
->
m_Flags
&
IS_NEW
)
)
{
{
TRACK
*
track
=
Begin_Route
(
(
TRACK
*
)
DrawStruct
,
DC
);
TRACK
*
track
=
Begin_Route
(
(
TRACK
*
)
DrawStruct
,
DC
);
if
(
track
)
// c'est a dire si OK
if
(
track
)
// c'est a dire si OK
SetCurItem
(
DrawStruct
=
track
);
SetCurItem
(
DrawStruct
=
track
);
DrawPanel
->
m_AutoPAN_Request
=
TRUE
;
DrawPanel
->
m_AutoPAN_Request
=
TRUE
;
}
}
break
;
break
;
case
ID_PCB_ZONES_BUTT
:
case
ID_PCB_ZONES_BUTT
:
if
(
(
DrawStruct
==
NULL
)
||
(
DrawStruct
->
m_Flags
==
0
)
)
if
(
(
DrawStruct
==
NULL
)
||
(
DrawStruct
->
m_Flags
==
0
)
)
{
{
SetCurItem
(
DrawStruct
=
Begin_Zone
()
);
SetCurItem
(
DrawStruct
=
Begin_Zone
()
);
}
}
else
if
(
DrawStruct
else
if
(
DrawStruct
&&
(
DrawStruct
->
Type
()
==
TYPEEDGEZONE
)
&&
(
DrawStruct
->
Type
()
==
TYPEEDGEZONE
)
&&
(
DrawStruct
->
m_Flags
&
IS_NEW
)
)
&&
(
DrawStruct
->
m_Flags
&
IS_NEW
)
)
{
{
SetCurItem
(
DrawStruct
=
Begin_Zone
()
);
SetCurItem
(
DrawStruct
=
Begin_Zone
()
);
}
}
else
else
DisplayError
(
this
,
wxT
(
"Edit: zone internal error"
)
);
DisplayError
(
this
,
wxT
(
"Edit: zone internal error"
)
);
break
;
break
;
case
ID_TEXT_COMMENT_BUTT
:
case
ID_TEXT_COMMENT_BUTT
:
if
(
(
DrawStruct
==
NULL
)
||
(
DrawStruct
->
m_Flags
==
0
)
)
if
(
(
DrawStruct
==
NULL
)
||
(
DrawStruct
->
m_Flags
==
0
)
)
{
{
SetCurItem
(
Create_Texte_Pcb
(
DC
)
);
SetCurItem
(
Create_Texte_Pcb
(
DC
)
);
DrawPanel
->
MouseToCursorSchema
();
DrawPanel
->
MouseToCursorSchema
();
DrawPanel
->
m_AutoPAN_Request
=
TRUE
;
DrawPanel
->
m_AutoPAN_Request
=
TRUE
;
}
}
else
if
(
DrawStruct
->
Type
()
==
TYPETEXTE
)
else
if
(
DrawStruct
->
Type
()
==
TYPETEXTE
)
{
{
Place_Texte_Pcb
(
(
TEXTE_PCB
*
)
DrawStruct
,
DC
);
Place_Texte_Pcb
(
(
TEXTE_PCB
*
)
DrawStruct
,
DC
);
DrawPanel
->
m_AutoPAN_Request
=
FALSE
;
DrawPanel
->
m_AutoPAN_Request
=
FALSE
;
}
}
else
else
DisplayError
(
this
,
wxT
(
"Internal err: Struct not TYPETEXTE"
)
);
DisplayError
(
this
,
wxT
(
"Internal err: Struct not TYPETEXTE"
)
);
break
;
break
;
case
ID_COMPONENT_BUTT
:
case
ID_COMPONENT_BUTT
:
if
(
(
DrawStruct
==
NULL
)
||
(
DrawStruct
->
m_Flags
==
0
)
)
if
(
(
DrawStruct
==
NULL
)
||
(
DrawStruct
->
m_Flags
==
0
)
)
{
{
DrawPanel
->
MouseToCursorSchema
();
DrawPanel
->
MouseToCursorSchema
();
DrawStruct
=
Load_Module_From_Library
(
wxEmptyString
,
DC
);
DrawStruct
=
Load_Module_From_Library
(
wxEmptyString
,
DC
);
SetCurItem
(
DrawStruct
);
SetCurItem
(
DrawStruct
);
if
(
DrawStruct
)
if
(
DrawStruct
)
StartMove_Module
(
(
MODULE
*
)
DrawStruct
,
DC
);
StartMove_Module
(
(
MODULE
*
)
DrawStruct
,
DC
);
}
}
else
if
(
DrawStruct
->
Type
()
==
TYPEMODULE
)
else
if
(
DrawStruct
->
Type
()
==
TYPEMODULE
)
{
{
Place_Module
(
(
MODULE
*
)
DrawStruct
,
DC
);
Place_Module
(
(
MODULE
*
)
DrawStruct
,
DC
);
DrawPanel
->
m_AutoPAN_Request
=
FALSE
;
DrawPanel
->
m_AutoPAN_Request
=
FALSE
;
}
}
else
else
DisplayError
(
this
,
wxT
(
"Internal err: Struct not TYPEMODULE"
)
);
DisplayError
(
this
,
wxT
(
"Internal err: Struct not TYPEMODULE"
)
);
break
;
break
;
case
ID_PCB_COTATION_BUTT
:
case
ID_PCB_COTATION_BUTT
:
if
(
GetScreen
()
->
m_Active_Layer
<=
CMP_N
)
if
(
GetScreen
()
->
m_Active_Layer
<=
CMP_N
)
{
{
DisplayError
(
this
,
_
(
"Cotation not autorized on Copper layers"
)
);
DisplayError
(
this
,
_
(
"Cotation not autorized on Copper layers"
)
);
break
;
break
;
}
}
if
(
(
DrawStruct
==
NULL
)
||
(
DrawStruct
->
m_Flags
==
0
)
)
if
(
(
DrawStruct
==
NULL
)
||
(
DrawStruct
->
m_Flags
==
0
)
)
{
{
DrawStruct
=
Begin_Cotation
(
NULL
,
DC
);
DrawStruct
=
Begin_Cotation
(
NULL
,
DC
);
SetCurItem
(
DrawStruct
);
SetCurItem
(
DrawStruct
);
DrawPanel
->
m_AutoPAN_Request
=
TRUE
;
DrawPanel
->
m_AutoPAN_Request
=
TRUE
;
}
}
else
if
(
DrawStruct
else
if
(
DrawStruct
&&
(
DrawStruct
->
Type
()
==
TYPECOTATION
)
&&
(
DrawStruct
->
Type
()
==
TYPECOTATION
)
&&
(
DrawStruct
->
m_Flags
&
IS_NEW
)
)
&&
(
DrawStruct
->
m_Flags
&
IS_NEW
)
)
{
{
DrawStruct
=
Begin_Cotation
(
(
COTATION
*
)
DrawStruct
,
DC
);
DrawStruct
=
Begin_Cotation
(
(
COTATION
*
)
DrawStruct
,
DC
);
SetCurItem
(
DrawStruct
);
SetCurItem
(
DrawStruct
);
DrawPanel
->
m_AutoPAN_Request
=
TRUE
;
DrawPanel
->
m_AutoPAN_Request
=
TRUE
;
}
}
else
else
DisplayError
(
this
,
wxT
(
"Internal err: Struct not COTATION"
)
);
DisplayError
(
this
,
wxT
(
"Internal err: Struct not COTATION"
)
);
break
;
break
;
case
ID_PCB_DELETE_ITEM_BUTT
:
case
ID_PCB_DELETE_ITEM_BUTT
:
if
(
!
DrawStruct
||
(
DrawStruct
->
m_Flags
==
0
)
)
if
(
!
DrawStruct
||
(
DrawStruct
->
m_Flags
==
0
)
)
{
{
DrawStruct
=
PcbGeneralLocateAndDisplay
();
DrawStruct
=
PcbGeneralLocateAndDisplay
();
if
(
DrawStruct
&&
(
DrawStruct
->
m_Flags
==
0
)
)
if
(
DrawStruct
&&
(
DrawStruct
->
m_Flags
==
0
)
)
{
{
RemoveStruct
(
DrawStruct
,
DC
);
RemoveStruct
(
DrawStruct
,
DC
);
SetCurItem
(
DrawStruct
=
NULL
);
SetCurItem
(
DrawStruct
=
NULL
);
}
}
}
}
break
;
break
;
case
ID_PCB_PLACE_OFFSET_COORD_BUTT
:
case
ID_PCB_PLACE_OFFSET_COORD_BUTT
:
DrawPanel
->
m_Draw_Auxiliary_Axis
(
DC
,
GR_XOR
);
DrawPanel
->
m_Draw_Auxiliary_Axis
(
DC
,
GR_XOR
);
m_Auxiliary_Axis_Position
=
GetScreen
()
->
m_Curseur
;
m_Auxiliary_Axis_Position
=
GetScreen
()
->
m_Curseur
;
DrawPanel
->
m_Draw_Auxiliary_Axis
(
DC
,
GR_COPY
);
DrawPanel
->
m_Draw_Auxiliary_Axis
(
DC
,
GR_COPY
);
GetScreen
()
->
SetModify
();
GetScreen
()
->
SetModify
();
break
;
break
;
default
:
default
:
DrawPanel
->
SetCursor
(
wxCURSOR_ARROW
);
DrawPanel
->
SetCursor
(
wxCURSOR_ARROW
);
DisplayError
(
this
,
wxT
(
"WinEDA_PcbFrame::OnLeftClick() id error"
)
);
DisplayError
(
this
,
wxT
(
"WinEDA_PcbFrame::OnLeftClick() id error"
)
);
SetToolID
(
0
,
wxCURSOR_ARROW
,
wxEmptyString
);
SetToolID
(
0
,
wxCURSOR_ARROW
,
wxEmptyString
);
break
;
break
;
}
}
}
}
/********************************************************************************/
/********************************************************************************/
void
WinEDA_PcbFrame
::
OnLeftDClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
)
void
WinEDA_PcbFrame
::
OnLeftDClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
)
/********************************************************************************/
/********************************************************************************/
/* handle the double click on the mouse left button
/* handle the double click on the mouse left button
*/
*/
{
{
BOARD_ITEM
*
DrawStruct
=
GetCurItem
();
BOARD_ITEM
*
DrawStruct
=
GetCurItem
();
wxPoint
pos
=
GetPosition
();
wxPoint
pos
=
GetPosition
();
wxClientDC
dc
(
DrawPanel
);
wxClientDC
dc
(
DrawPanel
);
DrawPanel
->
PrepareGraphicContext
(
&
dc
);
DrawPanel
->
PrepareGraphicContext
(
&
dc
);
switch
(
m_ID_current_state
)
switch
(
m_ID_current_state
)
{
{
case
0
:
case
0
:
if
(
(
DrawStruct
==
NULL
)
||
(
DrawStruct
->
m_Flags
==
0
)
)
if
(
(
DrawStruct
==
NULL
)
||
(
DrawStruct
->
m_Flags
==
0
)
)
{
{
DrawStruct
=
PcbGeneralLocateAndDisplay
();
DrawStruct
=
PcbGeneralLocateAndDisplay
();
}
}
if
(
(
DrawStruct
==
NULL
)
||
(
DrawStruct
->
m_Flags
!=
0
)
)
if
(
(
DrawStruct
==
NULL
)
||
(
DrawStruct
->
m_Flags
!=
0
)
)
break
;
break
;
SendMessageToEESCHEMA
(
DrawStruct
);
SendMessageToEESCHEMA
(
DrawStruct
);
// An item is found
// An item is found
SetCurItem
(
DrawStruct
);
SetCurItem
(
DrawStruct
);
switch
(
DrawStruct
->
Type
()
)
switch
(
DrawStruct
->
Type
()
)
{
{
case
TYPETRACK
:
case
TYPETRACK
:
case
TYPEVIA
:
case
TYPEVIA
:
if
(
DrawStruct
->
m_Flags
&
IS_NEW
)
if
(
DrawStruct
->
m_Flags
&
IS_NEW
)
{
{
End_Route
(
(
TRACK
*
)
DrawStruct
,
DC
);
End_Route
(
(
TRACK
*
)
DrawStruct
,
DC
);
DrawPanel
->
m_AutoPAN_Request
=
FALSE
;
DrawPanel
->
m_AutoPAN_Request
=
FALSE
;
}
}
else
if
(
DrawStruct
->
m_Flags
==
0
)
else
if
(
DrawStruct
->
m_Flags
==
0
)
{
{
Edit_TrackSegm_Width
(
DC
,
(
TRACK
*
)
DrawStruct
);
Edit_TrackSegm_Width
(
DC
,
(
TRACK
*
)
DrawStruct
);
}
}
break
;
break
;
case
TYPETEXTE
:
case
TYPETEXTE
:
InstallTextPCBOptionsFrame
(
(
TEXTE_PCB
*
)
DrawStruct
,
InstallTextPCBOptionsFrame
(
(
TEXTE_PCB
*
)
DrawStruct
,
DC
,
(
(
TEXTE_PCB
*
)
DrawStruct
)
->
m_Pos
);
DC
,
(
(
TEXTE_PCB
*
)
DrawStruct
)
->
m_Pos
);
DrawPanel
->
MouseToCursorSchema
();
DrawPanel
->
MouseToCursorSchema
();
break
;
break
;
case
TYPEPAD
:
case
TYPEPAD
:
InstallPadOptionsFrame
(
(
D_PAD
*
)
DrawStruct
,
&
dc
,
pos
);
InstallPadOptionsFrame
(
(
D_PAD
*
)
DrawStruct
,
&
dc
,
pos
);
DrawPanel
->
MouseToCursorSchema
();
DrawPanel
->
MouseToCursorSchema
();
break
;
break
;
case
TYPEMODULE
:
case
TYPEMODULE
:
InstallModuleOptionsFrame
(
(
MODULE
*
)
DrawStruct
,
&
dc
,
pos
);
InstallModuleOptionsFrame
(
(
MODULE
*
)
DrawStruct
,
&
dc
,
pos
);
DrawPanel
->
MouseToCursorSchema
();
DrawPanel
->
MouseToCursorSchema
();
break
;
break
;
case
TYPEMIRE
:
case
TYPEMIRE
:
InstallMireOptionsFrame
(
(
MIREPCB
*
)
DrawStruct
,
&
dc
,
pos
);
InstallMireOptionsFrame
(
(
MIREPCB
*
)
DrawStruct
,
&
dc
,
pos
);
DrawPanel
->
MouseToCursorSchema
();
DrawPanel
->
MouseToCursorSchema
();
break
;
break
;
case
TYPETEXTEMODULE
:
case
TYPETEXTEMODULE
:
InstallTextModOptionsFrame
(
(
TEXTE_MODULE
*
)
DrawStruct
,
&
dc
,
pos
);
InstallTextModOptionsFrame
(
(
TEXTE_MODULE
*
)
DrawStruct
,
&
dc
,
pos
);
DrawPanel
->
MouseToCursorSchema
();
DrawPanel
->
MouseToCursorSchema
();
break
;
break
;
case
TYPEDRAWSEGMENT
:
case
TYPEDRAWSEGMENT
:
break
;
break
;
default
:
default
:
break
;
break
;
}
}
break
;
// end case 0
break
;
// end case 0
case
ID_TRACK_BUTT
:
case
ID_TRACK_BUTT
:
if
(
DrawStruct
&&
(
DrawStruct
->
m_Flags
&
IS_NEW
)
)
if
(
DrawStruct
&&
(
DrawStruct
->
m_Flags
&
IS_NEW
)
)
{
{
End_Route
(
(
TRACK
*
)
DrawStruct
,
DC
);
End_Route
(
(
TRACK
*
)
DrawStruct
,
DC
);
DrawPanel
->
m_AutoPAN_Request
=
FALSE
;
DrawPanel
->
m_AutoPAN_Request
=
FALSE
;
}
}
break
;
break
;
case
ID_PCB_ZONES_BUTT
:
case
ID_PCB_ZONES_BUTT
:
End_Zone
(
DC
);
End_Zone
(
DC
);
DrawPanel
->
m_AutoPAN_Request
=
FALSE
;
DrawPanel
->
m_AutoPAN_Request
=
FALSE
;
SetCurItem
(
NULL
);
SetCurItem
(
NULL
);
break
;
break
;
case
ID_LINE_COMMENT_BUTT
:
case
ID_LINE_COMMENT_BUTT
:
case
ID_PCB_ARC_BUTT
:
case
ID_PCB_ARC_BUTT
:
case
ID_PCB_CIRCLE_BUTT
:
case
ID_PCB_CIRCLE_BUTT
:
if
(
DrawStruct
==
NULL
)
if
(
DrawStruct
==
NULL
)
break
;
break
;
if
(
DrawStruct
->
Type
()
!=
TYPEDRAWSEGMENT
)
if
(
DrawStruct
->
Type
()
!=
TYPEDRAWSEGMENT
)
{
{
DisplayError
(
this
,
wxT
(
"DrawStruct Type error"
)
);
DisplayError
(
this
,
wxT
(
"DrawStruct Type error"
)
);
DrawPanel
->
m_AutoPAN_Request
=
FALSE
;
DrawPanel
->
m_AutoPAN_Request
=
FALSE
;
break
;
break
;
}
}
if
(
(
DrawStruct
->
m_Flags
&
IS_NEW
)
)
if
(
(
DrawStruct
->
m_Flags
&
IS_NEW
)
)
{
{
End_Edge
(
(
DRAWSEGMENT
*
)
DrawStruct
,
&
dc
);
End_Edge
(
(
DRAWSEGMENT
*
)
DrawStruct
,
&
dc
);
DrawPanel
->
m_AutoPAN_Request
=
FALSE
;
DrawPanel
->
m_AutoPAN_Request
=
FALSE
;
SetCurItem
(
NULL
);
SetCurItem
(
NULL
);
}
}
break
;
break
;
}
}
}
}
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