source: git/src/guicontrol.h @ 8dfcf6c

RELEASE/1.1RELEASE/1.2debug-cidebug-ci-sanitisersfaster-cavernlogstereowalls-datawalls-data-hanging-as-warning
Last change on this file since 8dfcf6c was 2072157, checked in by Olly Betts <olly@…>, 18 years ago

Clean up code to use wxEvent::GetPosition?() where appropriate.
Fix measuring line to update when a drag ends.

git-svn-id: file:///home/survex-svn/survex/branches/survex-1_1@3273 4b37db11-9a0c-4f06-9ece-9ab7cdaee568

  • Property mode set to 100644
File size: 6.0 KB
Line 
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 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.
13//
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.
18//
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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
22//
23
24#ifndef guicontrol_h
25#define guicontrol_h
26
27#include "wx.h"
28
29class GfxCore;
30
31class GUIControl {
32    GfxCore* m_View;
33
34    enum { NO_DRAG = 0, LEFT_DRAG, MIDDLE_DRAG, RIGHT_DRAG } dragging;
35
36    wxPoint m_DragStart;
37    wxPoint m_DragRealStart;
38    wxPoint m_DragLast;
39
40    enum { drag_NONE, drag_MAIN, drag_COMPASS, drag_ELEV, drag_SCALE } m_LastDrag;
41
42    enum { NONE, ROTATE, SCALE } m_ScaleRotateLock;
43
44    bool m_ReverseControls;
45
46    void HandleRotate(wxPoint);
47    void HandleTilt(wxPoint);
48    void HandleTranslate(wxPoint);
49    void HandleScaleRotate(wxPoint);
50    void HandleTiltRotate(wxPoint);
51
52    void HandCursor();
53    void RestoreCursor();
54
55    void HandleNonDrag(const wxPoint & point);
56
57public:
58    GUIControl();
59    ~GUIControl();
60
61    void SetView(GfxCore* view);
62
63    bool MouseDown() const;
64
65    void OnDefaults();
66    void OnPlan();
67    void OnElevation();
68    void OnDisplayOverlappingNames();
69    void OnColourByDepth();
70    void OnColourByDate();
71    void OnShowCrosses();
72    void OnShowStationNames();
73    void OnShowSurveyLegs();
74    void OnShowSurface();
75    void OnMoveEast();
76    void OnMoveNorth();
77    void OnMoveSouth();
78    void OnMoveWest();
79    void OnToggleRotation();
80    void OnReverseControls();
81    void OnSlowDown(bool accel = false);
82    void OnSpeedUp(bool accel = false);
83    void OnStepOnceAnticlockwise(bool accel = false);
84    void OnStepOnceClockwise(bool accel = false);
85    void OnHigherViewpoint(bool accel = false);
86    void OnLowerViewpoint(bool accel = false);
87    void OnShiftDisplayDown(bool accel = false);
88    void OnShiftDisplayLeft(bool accel = false);
89    void OnShiftDisplayRight(bool accel = false);
90    void OnShiftDisplayUp(bool accel = false);
91    void OnZoomIn(bool accel = false);
92    void OnZoomOut(bool accel = false);
93    void OnToggleScalebar();
94    void OnToggleDepthbar();
95    void OnViewCompass();
96    void OnViewClino();
97    void OnViewGrid();
98    void OnReverseDirectionOfRotation();
99    void OnShowEntrances();
100    void OnShowFixedPts();
101    void OnShowExportedPts();
102    void OnCancelDistLine();
103    void OnMouseMove(wxMouseEvent& event);
104    void OnLButtonDown(wxMouseEvent& event);
105    void OnLButtonUp(wxMouseEvent& event);
106    void OnMButtonDown(wxMouseEvent& event);
107    void OnMButtonUp(wxMouseEvent& event);
108    void OnRButtonDown(wxMouseEvent& event);
109    void OnRButtonUp(wxMouseEvent& event);
110    void OnMouseWheel(wxMouseEvent& event);
111    void OnKeyPress(wxKeyEvent &e);
112
113    void OnDisplayOverlappingNamesUpdate(wxUpdateUIEvent&);
114    void OnColourByDepthUpdate(wxUpdateUIEvent&);
115    void OnColourByDateUpdate(wxUpdateUIEvent&);
116    void OnShowCrossesUpdate(wxUpdateUIEvent&);
117    void OnShowStationNamesUpdate(wxUpdateUIEvent&);
118    void OnShowSurveyLegsUpdate(wxUpdateUIEvent&);
119    void OnShowSurfaceUpdate(wxUpdateUIEvent&);
120    void OnMoveEastUpdate(wxUpdateUIEvent&);
121    void OnMoveNorthUpdate(wxUpdateUIEvent&);
122    void OnMoveSouthUpdate(wxUpdateUIEvent&);
123    void OnMoveWestUpdate(wxUpdateUIEvent&);
124    void OnToggleRotationUpdate(wxUpdateUIEvent&);
125    void OnReverseControlsUpdate(wxUpdateUIEvent&);
126    void OnReverseDirectionOfRotationUpdate(wxUpdateUIEvent&);
127    void OnSlowDownUpdate(wxUpdateUIEvent&);
128    void OnSpeedUpUpdate(wxUpdateUIEvent&);
129    void OnStepOnceAnticlockwiseUpdate(wxUpdateUIEvent&);
130    void OnStepOnceClockwiseUpdate(wxUpdateUIEvent&);
131    void OnDefaultsUpdate(wxUpdateUIEvent&);
132    void OnElevationUpdate(wxUpdateUIEvent&);
133    void OnHigherViewpointUpdate(wxUpdateUIEvent&);
134    void OnLowerViewpointUpdate(wxUpdateUIEvent&);
135    void OnPlanUpdate(wxUpdateUIEvent&);
136    void OnShiftDisplayDownUpdate(wxUpdateUIEvent&);
137    void OnShiftDisplayLeftUpdate(wxUpdateUIEvent&);
138    void OnShiftDisplayRightUpdate(wxUpdateUIEvent&);
139    void OnShiftDisplayUpUpdate(wxUpdateUIEvent&);
140    void OnZoomInUpdate(wxUpdateUIEvent&);
141    void OnZoomOutUpdate(wxUpdateUIEvent&);
142    void OnToggleScalebarUpdate(wxUpdateUIEvent&);
143    void OnToggleDepthbarUpdate(wxUpdateUIEvent&);
144    void OnViewCompassUpdate(wxUpdateUIEvent&);
145    void OnViewClinoUpdate(wxUpdateUIEvent&);
146    void OnViewGridUpdate(wxUpdateUIEvent&);
147    void OnShowEntrancesUpdate(wxUpdateUIEvent&);
148    void OnShowExportedPtsUpdate(wxUpdateUIEvent&);
149    void OnShowFixedPtsUpdate(wxUpdateUIEvent&);
150
151    void OnIndicatorsUpdate(wxUpdateUIEvent&);
152    void OnCancelDistLineUpdate(wxUpdateUIEvent&);
153
154    void OnViewPerspective();
155    void OnViewPerspectiveUpdate(wxUpdateUIEvent& cmd);
156
157    void OnViewSmoothShading();
158    void OnViewSmoothShadingUpdate(wxUpdateUIEvent& cmd);
159
160    void OnViewTextured();
161    void OnViewTexturedUpdate(wxUpdateUIEvent& cmd);
162
163    void OnViewFog();
164    void OnViewFogUpdate(wxUpdateUIEvent& cmd);
165
166    void OnViewSmoothLines();
167    void OnViewSmoothLinesUpdate(wxUpdateUIEvent& cmd);
168
169    void OnToggleMetric();
170    void OnToggleMetricUpdate(wxUpdateUIEvent& cmd);
171
172    void OnToggleDegrees();
173    void OnToggleDegreesUpdate(wxUpdateUIEvent& cmd);
174
175    void OnToggleTubes();
176    void OnToggleTubesUpdate(wxUpdateUIEvent& cmd);
177
178    void OnViewFullScreenUpdate(wxUpdateUIEvent&);
179    void OnViewFullScreen();
180
181    void OnViewBoundingBoxUpdate(wxUpdateUIEvent&);
182    void OnViewBoundingBox();
183};
184
185#endif
Note: See TracBrowser for help on using the repository browser.