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
0a55a2b6
Commit
0a55a2b6
authored
Apr 22, 2013
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed wheel scroll event on Windows
parent
1944fea3
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
13 deletions
+30
-13
cairo_gal.cpp
common/gal/cairo/cairo_gal.cpp
+3
-0
opengl_gal.cpp
common/gal/opengl/opengl_gal.cpp
+3
-0
wx_view_controls.cpp
common/view/wx_view_controls.cpp
+23
-13
wx_view_controls.h
include/view/wx_view_controls.h
+1
-0
No files found.
common/gal/cairo/cairo_gal.cpp
View file @
0a55a2b6
...
@@ -61,6 +61,9 @@ CAIRO_GAL::CAIRO_GAL( wxWindow* aParent, wxEvtHandler* aMouseListener,
...
@@ -61,6 +61,9 @@ CAIRO_GAL::CAIRO_GAL( wxWindow* aParent, wxEvtHandler* aMouseListener,
Connect
(
wxEVT_RIGHT_UP
,
wxMouseEventHandler
(
CAIRO_GAL
::
skipMouseEvent
)
);
Connect
(
wxEVT_RIGHT_UP
,
wxMouseEventHandler
(
CAIRO_GAL
::
skipMouseEvent
)
);
Connect
(
wxEVT_LEFT_DOWN
,
wxMouseEventHandler
(
CAIRO_GAL
::
skipMouseEvent
)
);
Connect
(
wxEVT_LEFT_DOWN
,
wxMouseEventHandler
(
CAIRO_GAL
::
skipMouseEvent
)
);
Connect
(
wxEVT_LEFT_UP
,
wxMouseEventHandler
(
CAIRO_GAL
::
skipMouseEvent
)
);
Connect
(
wxEVT_LEFT_UP
,
wxMouseEventHandler
(
CAIRO_GAL
::
skipMouseEvent
)
);
#if defined _WIN32 || defined _WIN64
Connect
(
wxEVT_ENTER_WINDOW
,
wxMouseEventHandler
(
CAIRO_GAL
::
skipMouseEvent
)
);
#endif
// Initialize line attributes map
// Initialize line attributes map
lineCapMap
[
LINE_CAP_BUTT
]
=
CAIRO_LINE_CAP_BUTT
;
lineCapMap
[
LINE_CAP_BUTT
]
=
CAIRO_LINE_CAP_BUTT
;
...
...
common/gal/opengl/opengl_gal.cpp
View file @
0a55a2b6
...
@@ -90,6 +90,9 @@ OPENGL_GAL::OPENGL_GAL( wxWindow* aParent, wxEvtHandler* aMouseListener,
...
@@ -90,6 +90,9 @@ OPENGL_GAL::OPENGL_GAL( wxWindow* aParent, wxEvtHandler* aMouseListener,
Connect
(
wxEVT_RIGHT_UP
,
wxMouseEventHandler
(
OPENGL_GAL
::
skipMouseEvent
)
);
Connect
(
wxEVT_RIGHT_UP
,
wxMouseEventHandler
(
OPENGL_GAL
::
skipMouseEvent
)
);
Connect
(
wxEVT_LEFT_DOWN
,
wxMouseEventHandler
(
OPENGL_GAL
::
skipMouseEvent
)
);
Connect
(
wxEVT_LEFT_DOWN
,
wxMouseEventHandler
(
OPENGL_GAL
::
skipMouseEvent
)
);
Connect
(
wxEVT_LEFT_UP
,
wxMouseEventHandler
(
OPENGL_GAL
::
skipMouseEvent
)
);
Connect
(
wxEVT_LEFT_UP
,
wxMouseEventHandler
(
OPENGL_GAL
::
skipMouseEvent
)
);
#if defined _WIN32 || defined _WIN64
Connect
(
wxEVT_ENTER_WINDOW
,
wxMouseEventHandler
(
OPENGL_GAL
::
skipMouseEvent
)
);
#endif
}
}
...
...
common/view/wx_view_controls.cpp
View file @
0a55a2b6
...
@@ -46,28 +46,30 @@ WX_VIEW_CONTROLS::WX_VIEW_CONTROLS( VIEW* aView, wxWindow* aParentPanel ) :
...
@@ -46,28 +46,30 @@ WX_VIEW_CONTROLS::WX_VIEW_CONTROLS( VIEW* aView, wxWindow* aParentPanel ) :
WX_VIEW_CONTROLS
::
onButton
),
NULL
,
this
);
WX_VIEW_CONTROLS
::
onButton
),
NULL
,
this
);
m_parentPanel
->
Connect
(
wxEVT_RIGHT_DOWN
,
wxMouseEventHandler
(
m_parentPanel
->
Connect
(
wxEVT_RIGHT_DOWN
,
wxMouseEventHandler
(
WX_VIEW_CONTROLS
::
onButton
),
NULL
,
this
);
WX_VIEW_CONTROLS
::
onButton
),
NULL
,
this
);
#if defined _WIN32 || defined _WIN64
m_parentPanel
->
Connect
(
wxEVT_ENTER_WINDOW
,
wxMouseEventHandler
(
WX_VIEW_CONTROLS
::
onEnter
),
NULL
,
this
);
#endif
}
}
void
WX_VIEW_CONTROLS
::
onMotion
(
wxMouseEvent
&
event
)
void
WX_VIEW_CONTROLS
::
onMotion
(
wxMouseEvent
&
event
)
{
{
VECTOR2D
mousePoint
(
event
.
GetX
(),
event
.
GetY
()
);
// workaround for wxmsw..
//if( event.Entering() )
//m_parentPanel->SetFocus();
if
(
event
.
Dragging
()
)
if
(
event
.
Dragging
()
&&
m_isDragPanning
)
{
if
(
m_isDragPanning
)
{
{
VECTOR2D
mousePoint
(
event
.
GetX
(),
event
.
GetY
()
);
VECTOR2D
d
=
m_dragStartPoint
-
mousePoint
;
VECTOR2D
d
=
m_dragStartPoint
-
mousePoint
;
VECTOR2D
delta
=
m_view
->
ToWorld
(
d
,
false
);
VECTOR2D
delta
=
m_view
->
ToWorld
(
d
,
false
);
m_view
->
SetCenter
(
m_lookStartPoint
+
delta
);
m_view
->
SetCenter
(
m_lookStartPoint
+
delta
);
m_parentPanel
->
Refresh
();
m_parentPanel
->
Refresh
();
}
}
else
{
event
.
Skip
();
event
.
Skip
();
}
}
}
}
...
@@ -117,6 +119,8 @@ void WX_VIEW_CONTROLS::onWheel( wxMouseEvent& event )
...
@@ -117,6 +119,8 @@ void WX_VIEW_CONTROLS::onWheel( wxMouseEvent& event )
m_view
->
SetCenter
(
m_view
->
GetCenter
()
+
delta
);
m_view
->
SetCenter
(
m_view
->
GetCenter
()
+
delta
);
m_parentPanel
->
Refresh
();
m_parentPanel
->
Refresh
();
}
}
event
.
Skip
();
}
}
...
@@ -135,3 +139,9 @@ void WX_VIEW_CONTROLS::onButton( wxMouseEvent& event )
...
@@ -135,3 +139,9 @@ void WX_VIEW_CONTROLS::onButton( wxMouseEvent& event )
event
.
Skip
();
event
.
Skip
();
}
}
void
WX_VIEW_CONTROLS
::
onEnter
(
wxMouseEvent
&
event
)
{
m_parentPanel
->
SetFocus
();
}
include/view/wx_view_controls.h
View file @
0a55a2b6
...
@@ -54,6 +54,7 @@ public:
...
@@ -54,6 +54,7 @@ public:
void
onWheel
(
wxMouseEvent
&
event
);
void
onWheel
(
wxMouseEvent
&
event
);
void
onMotion
(
wxMouseEvent
&
event
);
void
onMotion
(
wxMouseEvent
&
event
);
void
onButton
(
wxMouseEvent
&
event
);
void
onButton
(
wxMouseEvent
&
event
);
void
onEnter
(
wxMouseEvent
&
event
);
private
:
private
:
...
...
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