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
d1578e4e
Commit
d1578e4e
authored
Sep 24, 2013
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed cvpcb build.
parent
16243207
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
16 deletions
+12
-16
drawpanel_gal.cpp
common/drawpanel_gal.cpp
+2
-3
tool_dispatcher.cpp
common/tool/tool_dispatcher.cpp
+3
-8
wx_view_controls.cpp
common/view/wx_view_controls.cpp
+3
-1
tool_dispatcher.h
include/tool/tool_dispatcher.h
+1
-4
wx_view_controls.h
include/view/wx_view_controls.h
+3
-0
No files found.
common/drawpanel_gal.cpp
View file @
d1578e4e
...
@@ -47,7 +47,6 @@
...
@@ -47,7 +47,6 @@
#define METRIC_UNIT_LENGTH (1e9)
#define METRIC_UNIT_LENGTH (1e9)
EDA_DRAW_PANEL_GAL
::
EDA_DRAW_PANEL_GAL
(
wxWindow
*
aParentWindow
,
wxWindowID
aWindowId
,
EDA_DRAW_PANEL_GAL
::
EDA_DRAW_PANEL_GAL
(
wxWindow
*
aParentWindow
,
wxWindowID
aWindowId
,
const
wxPoint
&
aPosition
,
const
wxSize
&
aSize
,
const
wxPoint
&
aPosition
,
const
wxSize
&
aSize
,
GalType
aGalType
)
:
GalType
aGalType
)
:
...
@@ -91,8 +90,8 @@ EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWin
...
@@ -91,8 +90,8 @@ EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWin
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
);
Connect
(
wxEVT_ENTER_WINDOW
,
wxEventHandler
(
EDA_DRAW_PANEL_GAL
::
onEnter
),
NULL
,
this
);
Connect
(
TOOL_DISPATCHER
::
EVT_REFRESH_MOUSE
,
wxEventHandler
(
EDA_DRAW_PANEL_GAL
::
onEvent
)
,
Connect
(
KiGfx
::
WX_VIEW_CONTROLS
::
EVT_REFRESH_MOUSE
,
NULL
,
this
);
wxEventHandler
(
EDA_DRAW_PANEL_GAL
::
onEvent
),
NULL
,
this
);
m_refreshTimer
.
SetOwner
(
this
);
m_refreshTimer
.
SetOwner
(
this
);
Connect
(
wxEVT_TIMER
,
wxTimerEventHandler
(
EDA_DRAW_PANEL_GAL
::
onRefreshTimer
),
NULL
,
this
);
Connect
(
wxEVT_TIMER
,
wxTimerEventHandler
(
EDA_DRAW_PANEL_GAL
::
onRefreshTimer
),
NULL
,
this
);
...
...
common/tool/tool_dispatcher.cpp
View file @
d1578e4e
...
@@ -22,16 +22,13 @@
...
@@ -22,16 +22,13 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
*/
#include <wx/wx.h>
#include <wx/event.h>
#include <wxPcbStruct.h>
#include <wxPcbStruct.h>
#include <wxBasePcbFrame.h>
#include <wxBasePcbFrame.h>
#include <tool/tool_manager.h>
#include <tool/tool_manager.h>
#include <tool/tool_dispatcher.h>
#include <tool/tool_dispatcher.h>
#include <view/view.h>
#include <view/view.h>
#include <view/view_controls.h>
#include <view/
wx_
view_controls.h>
#include <class_drawpanel_gal.h>
#include <class_drawpanel_gal.h>
...
@@ -42,8 +39,6 @@
...
@@ -42,8 +39,6 @@
using
boost
::
optional
;
using
boost
::
optional
;
const
wxEventType
TOOL_DISPATCHER
::
EVT_REFRESH_MOUSE
=
wxNewEventType
();
struct
TOOL_DISPATCHER
::
ButtonState
struct
TOOL_DISPATCHER
::
ButtonState
{
{
ButtonState
(
TOOL_MouseButtons
aButton
,
const
wxEventType
&
aDownEvent
,
ButtonState
(
TOOL_MouseButtons
aButton
,
const
wxEventType
&
aDownEvent
,
...
@@ -209,11 +204,11 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent )
...
@@ -209,11 +204,11 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent )
type
==
wxEVT_LEFT_DOWN
||
type
==
wxEVT_LEFT_UP
||
type
==
wxEVT_LEFT_DOWN
||
type
==
wxEVT_LEFT_UP
||
type
==
wxEVT_MIDDLE_DOWN
||
type
==
wxEVT_MIDDLE_UP
||
type
==
wxEVT_MIDDLE_DOWN
||
type
==
wxEVT_MIDDLE_UP
||
type
==
wxEVT_RIGHT_DOWN
||
type
==
wxEVT_RIGHT_UP
||
type
==
wxEVT_RIGHT_DOWN
||
type
==
wxEVT_RIGHT_UP
||
type
==
EVT_REFRESH_MOUSE
)
type
==
KiGfx
::
WX_VIEW_CONTROLS
::
EVT_REFRESH_MOUSE
)
{
{
VECTOR2D
screenPos
=
m_toolMgr
->
GetViewControls
()
->
GetCursorPosition
();
VECTOR2D
screenPos
=
m_toolMgr
->
GetViewControls
()
->
GetCursorPosition
();
VECTOR2D
pos
=
getView
()
->
ToWorld
(
screenPos
);
VECTOR2D
pos
=
getView
()
->
ToWorld
(
screenPos
);
if
(
pos
!=
m_lastMousePos
||
type
==
EVT_REFRESH_MOUSE
)
if
(
pos
!=
m_lastMousePos
||
type
==
KiGfx
::
WX_VIEW_CONTROLS
::
EVT_REFRESH_MOUSE
)
{
{
motion
=
true
;
motion
=
true
;
m_lastMousePos
=
pos
;
m_lastMousePos
=
pos
;
...
...
common/view/wx_view_controls.cpp
View file @
d1578e4e
...
@@ -32,6 +32,8 @@
...
@@ -32,6 +32,8 @@
using
namespace
KiGfx
;
using
namespace
KiGfx
;
const
wxEventType
WX_VIEW_CONTROLS
::
EVT_REFRESH_MOUSE
=
wxNewEventType
();
WX_VIEW_CONTROLS
::
WX_VIEW_CONTROLS
(
VIEW
*
aView
,
wxWindow
*
aParentPanel
)
:
WX_VIEW_CONTROLS
::
WX_VIEW_CONTROLS
(
VIEW
*
aView
,
wxWindow
*
aParentPanel
)
:
VIEW_CONTROLS
(
aView
),
VIEW_CONTROLS
(
aView
),
m_state
(
IDLE
),
m_state
(
IDLE
),
...
@@ -207,7 +209,7 @@ void WX_VIEW_CONTROLS::onTimer( wxTimerEvent& aEvent )
...
@@ -207,7 +209,7 @@ void WX_VIEW_CONTROLS::onTimer( wxTimerEvent& aEvent )
m_view
->
SetCenter
(
m_view
->
GetCenter
()
+
dir
*
m_autoPanSpeed
);
m_view
->
SetCenter
(
m_view
->
GetCenter
()
+
dir
*
m_autoPanSpeed
);
// Notify tools that the cursor position has changed in the world coordinates
// Notify tools that the cursor position has changed in the world coordinates
wxCommandEvent
moveEvent
(
TOOL_DISPATCHER
::
EVT_REFRESH_MOUSE
);
wxCommandEvent
moveEvent
(
EVT_REFRESH_MOUSE
);
wxPostEvent
(
m_parentPanel
,
moveEvent
);
wxPostEvent
(
m_parentPanel
,
moveEvent
);
}
}
break
;
break
;
...
...
include/tool/tool_dispatcher.h
View file @
d1578e4e
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
#include <tool/tool_event.h>
#include <tool/tool_event.h>
#include <wx/event.h>
//
#include <wx/event.h>
#include <wx/kbdstate.h>
#include <wx/kbdstate.h>
class
TOOL_MANAGER
;
class
TOOL_MANAGER
;
...
@@ -65,9 +65,6 @@ public:
...
@@ -65,9 +65,6 @@ public:
virtual
void
DispatchWxEvent
(
wxEvent
&
aEvent
);
virtual
void
DispatchWxEvent
(
wxEvent
&
aEvent
);
virtual
void
DispatchWxCommand
(
wxCommandEvent
&
aEvent
);
virtual
void
DispatchWxCommand
(
wxCommandEvent
&
aEvent
);
/// Event that forces mouse move event in the dispatcher
static
const
wxEventType
EVT_REFRESH_MOUSE
;
private
:
private
:
static
const
int
MouseButtonCount
=
3
;
static
const
int
MouseButtonCount
=
3
;
static
const
int
DragTimeThreshold
=
300
;
static
const
int
DragTimeThreshold
=
300
;
...
...
include/view/wx_view_controls.h
View file @
d1578e4e
...
@@ -84,6 +84,9 @@ public:
...
@@ -84,6 +84,9 @@ public:
/// @copydoc VIEW_CONTROLS::GetCursorPosition()
/// @copydoc VIEW_CONTROLS::GetCursorPosition()
virtual
const
VECTOR2D
GetCursorPosition
()
const
;
virtual
const
VECTOR2D
GetCursorPosition
()
const
;
/// Event that forces mouse move event in the dispatcher
static
const
wxEventType
EVT_REFRESH_MOUSE
;
private
:
private
:
/// Possible states for WX_VIEW_CONTROLS
/// Possible states for WX_VIEW_CONTROLS
enum
State
{
enum
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