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
b29de1cc
Commit
b29de1cc
authored
Dec 08, 2007
by
f3nix
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GetScreenPosition is available in >= 2.8.0 only.
parent
4ce4631d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
9 deletions
+14
-9
drawpanel.cpp
share/drawpanel.cpp
+14
-9
No files found.
share/drawpanel.cpp
View file @
b29de1cc
...
@@ -186,7 +186,7 @@ wxPoint WinEDA_DrawPanel::CalcAbsolutePosition( const wxPoint& rel_pos )
...
@@ -186,7 +186,7 @@ wxPoint WinEDA_DrawPanel::CalcAbsolutePosition( const wxPoint& rel_pos )
/*********************************************************************/
/*********************************************************************/
/* retourne la position absolue en pixels de la position rel_pos,
/* retourne la position absolue en pixels de la position rel_pos,
* donn
e en position relative scrolle
(en pixel)
* donn
�e en position relative scroll�e (e
n pixel)
*/
*/
{
{
wxPoint
pos
;
wxPoint
pos
;
...
@@ -862,7 +862,7 @@ void WinEDA_DrawPanel::OnMouseEvent( wxMouseEvent& event )
...
@@ -862,7 +862,7 @@ void WinEDA_DrawPanel::OnMouseEvent( wxMouseEvent& event )
g_MouseOldButtons
=
localrealbutt
;
g_MouseOldButtons
=
localrealbutt
;
// Appel des fonctions li
e
s au Double Click ou au Click
// Appel des fonctions li
�es
au Double Click ou au Click
if
(
localbutt
==
(
int
)
(
GR_M_LEFT_DOWN
|
GR_M_DCLICK
)
)
if
(
localbutt
==
(
int
)
(
GR_M_LEFT_DOWN
|
GR_M_DCLICK
)
)
{
{
m_Parent
->
OnLeftDClick
(
&
DC
,
screen
->
m_MousePositionInPixels
);
m_Parent
->
OnLeftDClick
(
&
DC
,
screen
->
m_MousePositionInPixels
);
...
@@ -986,7 +986,7 @@ void WinEDA_DrawPanel::OnMouseEvent( wxMouseEvent& event )
...
@@ -986,7 +986,7 @@ void WinEDA_DrawPanel::OnMouseEvent( wxMouseEvent& event )
}
}
// Arret de block sur un double click ( qui peut provoquer un move block
// Arret de block sur un double click ( qui peut provoquer un move block
// si on d
p
lace la souris dans ce double click
// si on d
�pl
ace la souris dans ce double click
if
(
localbutt
==
(
int
)
(
GR_M_LEFT_DOWN
|
GR_M_DCLICK
)
)
if
(
localbutt
==
(
int
)
(
GR_M_LEFT_DOWN
|
GR_M_DCLICK
)
)
{
{
if
(
screen
->
BlockLocate
.
m_Command
!=
BLOCK_IDLE
)
if
(
screen
->
BlockLocate
.
m_Command
!=
BLOCK_IDLE
)
...
@@ -1066,15 +1066,20 @@ void WinEDA_DrawPanel::OnKeyEvent( wxKeyEvent& event )
...
@@ -1066,15 +1066,20 @@ void WinEDA_DrawPanel::OnKeyEvent( wxKeyEvent& event )
}
}
}
}
#if wxCHECK_VERSION(2, 8, 0)
/* some key commands use the mouse position: refresh it */
/* some key commands use the mouse position: refresh it */
wxPoint
mouse_pos
=
wxGetMousePosition
();
// Get the mouse position on screen
wxPoint
mouse_pos
=
wxGetMousePosition
();
// Get the mouse position on screen
wxPoint
win_pos
=
GetScreenPosition
();
// get the draw area (panel)position on screen
wxPoint
win_pos
=
GetScreenPosition
();
// get the draw area (panel)position on screen
mouse_pos
-=
win_pos
;
// mouse_pos = is the mouse position relative to the panel
mouse_pos
-=
win_pos
;
// mouse_pos = is the mouse position relative to the panel
/* Compute absolute m_MousePosition in pixel units (i.e. considering the current scrool) : */
Screen
->
m_MousePositionInPixels
=
CalcAbsolutePosition
(
mouse_pos
);
/* Compute absolute m_MousePosition in pixel units (i.e. considering the current scrool) : */
Screen
->
m_MousePositionInPixels
=
CalcAbsolutePosition
(
mouse_pos
);
/* Compute absolute m_MousePosition in user units: */
Screen
->
m_MousePosition
=
CursorRealPosition
(
Screen
->
m_MousePositionInPixels
);
/* Compute absolute m_MousePosition in user units: */
Screen
->
m_MousePosition
=
CursorRealPosition
(
Screen
->
m_MousePositionInPixels
);
#else
#endif
m_Parent
->
GeneralControle
(
&
DC
,
Screen
->
m_MousePositionInPixels
);
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