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
6409f7f9
Commit
6409f7f9
authored
Sep 29, 2013
by
Maciej Sumiński
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wxWidgets 2.8 compatibility fix (removed wx/kbdstate.h)
parent
53fef8d4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
20 deletions
+16
-20
tool_dispatcher.cpp
common/tool/tool_dispatcher.cpp
+2
-17
tool_dispatcher.h
include/tool/tool_dispatcher.h
+14
-3
No files found.
common/tool/tool_dispatcher.cpp
View file @
6409f7f9
...
@@ -117,21 +117,6 @@ KiGfx::VIEW* TOOL_DISPATCHER::getView()
...
@@ -117,21 +117,6 @@ KiGfx::VIEW* TOOL_DISPATCHER::getView()
}
}
int
TOOL_DISPATCHER
::
decodeModifiers
(
const
wxKeyboardState
*
aState
)
const
{
int
mods
=
0
;
if
(
aState
->
ControlDown
()
)
mods
|=
MD_ModCtrl
;
if
(
aState
->
AltDown
()
)
mods
|=
MD_ModAlt
;
if
(
aState
->
ShiftDown
()
)
mods
|=
MD_ModShift
;
return
mods
;
}
bool
TOOL_DISPATCHER
::
handleMouseButton
(
wxEvent
&
aEvent
,
int
aIndex
,
bool
aMotion
)
bool
TOOL_DISPATCHER
::
handleMouseButton
(
wxEvent
&
aEvent
,
int
aIndex
,
bool
aMotion
)
{
{
ButtonState
*
st
=
m_buttons
[
aIndex
];
ButtonState
*
st
=
m_buttons
[
aIndex
];
...
@@ -142,7 +127,7 @@ bool TOOL_DISPATCHER::handleMouseButton( wxEvent& aEvent, int aIndex, bool aMoti
...
@@ -142,7 +127,7 @@ bool TOOL_DISPATCHER::handleMouseButton( wxEvent& aEvent, int aIndex, bool aMoti
bool
up
=
type
==
st
->
upEvent
;
bool
up
=
type
==
st
->
upEvent
;
bool
down
=
type
==
st
->
downEvent
;
bool
down
=
type
==
st
->
downEvent
;
int
mods
=
decodeModifiers
(
static_cast
<
wxMouseEvent
*>
(
&
aEvent
)
);
int
mods
=
decodeModifiers
<
wxMouseEvent
>
(
static_cast
<
wxMouseEvent
*>
(
&
aEvent
)
);
int
args
=
st
->
button
|
mods
;
int
args
=
st
->
button
|
mods
;
if
(
down
)
// Handle mouse button press
if
(
down
)
// Handle mouse button press
...
@@ -246,7 +231,7 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent )
...
@@ -246,7 +231,7 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent )
{
{
wxKeyEvent
*
ke
=
static_cast
<
wxKeyEvent
*>
(
&
aEvent
);
wxKeyEvent
*
ke
=
static_cast
<
wxKeyEvent
*>
(
&
aEvent
);
int
key
=
ke
->
GetKeyCode
();
int
key
=
ke
->
GetKeyCode
();
int
mods
=
decodeModifiers
(
ke
);
int
mods
=
decodeModifiers
<
wxKeyEvent
>
(
ke
);
if
(
type
==
wxEVT_KEY_UP
)
if
(
type
==
wxEVT_KEY_UP
)
{
{
...
...
include/tool/tool_dispatcher.h
View file @
6409f7f9
...
@@ -29,8 +29,6 @@
...
@@ -29,8 +29,6 @@
#include <tool/tool_event.h>
#include <tool/tool_event.h>
#include <wx/kbdstate.h>
class
TOOL_MANAGER
;
class
TOOL_MANAGER
;
class
PCB_BASE_FRAME
;
class
PCB_BASE_FRAME
;
...
@@ -98,7 +96,20 @@ private:
...
@@ -98,7 +96,20 @@ private:
bool
handleMouseButton
(
wxEvent
&
aEvent
,
int
aIndex
,
bool
aMotion
);
bool
handleMouseButton
(
wxEvent
&
aEvent
,
int
aIndex
,
bool
aMotion
);
///> Saves the state of key modifiers (Alt, Ctrl and so on).
///> Saves the state of key modifiers (Alt, Ctrl and so on).
int
decodeModifiers
(
const
wxKeyboardState
*
aState
)
const
;
template
<
class
EventType
>
static
int
decodeModifiers
(
const
EventType
*
aState
)
{
int
mods
=
0
;
if
(
aState
->
ControlDown
()
)
mods
|=
MD_ModCtrl
;
if
(
aState
->
AltDown
()
)
mods
|=
MD_ModAlt
;
if
(
aState
->
ShiftDown
()
)
mods
|=
MD_ModShift
;
return
mods
;
}
///> Stores all the informations regarding a mouse button state.
///> Stores all the informations regarding a mouse button state.
...
...
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