Fix coding style
[survex.git] / src / guicontrol.h
blob6d074c4e5334a66b473a714b7c0b68ab38f7e130
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 OnColourBySurvey();
81 void OnShowCrosses();
82 void OnShowStationNames();
83 void OnShowSurveyLegs();
84 void OnHideSplays();
85 void OnShowSplaysDashed();
86 void OnShowSplaysFaded();
87 void OnShowSplaysNormal();
88 void OnHideDupes();
89 void OnShowDupesDashed();
90 void OnShowDupesFaded();
91 void OnShowDupesNormal();
92 void OnShowSurface();
93 void OnMoveEast();
94 void OnMoveNorth();
95 void OnMoveSouth();
96 void OnMoveWest();
97 void OnToggleRotation();
98 void OnReverseControls();
99 void OnSlowDown(bool accel = false);
100 void OnSpeedUp(bool accel = false);
101 void OnStepOnceAnticlockwise(bool accel = false);
102 void OnStepOnceClockwise(bool accel = false);
103 void OnHigherViewpoint(bool accel = false);
104 void OnLowerViewpoint(bool accel = false);
105 void OnShiftDisplayDown(bool accel = false);
106 void OnShiftDisplayLeft(bool accel = false);
107 void OnShiftDisplayRight(bool accel = false);
108 void OnShiftDisplayUp(bool accel = false);
109 void OnZoomIn(bool accel = false);
110 void OnZoomOut(bool accel = false);
111 void OnToggleScalebar();
112 void OnToggleColourKey();
113 void OnViewCompass();
114 void OnViewClino();
115 void OnViewGrid();
116 void OnReverseDirectionOfRotation();
117 void OnShowEntrances();
118 void OnShowFixedPts();
119 void OnShowExportedPts();
120 void OnCancelDistLine();
121 void OnMouseMove(wxMouseEvent& event);
122 void OnLButtonDown(wxMouseEvent& event);
123 void OnLButtonUp(wxMouseEvent& event);
124 void OnMButtonDown(wxMouseEvent& event);
125 void OnMButtonUp(wxMouseEvent& event);
126 void OnRButtonDown(wxMouseEvent& event);
127 void OnRButtonUp(wxMouseEvent& event);
128 void OnMouseWheel(wxMouseEvent& event);
129 void OnKeyPress(wxKeyEvent &e);
131 void OnDisplayOverlappingNamesUpdate(wxUpdateUIEvent&);
132 void OnColourByUpdate(wxUpdateUIEvent&);
133 void OnColourByDepthUpdate(wxUpdateUIEvent&);
134 void OnColourByDateUpdate(wxUpdateUIEvent&);
135 void OnColourByErrorUpdate(wxUpdateUIEvent&);
136 void OnColourByGradientUpdate(wxUpdateUIEvent&);
137 void OnColourByLengthUpdate(wxUpdateUIEvent&);
138 void OnColourBySurveyUpdate(wxUpdateUIEvent&);
139 void OnShowCrossesUpdate(wxUpdateUIEvent&);
140 void OnShowStationNamesUpdate(wxUpdateUIEvent&);
141 void OnShowSurveyLegsUpdate(wxUpdateUIEvent&);
142 void OnSplaysUpdate(wxUpdateUIEvent&);
143 void OnHideSplaysUpdate(wxUpdateUIEvent&);
144 void OnShowSplaysDashedUpdate(wxUpdateUIEvent&);
145 void OnShowSplaysFadedUpdate(wxUpdateUIEvent&);
146 void OnShowSplaysNormalUpdate(wxUpdateUIEvent&);
147 void OnDupesUpdate(wxUpdateUIEvent&);
148 void OnHideDupesUpdate(wxUpdateUIEvent&);
149 void OnShowDupesDashedUpdate(wxUpdateUIEvent&);
150 void OnShowDupesFadedUpdate(wxUpdateUIEvent&);
151 void OnShowDupesNormalUpdate(wxUpdateUIEvent&);
152 void OnShowSurfaceUpdate(wxUpdateUIEvent&);
153 void OnMoveEastUpdate(wxUpdateUIEvent&);
154 void OnMoveNorthUpdate(wxUpdateUIEvent&);
155 void OnMoveSouthUpdate(wxUpdateUIEvent&);
156 void OnMoveWestUpdate(wxUpdateUIEvent&);
157 void OnToggleRotationUpdate(wxUpdateUIEvent&);
158 void OnReverseControlsUpdate(wxUpdateUIEvent&);
159 void OnReverseDirectionOfRotationUpdate(wxUpdateUIEvent&);
160 void OnDefaultsUpdate(wxUpdateUIEvent&);
161 void OnElevationUpdate(wxUpdateUIEvent&);
162 void OnPlanUpdate(wxUpdateUIEvent&);
163 void OnToggleScalebarUpdate(wxUpdateUIEvent&);
164 void OnToggleColourKeyUpdate(wxUpdateUIEvent&);
165 void OnViewCompassUpdate(wxUpdateUIEvent&);
166 void OnViewClinoUpdate(wxUpdateUIEvent&);
167 void OnViewGridUpdate(wxUpdateUIEvent&);
168 void OnShowEntrancesUpdate(wxUpdateUIEvent&);
169 void OnShowExportedPtsUpdate(wxUpdateUIEvent&);
170 void OnShowFixedPtsUpdate(wxUpdateUIEvent&);
172 void OnIndicatorsUpdate(wxUpdateUIEvent&);
173 void OnCancelDistLineUpdate(wxUpdateUIEvent&);
175 void OnViewPerspective();
176 void OnViewPerspectiveUpdate(wxUpdateUIEvent& cmd);
178 void OnViewSmoothShading();
179 void OnViewSmoothShadingUpdate(wxUpdateUIEvent& cmd);
181 void OnViewTextured();
182 void OnViewTexturedUpdate(wxUpdateUIEvent& cmd);
184 void OnViewFog();
185 void OnViewFogUpdate(wxUpdateUIEvent& cmd);
187 void OnViewSmoothLines();
188 void OnViewSmoothLinesUpdate(wxUpdateUIEvent& cmd);
190 void OnToggleMetric();
191 void OnToggleMetricUpdate(wxUpdateUIEvent& cmd);
193 void OnToggleDegrees();
194 void OnToggleDegreesUpdate(wxUpdateUIEvent& cmd);
196 void OnTogglePercent();
197 void OnTogglePercentUpdate(wxUpdateUIEvent& cmd);
199 void OnToggleTubes();
200 void OnToggleTubesUpdate(wxUpdateUIEvent& cmd);
202 void OnViewFullScreenUpdate(wxUpdateUIEvent&);
203 void OnViewFullScreen();
205 void OnViewBoundingBoxUpdate(wxUpdateUIEvent&);
206 void OnViewBoundingBox();
208 void OnViewTerrainUpdate(wxUpdateUIEvent&);
209 void OnViewTerrain();
212 #endif