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
b03f97b9
Commit
b03f97b9
authored
Aug 23, 2013
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed some unnecessary stuff and added some comments to WX_VIEW_CONTROLS.
parent
961a8c2e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
20 deletions
+15
-20
wx_view_controls.cpp
common/view/wx_view_controls.cpp
+1
-9
wx_view_controls.h
include/view/wx_view_controls.h
+14
-11
No files found.
common/view/wx_view_controls.cpp
View file @
b03f97b9
...
...
@@ -33,8 +33,8 @@ using namespace KiGfx;
WX_VIEW_CONTROLS
::
WX_VIEW_CONTROLS
(
VIEW
*
aView
,
wxWindow
*
aParentPanel
)
:
VIEW_CONTROLS
(
aView
),
m_state
(
IDLE
),
m_autoPanEnabled
(
false
),
m_grabMouse
(
false
),
m_autoPanEnabled
(
false
),
m_autoPanMargin
(
0.1
),
m_autoPanSpeed
(
0.15
),
m_parentPanel
(
aParentPanel
)
...
...
@@ -83,8 +83,6 @@ void WX_VIEW_CONTROLS::onMotion( wxMouseEvent& aEvent )
if
(
m_autoPanEnabled
)
handleAutoPanning
(
aEvent
);
}
// DeletePendingEvents();
}
...
...
@@ -186,9 +184,6 @@ void WX_VIEW_CONTROLS::onTimer( wxTimerEvent& aEvent )
dir
=
dir
.
Resize
(
borderSize
);
dir
=
m_view
->
ToWorld
(
dir
,
false
);
// wxLogDebug( "AutoPanningTimer: dir %.4f %.4f sped %.4f", dir.x, dir.y, m_autoPanSpeed );
m_view
->
SetCenter
(
m_view
->
GetCenter
()
+
dir
*
m_autoPanSpeed
);
wxPaintEvent
redrawEvent
;
...
...
@@ -196,9 +191,6 @@ void WX_VIEW_CONTROLS::onTimer( wxTimerEvent& aEvent )
}
break
;
}
DeletePendingEvents
();
m_panTimer
.
DeletePendingEvents
();
}
...
...
include/view/wx_view_controls.h
View file @
b03f97b9
...
...
@@ -37,7 +37,6 @@
#include <view/view_controls.h>
class
EDA_DRAW_PANEL_GAL
;
class
TOOL_DISPATCHER
;
namespace
KiGfx
{
...
...
@@ -48,7 +47,6 @@ namespace KiGfx
class
WX_VIEW_CONTROLS
:
public
VIEW_CONTROLS
,
public
wxEvtHandler
{
public
:
WX_VIEW_CONTROLS
(
VIEW
*
aView
,
wxWindow
*
aParentPanel
);
~
WX_VIEW_CONTROLS
()
{};
...
...
@@ -85,33 +83,38 @@ private:
AUTO_PANNING
,
};
/// Computes new viewport settings while in autopanning mode
void
handleAutoPanning
(
wxMouseEvent
&
aEvent
);
/// Current state of VIEW_CONTROLS
State
m_state
;
/// Options for WX_VIEW_CONTROLS
bool
m_autoPanEnabled
;
bool
m_needRedraw
;
/// Flag for grabbing the mouse cursor
bool
m_grabMouse
;
/// Flag for turning on autopanning
bool
m_autoPanEnabled
;
/// Distance from cursor to VIEW edge when panning is active
.
/// Distance from cursor to VIEW edge when panning is active
float
m_autoPanMargin
;
/// How fast is panning when in auto mode
.
/// How fast is panning when in auto mode
float
m_autoPanSpeed
;
/// TODO
float
m_autoPanAcceleration
;
/// Panel that is affected by VIEW_CONTROLS
wxWindow
*
m_parentPanel
;
/// Stores information about point where
event started.
/// Stores information about point where
dragging has started
VECTOR2D
m_dragStartPoint
;
/// Stores information about the center of viewport when dragging has started
VECTOR2D
m_lookStartPoint
;
/// Current direction of panning (only autopanning mode)
VECTOR2D
m_panDirection
;
/// Used for determining time intervals between
events.
/// Used for determining time intervals between
scroll & zoom events
wxLongLong
m_timeStamp
;
/// Timer repsonsible for handling autopanning
wxTimer
m_panTimer
;
};
}
// namespace KiGfx
...
...
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