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
b0694e03
Commit
b0694e03
authored
Sep 09, 2013
by
tomasz.wlostowski@cern.ch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
EDA_DRAWPANEL_GAL: set focus on mouse enter to catch all key events
parent
da2f63bf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
drawpanel_gal.cpp
common/drawpanel_gal.cpp
+9
-2
class_drawpanel_gal.h
include/class_drawpanel_gal.h
+3
-2
No files found.
common/drawpanel_gal.cpp
View file @
b0694e03
...
@@ -87,9 +87,11 @@ EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWin
...
@@ -87,9 +87,11 @@ EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWin
Connect
(
wxEVT_MIDDLE_UP
,
wxEventHandler
(
EDA_DRAW_PANEL_GAL
::
onEvent
),
NULL
,
this
);
Connect
(
wxEVT_MIDDLE_UP
,
wxEventHandler
(
EDA_DRAW_PANEL_GAL
::
onEvent
),
NULL
,
this
);
Connect
(
wxEVT_MIDDLE_DOWN
,
wxEventHandler
(
EDA_DRAW_PANEL_GAL
::
onEvent
),
NULL
,
this
);
Connect
(
wxEVT_MIDDLE_DOWN
,
wxEventHandler
(
EDA_DRAW_PANEL_GAL
::
onEvent
),
NULL
,
this
);
Connect
(
wxEVT_MOUSEWHEEL
,
wxEventHandler
(
EDA_DRAW_PANEL_GAL
::
onEvent
),
NULL
,
this
);
Connect
(
wxEVT_MOUSEWHEEL
,
wxEventHandler
(
EDA_DRAW_PANEL_GAL
::
onEvent
),
NULL
,
this
);
Connect
(
wxEVT_CHAR_HOOK
,
wxEventHandler
(
EDA_DRAW_PANEL_GAL
::
skipEvent
)
,
NULL
,
this
);
Connect
(
wxEVT_CHAR_HOOK
,
wxEventHandler
(
EDA_DRAW_PANEL_GAL
::
skipEvent
)
);
Connect
(
wxEVT_KEY_UP
,
wxEventHandler
(
EDA_DRAW_PANEL_GAL
::
onEvent
),
NULL
,
this
);
Connect
(
wxEVT_KEY_UP
,
wxEventHandler
(
EDA_DRAW_PANEL_GAL
::
onEvent
),
NULL
,
this
);
Connect
(
wxEVT_KEY_DOWN
,
wxEventHandler
(
EDA_DRAW_PANEL_GAL
::
onEvent
),
NULL
,
this
);
Connect
(
wxEVT_KEY_DOWN
,
wxEventHandler
(
EDA_DRAW_PANEL_GAL
::
onEvent
),
NULL
,
this
);
Connect
(
wxEVT_ENTER_WINDOW
,
wxEventHandler
(
EDA_DRAW_PANEL_GAL
::
onEnter
),
NULL
,
this
);
this
->
SetFocus
();
}
}
...
@@ -101,7 +103,7 @@ EDA_DRAW_PANEL_GAL::~EDA_DRAW_PANEL_GAL()
...
@@ -101,7 +103,7 @@ EDA_DRAW_PANEL_GAL::~EDA_DRAW_PANEL_GAL()
if
(
m_viewControls
)
if
(
m_viewControls
)
delete
m_viewControls
;
delete
m_viewControls
;
if
(
m_view
)
if
(
m_view
)
delete
m_view
;
delete
m_view
;
if
(
m_gal
)
if
(
m_gal
)
...
@@ -210,6 +212,11 @@ void EDA_DRAW_PANEL_GAL::onEvent( wxEvent& aEvent )
...
@@ -210,6 +212,11 @@ void EDA_DRAW_PANEL_GAL::onEvent( wxEvent& aEvent )
}
}
void
EDA_DRAW_PANEL_GAL
::
onEnter
(
wxEvent
&
aEvent
)
{
SetFocus
();
}
void
EDA_DRAW_PANEL_GAL
::
skipEvent
(
wxEvent
&
aEvent
)
void
EDA_DRAW_PANEL_GAL
::
skipEvent
(
wxEvent
&
aEvent
)
{
{
// This is necessary for CHAR_HOOK event to generate KEY_UP and KEY_DOWN events
// This is necessary for CHAR_HOOK event to generate KEY_UP and KEY_DOWN events
...
...
include/class_drawpanel_gal.h
View file @
b0694e03
...
@@ -114,8 +114,9 @@ public:
...
@@ -114,8 +114,9 @@ public:
protected
:
protected
:
void
onPaint
(
wxPaintEvent
&
WXUNUSED
(
aEvent
)
);
void
onPaint
(
wxPaintEvent
&
WXUNUSED
(
aEvent
)
);
void
onSize
(
wxSizeEvent
&
aEvent
);
void
onSize
(
wxSizeEvent
&
aEvent
);
void
onEvent
(
wxEvent
&
aEvent
);
void
onEvent
(
wxEvent
&
aEvent
);
void
skipEvent
(
wxEvent
&
aEvent
);
void
onEnter
(
wxEvent
&
aEvent
);
void
skipEvent
(
wxEvent
&
aEvent
);
KiGfx
::
GAL
*
m_gal
;
///< Interface for drawing objects on a 2D-surface
KiGfx
::
GAL
*
m_gal
;
///< Interface for drawing objects on a 2D-surface
KiGfx
::
VIEW
*
m_view
;
///< Stores view settings (scale, center, etc.)
KiGfx
::
VIEW
*
m_view
;
///< Stores view settings (scale, center, etc.)
...
...
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