Show duplicate legs as dashed lines
[survex.git] / src / guicontrol.h
blob9ecdf1e84a8f552f8416f881bb355b6428f01fd9
1 //
2 // guicontrol.h
3 //
4 // Handlers for events relating to the display of a survey.
5 //
6 // Copyright (C) 2000-2002,2005 Mark R. Shinwell
7 // Copyright (C) 2001-2004,2006,2014,2015 Olly Betts
8 //
9 // This program is free software; you can redistribute it and/or modify
10 // it under the terms of the GNU General Public License as published by
11 // the Free Software Foundation; either version 2 of the License, or
12 // (at your option) any later version.
14 // This program is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 // GNU General Public License for more details.
19 // You should have received a copy of the GNU General Public License
20 // along with this program; if not, write to the Free Software
21 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 #ifndef guicontrol_h
25 #define guicontrol_h
27 #include "wx.h"
29 class GfxCore;
31 class GUIControl {
32 GfxCore* m_View;
34 enum { NO_DRAG = 0, LEFT_DRAG, MIDDLE_DRAG, RIGHT_DRAG } dragging;
36 wxPoint m_DragStart;
37 wxPoint m_DragRealStart;
38 wxPoint m_DragLast;
40 enum {
41 drag_NONE,
42 drag_MAIN,
43 drag_COMPASS,
44 drag_ELEV,
45 drag_SCALE,
46 drag_ZOOM
47 } m_LastDrag;
49 enum { lock_NONE, lock_ROTATE, lock_SCALE } m_ScaleRotateLock;
51 bool m_ReverseControls;
53 void HandleRotate(wxPoint);
54 void HandleTilt(wxPoint);
55 void HandleTranslate(wxPoint);
56 void HandleScaleRotate(wxPoint);
57 void HandleTiltRotate(wxPoint);
59 void HandCursor();
60 void RestoreCursor();
62 void HandleNonDrag(const wxPoint & point);
64 public:
65 GUIControl();
67 void SetView(GfxCore* view);
69 bool MouseDown() const;
71 void OnDefaults();
72 void OnPlan();
73 void OnElevation();
74 void OnDisplayOverlappingNames();
75 void OnColourByDepth();
76 void OnColourByDate();
77 void OnColourByError();
78 void OnColourByGradient();
79 void OnColourByLength();
80 void OnShowCrosses();
81 void OnShowStationNames();
82 void OnShowSurveyLegs();
83 void OnHideSplays();
84 void OnShowSplaysNormal();
85 void OnShowSplaysFaded();
86 void OnHideDupes();
87 void OnShowDupesNormal();
88 void OnShowDupesDashed();
89 void OnShowSurface();
90 void OnMoveEast();
91 void OnMoveNorth();
92 void OnMoveSouth();
93 void OnMoveWest();
94 void OnToggleRotation();
95 void OnReverseControls();
96 void OnSlowDown(bool accel = false);
97 void OnSpeedUp(bool accel = false);
98 void OnStepOnceAnticlockwise(bool accel = false);
99 void OnStepOnceClockwise(bool accel = false);
100 void OnHigherViewpoint(bool accel = false);
101 void OnLowerViewpoint(bool accel = false);
102 void OnShiftDisplayDown(bool accel = false);
103 void OnShiftDisplayLeft(bool accel = false);
104 void OnShiftDisplayRight(bool accel = false);
105 void OnShiftDisplayUp(bool accel = false);
106 void OnZoomIn(bool accel = false);
107 void OnZoomOut(bool accel = false);
108 void OnToggleScalebar();
109 void OnToggleColourKey();
110 void OnViewCompass();
111 void OnViewClino();
112 void OnViewGrid();
113 void OnReverseDirectionOfRotation();
114 void OnShowEntrances();
115 void OnShowFixedPts();
116 void OnShowExportedPts();
117 void OnCancelDistLine();
118 void OnMouseMove(wxMouseEvent& event);
119 void OnLButtonDown(wxMouseEvent& event);
120 void OnLButtonUp(wxMouseEvent& event);
121 void OnMButtonDown(wxMouseEvent& event);
122 void OnMButtonUp(wxMouseEvent& event);
123 void OnRButtonDown(wxMouseEvent& event);
124 void OnRButtonUp(wxMouseEvent& event);
125 void OnMouseWheel(wxMouseEvent& event);
126 void OnKeyPress(wxKeyEvent &e);
128 void OnDisplayOverlappingNamesUpdate(wxUpdateUIEvent&);
129 void OnColourByUpdate(wxUpdateUIEvent&);
130 void OnColourByDepthUpdate(wxUpdateUIEvent&);
131 void OnColourByDateUpdate(wxUpdateUIEvent&);
132 void OnColourByErrorUpdate(wxUpdateUIEvent&);
133 void OnColourByGradientUpdate(wxUpdateUIEvent&);
134 void OnColourByLengthUpdate(wxUpdateUIEvent&);
135 void OnShowCrossesUpdate(wxUpdateUIEvent&);
136 void OnShowStationNamesUpdate(wxUpdateUIEvent&);
137 void OnShowSurveyLegsUpdate(wxUpdateUIEvent&);
138 void OnSplaysUpdate(wxUpdateUIEvent&);
139 void OnHideSplaysUpdate(wxUpdateUIEvent&);
140 void OnShowSplaysNormalUpdate(wxUpdateUIEvent&);
141 void OnShowSplaysFadedUpdate(wxUpdateUIEvent&);
142 void OnDupesUpdate(wxUpdateUIEvent&);
143 void OnHideDupesUpdate(wxUpdateUIEvent&);
144 void OnShowDupesNormalUpdate(wxUpdateUIEvent&);
145 void OnShowDupesDashedUpdate(wxUpdateUIEvent&);
146 void OnShowSurfaceUpdate(wxUpdateUIEvent&);
147 void OnMoveEastUpdate(wxUpdateUIEvent&);
148 void OnMoveNorthUpdate(wxUpdateUIEvent&);
149 void OnMoveSouthUpdate(wxUpdateUIEvent&);
150 void OnMoveWestUpdate(wxUpdateUIEvent&);
151 void OnToggleRotationUpdate(wxUpdateUIEvent&);
152 void OnReverseControlsUpdate(wxUpdateUIEvent&);
153 void OnReverseDirectionOfRotationUpdate(wxUpdateUIEvent&);
154 void OnDefaultsUpdate(wxUpdateUIEvent&);
155 void OnElevationUpdate(wxUpdateUIEvent&);
156 void OnPlanUpdate(wxUpdateUIEvent&);
157 void OnToggleScalebarUpdate(wxUpdateUIEvent&);
158 void OnToggleColourKeyUpdate(wxUpdateUIEvent&);
159 void OnViewCompassUpdate(wxUpdateUIEvent&);
160 void OnViewClinoUpdate(wxUpdateUIEvent&);
161 void OnViewGridUpdate(wxUpdateUIEvent&);
162 void OnShowEntrancesUpdate(wxUpdateUIEvent&);
163 void OnShowExportedPtsUpdate(wxUpdateUIEvent&);
164 void OnShowFixedPtsUpdate(wxUpdateUIEvent&);
166 void OnIndicatorsUpdate(wxUpdateUIEvent&);
167 void OnCancelDistLineUpdate(wxUpdateUIEvent&);
169 void OnViewPerspective();
170 void OnViewPerspectiveUpdate(wxUpdateUIEvent& cmd);
172 void OnViewSmoothShading();
173 void OnViewSmoothShadingUpdate(wxUpdateUIEvent& cmd);
175 void OnViewTextured();
176 void OnViewTexturedUpdate(wxUpdateUIEvent& cmd);
178 void OnViewFog();
179 void OnViewFogUpdate(wxUpdateUIEvent& cmd);
181 void OnViewSmoothLines();
182 void OnViewSmoothLinesUpdate(wxUpdateUIEvent& cmd);
184 void OnToggleMetric();
185 void OnToggleMetricUpdate(wxUpdateUIEvent& cmd);
187 void OnToggleDegrees();
188 void OnToggleDegreesUpdate(wxUpdateUIEvent& cmd);
190 void OnTogglePercent();
191 void OnTogglePercentUpdate(wxUpdateUIEvent& cmd);
193 void OnToggleTubes();
194 void OnToggleTubesUpdate(wxUpdateUIEvent& cmd);
196 void OnViewFullScreenUpdate(wxUpdateUIEvent&);
197 void OnViewFullScreen();
199 void OnViewBoundingBoxUpdate(wxUpdateUIEvent&);
200 void OnViewBoundingBox();
202 void OnViewTerrainUpdate(wxUpdateUIEvent&);
203 void OnViewTerrain();
206 #endif