-
Notifications
You must be signed in to change notification settings - Fork 7
/
RouteGraph.h
77 lines (55 loc) · 2.15 KB
/
RouteGraph.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#pragma once
#include "afxwin.h"
#include "Graphs/GraphCtrl.h"
namespace Graph
{
#define WM_SHOW_LATLONG WM_USER +18
#define WM_LBU_IN_GPSPLOT WM_USER +19
#define WM_LBD_IN_GPSPLOT WM_USER +20
#define WM_ZOOM_IN_GPSPLOT WM_USER +21
class CRouteGraph : public CGraphCtrl
{
public:
CRouteGraph();
~CRouteGraph();
/** the size of this graph */
CRect rect;
/** handle to the parent window, for message handling */
CWnd* parentWnd;
/* current lat and long */
double curLat, curLong;
/** The lat and long where the left mouse button was pressed
down the last time. */
double lbdLat, lbdLong;
/** true if the user is right now trying to zoom into the graph */
bool m_zooming;
/** The coordinates (lat & long) into which the user wants to zoom. */
struct plotRange m_zoomRect;
/** A DC to draw something on... */
CDC m_dcRoute;
CBitmap* m_pbitmapOldRoute;
CBitmap m_bitmapRoute;
DECLARE_MESSAGE_MAP()
/** Redraws the graph */
afx_msg void OnPaint();
/** Draws a shaded rectangle between with the two given points
as corners */
void DrawShadedRect(double lat1, double lon1, double lat2, double lon2);
public:
/** Called when the user moves the mouse over the graph */
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
/* distance calculations */
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
/* distance calculations */
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
/* zooming out */
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
/// ---------------------- OVERLOADED FUNCTIONS ----------------------
/** Creates the graph */
virtual BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID = NULL);
// ------------------ Communication ------------------------
/** Gets the coordinate values that the user wants to zoom into.
If the user does not want to zoom, the values in 'rect' will be zero. */
void GetZoomRect(struct plotRange& range);
};
}