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
10c44291
Commit
10c44291
authored
Sep 27, 2007
by
CHARRAS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test case for OnLeftClick() handling enhancements
parent
e64d8e52
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
23 deletions
+53
-23
change_log.txt
change_log.txt
+9
-0
libs.win
libs.win
+1
-1
class_board_item.cpp
pcbnew/class_board_item.cpp
+14
-3
edit.cpp
pcbnew/edit.cpp
+18
-16
drawpanel.cpp
share/drawpanel.cpp
+11
-3
No files found.
change_log.txt
View file @
10c44291
...
...
@@ -4,6 +4,15 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
email address.
2007-Sep-27 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+ all
test case for OnLeftClick() handling enhancements.
TAB key removed, because is not needed for block selection and double click.
(SHIHT ou CTRL or ALT key is sufficient to suppress the popup menu
if needed for a double click )
Some work is still needed, of course
2007-Sep-26 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
...
...
libs.win
View file @
10c44291
...
...
@@ -17,7 +17,7 @@ KICAD_BIN = /f/kicad/winexe
#Define the wxWidget path (if not found in environment variables):
ifndef WXWIN
WXWIN=f:/wxMSW-2.8.
5
WXWIN=f:/wxMSW-2.8.
6
endif
LIBVERSION = 2.8
...
...
pcbnew/class_board_item.cpp
View file @
10c44291
...
...
@@ -124,7 +124,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
break
;
case
TYPETRACK
:
text
<<
_
(
"Track"
)
<<
wxT
(
" "
)
<<
(
(
TRACK
*
)
item
)
->
m_NetCode
;
text
<<
_
(
"Track"
)
<<
wxT
(
" "
);
net
=
aPcb
->
FindNet
(
(
(
TRACK
*
)
item
)
->
m_NetCode
);
if
(
net
)
{
...
...
@@ -134,7 +134,18 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
break
;
case
TYPEZONE
:
text
<<
_
(
"Zone"
)
<<
_
(
" on "
)
<<
ReturnPcbLayerName
(
item
->
GetLayer
()
);
text
<<
_
(
"Zone"
)
<<
wxT
(
" "
);
{
wxString
TimeStampText
;
TimeStampText
.
Printf
(
wxT
(
"(%8.8X)"
),
item
->
m_TimeStamp
);
text
<<
TimeStampText
;
}
net
=
aPcb
->
FindNet
(
(
(
SEGZONE
*
)
item
)
->
m_NetCode
);
if
(
net
)
{
text
<<
wxT
(
" ["
)
<<
net
->
m_Netname
<<
wxT
(
"]"
);
}
text
<<
_
(
" on "
)
<<
ReturnPcbLayerName
(
item
->
GetLayer
()
);
break
;
case
TYPEVIA
:
...
...
@@ -151,7 +162,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
break
;
case
TYPECOTATION
:
text
<<
_
(
"Dimension"
)
<<
wxT
(
"
\"
"
)
<<
((
COTATION
*
)
item
)
->
GetText
()
<<
wxT
(
"
\"
"
);
text
<<
_
(
"Dimension"
)
<<
wxT
(
"
\"
"
)
<<
(
(
COTATION
*
)
item
)
->
GetText
()
<<
wxT
(
"
\"
"
);
break
;
case
TYPEMIRE
:
...
...
pcbnew/edit.cpp
View file @
10c44291
...
...
@@ -27,15 +27,16 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
*/
{
BOARD_ITEM
*
DrawStruct
=
GetCurItem
();
DrawPanel
->
m_IgnoreMouseEvents
=
TRUE
;
DrawPanel
->
CursorOff
(
DC
);
bool
exit
=
false
;
if
(
(
m_ID_current_state
==
0
)
||
(
DrawStruct
&&
DrawStruct
->
m_Flags
)
)
{
DrawPanel
->
m_AutoPAN_Request
=
FALSE
;
if
(
DrawStruct
&&
DrawStruct
->
m_Flags
)
// "POPUP" in progress
{
DrawPanel
->
m_IgnoreMouseEvents
=
TRUE
;
DrawPanel
->
CursorOff
(
DC
);
switch
(
DrawStruct
->
Type
()
)
{
case
TYPETRACK
:
...
...
@@ -43,40 +44,40 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
if
(
DrawStruct
->
m_Flags
&
IS_DRAGGED
)
{
PlaceDraggedTrackSegment
(
(
TRACK
*
)
DrawStruct
,
DC
);
goto
out
;
exit
=
true
;
}
break
;
case
TYPETEXTE
:
Place_Texte_Pcb
(
(
TEXTE_PCB
*
)
DrawStruct
,
DC
);
goto
out
;
exit
=
true
;
break
;
case
TYPETEXTEMODULE
:
PlaceTexteModule
(
(
TEXTE_MODULE
*
)
DrawStruct
,
DC
);
goto
out
;
exit
=
true
;
break
;
case
TYPEPAD
:
PlacePad
(
(
D_PAD
*
)
DrawStruct
,
DC
);
goto
out
;
exit
=
true
;
break
;
case
TYPEMODULE
:
Place_Module
(
(
MODULE
*
)
DrawStruct
,
DC
);
goto
out
;
exit
=
true
;
break
;
case
TYPEMIRE
:
Place_Mire
(
(
MIREPCB
*
)
DrawStruct
,
DC
);
goto
out
;
exit
=
true
;
break
;
case
TYPEDRAWSEGMENT
:
if
(
m_ID_current_state
==
0
)
{
Place_DrawItem
(
(
DRAWSEGMENT
*
)
DrawStruct
,
DC
);
goto
out
;
exit
=
true
;
}
break
;
...
...
@@ -85,13 +86,18 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
{
DisplayError
(
this
,
wxT
(
"WinEDA_PcbFrame::OnLeftClick() err: m_Flags != 0"
)
);
goto
out
;
exit
=
true
;
}
break
;
}
DrawPanel
->
m_IgnoreMouseEvents
=
FALSE
;
DrawPanel
->
CursorOn
(
DC
);
if
(
exit
)
return
;
}
else
if
(
!
wxGetKeyState
(
WXK_SHIFT
)
&&
!
wxGetKeyState
(
WXK_ALT
)
&&
!
wxGetKeyState
(
WXK_CONTROL
)
&&
!
wxGetKeyState
(
WXK_TAB
)
)
!
wxGetKeyState
(
WXK_CONTROL
)
)
{
DrawStruct
=
PcbGeneralLocateAndDisplay
();
if
(
DrawStruct
)
...
...
@@ -310,10 +316,6 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
SetToolID
(
0
,
wxCURSOR_ARROW
,
wxEmptyString
);
break
;
}
out
:
DrawPanel
->
m_IgnoreMouseEvents
=
FALSE
;
DrawPanel
->
CursorOn
(
DC
);
}
...
...
share/drawpanel.cpp
View file @
10c44291
...
...
@@ -743,6 +743,7 @@ void WinEDA_DrawPanel::OnMouseEvent( wxMouseEvent& event )
int
localrealbutt
=
0
,
localbutt
=
0
,
localkey
=
0
;
BASE_SCREEN
*
screen
=
GetScreen
();
static
WinEDA_DrawPanel
*
LastPanel
;
static
bool
LastClickIsADoubleClick
=
false
;
if
(
event
.
Leaving
()
||
event
.
Entering
()
)
{
...
...
@@ -843,11 +844,17 @@ void WinEDA_DrawPanel::OnMouseEvent( wxMouseEvent& event )
// Appel des fonctions lies au Double Click ou au Click
if
(
localbutt
==
(
int
)
(
GR_M_LEFT_DOWN
|
GR_M_DCLICK
)
)
{
m_Parent
->
OnLeftDClick
(
&
DC
,
screen
->
m_MousePositionInPixels
);
LastClickIsADoubleClick
=
true
;
}
else
if
(
event
.
LeftUp
()
&&
screen
->
BlockLocate
.
m_State
==
STATE_NO_BLOCK
)
if
(
!
LastClickIsADoubleClick
)
m_Parent
->
OnLeftClick
(
&
DC
,
screen
->
m_MousePositionInPixels
);
if
(
event
.
LeftUp
()
)
LastClickIsADoubleClick
=
false
;
if
(
event
.
ButtonUp
(
2
)
&&
(
screen
->
BlockLocate
.
m_State
==
STATE_NO_BLOCK
)
)
{
// The middle button has been relached, with no block command:
...
...
@@ -856,6 +863,7 @@ void WinEDA_DrawPanel::OnMouseEvent( wxMouseEvent& event )
}
/* Appel de la fonction generale de gestion des mouvements souris
* et commandes clavier */
m_Parent
->
GeneralControle
(
&
DC
,
screen
->
m_MousePositionInPixels
);
...
...
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