source: git/src/mainfrm.h @ e840570

Last change on this file since e840570 was e840570, checked in by Olly Betts <olly@…>, 9 months ago

Drop support for wxWidgets < 3.0

3.0.0 was released over 5 years ago and should be easily available
everywhere by now.

I'm no longer easily able to test with wxWidgets 2.8, and this allows
a significant amount of cruft to be removed.

  • Property mode set to 100644
File size: 20.1 KB
Line 
1//
2//  mainfrm.h
3//
4//  Main frame handling for Aven.
5//
6//  Copyright (C) 2000-2003,2005 Mark R. Shinwell
7//  Copyright (C) 2001-2003,2004,2005,2006,2010,2011,2012,2013,2014,2015,2016,2018 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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
22//
23
24#ifndef mainfrm_h
25#define mainfrm_h
26
27#include "wx.h"
28#include <wx/docview.h> // for m_FileHistory
29#include <wx/listctrl.h>
30#include <wx/notebook.h>
31#include <wx/print.h>
32#include <wx/printdlg.h>
33
34#include "aventreectrl.h"
35#include "gfxcore.h"
36#include "guicontrol.h"
37#include "img_hosted.h"
38#include "labelinfo.h"
39#include "message.h"
40#include "model.h"
41#include "vector3.h"
42#include "aven.h"
43//#include "prefsdlg.h"
44
45#include <list>
46#include <vector>
47
48using namespace std;
49
50#include <math.h>
51#include <time.h>
52
53#ifdef __WXMAC__
54// Currently on OS X, we force use of a generic toolbar, which needs to be put
55// in a sizer.
56# define USING_GENERIC_TOOLBAR
57#endif
58
59#define MARK_FIRST 1
60#define MARK_NEXT 2
61#define MARK_PREV 3
62
63enum {
64    menu_FILE_LOG = 1000,
65    menu_FILE_OPEN_TERRAIN,
66    menu_FILE_PAGE_SETUP,
67    menu_FILE_SCREENSHOT,
68    menu_FILE_EXPORT,
69    menu_FILE_EXTEND,
70    menu_PRES_NEW,
71    menu_PRES_OPEN,
72    menu_PRES_SAVE,
73    menu_PRES_SAVE_AS,
74    menu_PRES_MARK,
75    menu_PRES_EXPORT_MOVIE,
76    menu_PRES_FREWIND,
77    menu_PRES_REWIND,
78    menu_PRES_REVERSE,
79    menu_PRES_PLAY,
80    menu_PRES_FF,
81    menu_PRES_FFF,
82    menu_PRES_PAUSE,
83    menu_ROTATION_START,
84    menu_ROTATION_STOP,
85    menu_ROTATION_TOGGLE,
86    menu_ROTATION_REVERSE,
87    menu_ORIENT_MOVE_NORTH,
88    menu_ORIENT_MOVE_EAST,
89    menu_ORIENT_MOVE_SOUTH,
90    menu_ORIENT_MOVE_WEST,
91    menu_ORIENT_PLAN,
92    menu_ORIENT_ELEVATION,
93    menu_ORIENT_DEFAULTS,
94    menu_VIEW_SHOW_LEGS,
95    menu_VIEW_SPLAYS,
96    menu_SPLAYS_HIDE,
97    menu_SPLAYS_SHOW_DASHED,
98    menu_SPLAYS_SHOW_FADED,
99    menu_SPLAYS_SHOW_NORMAL,
100    menu_VIEW_DUPES,
101    menu_DUPES_HIDE,
102    menu_DUPES_SHOW_DASHED,
103    menu_DUPES_SHOW_FADED,
104    menu_DUPES_SHOW_NORMAL,
105    menu_VIEW_SHOW_CROSSES,
106    menu_VIEW_SHOW_NAMES,
107    menu_VIEW_SHOW_SURFACE,
108    menu_VIEW_SHOW_OVERLAPPING_NAMES,
109    menu_VIEW_SHOW_ENTRANCES,
110    menu_VIEW_SHOW_FIXED_PTS,
111    menu_VIEW_SHOW_EXPORTED_PTS,
112    menu_VIEW_STATUS_BAR,
113    menu_VIEW_GRID,
114    menu_VIEW_BOUNDING_BOX,
115    menu_VIEW_TERRAIN,
116    menu_VIEW_SHOW_TUBES,
117    menu_VIEW_PERSPECTIVE,
118    menu_VIEW_SMOOTH_SHADING,
119    menu_VIEW_TEXTURED,
120    menu_VIEW_FOG,
121    menu_VIEW_SMOOTH_LINES,
122    menu_VIEW_FULLSCREEN,
123    menu_VIEW_COLOUR_BY,
124    menu_COLOUR_BY_DEPTH,
125    menu_COLOUR_BY_DATE,
126    menu_COLOUR_BY_ERROR,
127    menu_COLOUR_BY_GRADIENT,
128    menu_COLOUR_BY_LENGTH,
129    menu_COLOUR_BY_SURVEY,
130    menu_IND_COMPASS,
131    menu_IND_CLINO,
132    menu_IND_COLOUR_KEY,
133    menu_IND_SCALE_BAR,
134    menu_CTL_INDICATORS,
135    menu_CTL_SIDE_PANEL,
136    menu_CTL_METRIC,
137    menu_CTL_DEGREES,
138    menu_CTL_PERCENT,
139    menu_CTL_REVERSE,
140    menu_CTL_CANCEL_DIST_LINE,
141    menu_SURVEY_RESTRICT,
142    menu_SURVEY_SHOW_ALL,
143    menu_SURVEY_HIDE,
144    menu_SURVEY_SHOW,
145    menu_SURVEY_HIDE_SIBLINGS,
146    textctrl_FIND,
147    button_HIDE,
148    listctrl_PRES
149};
150
151class AvenPresList;
152
153class MainFrm : public wxFrame, public Model {
154    wxFileHistory m_history;
155    int m_SashPosition;
156    bool was_showing_sidepanel_before_fullscreen;
157    GfxCore* m_Gfx;
158    wxWindow* m_Log;
159    GUIControl* m_Control;
160    wxSplitterWindow* m_Splitter;
161    AvenTreeCtrl* m_Tree;
162    wxTextCtrl* m_FindBox;
163    // wxCheckBox* m_RegexpCheckBox;
164    wxNotebook* m_Notebook;
165    AvenPresList* m_PresList;
166    wxString m_File;
167    // Processed version of data - same as m_File if m_File is processed data.
168    wxString m_FileProcessed;
169    wxString m_Survey;
170
171    // Strings for status bar reporting of distances.
172    wxString here_text, coords_text, dist_text, distfree_text;
173
174    int m_NumHighlighted = 0;
175    bool pending_find;
176
177    bool fullscreen_showing_menus;
178
179#ifdef PREFDLG
180    PrefsDlg* m_PrefsDlg;
181#endif
182
183    bool ProcessSVXFile(const wxString & file);
184//    void FixLRUD(traverse & centreline);
185
186    void CreateMenuBar();
187    void MakeToolBar();
188    void CreateSidePanel();
189
190    void UpdateStatusBar();
191
192#ifdef USING_GENERIC_TOOLBAR
193    wxToolBar * GetToolBar() const {
194        wxSizer * sizer = GetSizer();
195        if (!sizer) return NULL;
196        return (wxToolBar*)sizer->GetItem(size_t(0))->GetWindow();
197    }
198#endif
199
200public:
201    MainFrm(const wxString& title, const wxPoint& pos, const wxSize& size);
202
203    // public for CavernLog.
204    bool LoadData(const wxString& file, const wxString& prefix);
205    void AddToFileHistory(const wxString & file);
206
207    void InitialiseAfterLoad(const wxString & file, const wxString & prefix);
208    void OnShowLog(wxCommandEvent& event);
209
210    void OnMRUFile(wxCommandEvent& event);
211    void OpenFile(const wxString& file, const wxString& survey = wxString());
212
213    void OnPresNewUpdate(wxUpdateUIEvent& event);
214    void OnPresOpenUpdate(wxUpdateUIEvent& event);
215    void OnPresSaveUpdate(wxUpdateUIEvent& event);
216    void OnPresSaveAsUpdate(wxUpdateUIEvent& event);
217    void OnPresMarkUpdate(wxUpdateUIEvent& event);
218    void OnPresFRewindUpdate(wxUpdateUIEvent& event);
219    void OnPresRewindUpdate(wxUpdateUIEvent& event);
220    void OnPresReverseUpdate(wxUpdateUIEvent& event);
221    void OnPresPlayUpdate(wxUpdateUIEvent& event);
222    void OnPresFFUpdate(wxUpdateUIEvent& event);
223    void OnPresFFFUpdate(wxUpdateUIEvent& event);
224    void OnPresPauseUpdate(wxUpdateUIEvent& event);
225    void OnPresStopUpdate(wxUpdateUIEvent& event);
226    void OnPresExportMovieUpdate(wxUpdateUIEvent& event);
227    void OnOpenTerrainUpdate(wxUpdateUIEvent& event);
228
229    void DoFind();
230    void OnFind(wxCommandEvent& event);
231    void OnIdle(wxIdleEvent& event);
232    void OnGotoFound(wxCommandEvent& event);
233    void OnHide(wxCommandEvent& event);
234    void OnHideUpdate(wxUpdateUIEvent& ui);
235
236    void OnOpen(wxCommandEvent& event);
237    void OnOpenTerrain(wxCommandEvent&);
238    void HideLog(wxWindow * log_window);
239    void OnScreenshot(wxCommandEvent& event);
240    void OnScreenshotUpdate(wxUpdateUIEvent& event);
241    void OnFilePreferences(wxCommandEvent& event);
242    void OnPrint(wxCommandEvent& event);
243    void PrintAndExit();
244    void OnPageSetup(wxCommandEvent& event);
245    void OnPresNew(wxCommandEvent& event);
246    void OnPresOpen(wxCommandEvent& event);
247    void OnPresSave(wxCommandEvent& event);
248    void OnPresSaveAs(wxCommandEvent& event);
249    void OnPresMark(wxCommandEvent& event);
250    void OnPresFRewind(wxCommandEvent& event);
251    void OnPresRewind(wxCommandEvent& event);
252    void OnPresReverse(wxCommandEvent& event);
253    void OnPresPlay(wxCommandEvent& event);
254    void OnPresFF(wxCommandEvent& event);
255    void OnPresFFF(wxCommandEvent& event);
256    void OnPresPause(wxCommandEvent& event);
257    void OnPresStop(wxCommandEvent& event);
258    void OnPresExportMovie(wxCommandEvent& event);
259    void OnExport(wxCommandEvent& event);
260    void OnExtend(wxCommandEvent& event);
261    void OnQuit(wxCommandEvent& event);
262
263    void OnAbout(wxCommandEvent& event);
264    void OnClose(wxCloseEvent&);
265
266    void OnSetFocus(wxFocusEvent &) { if (m_Gfx) m_Gfx->SetFocus(); }
267
268    void OnKeyPress(wxKeyEvent &e) {
269        if (m_Gfx) {
270            m_Gfx->SetFocus();
271            m_Gfx->OnKeyPress(e);
272        }
273    }
274
275    void OnShowLogUpdate(wxUpdateUIEvent &ui) {
276        ui.Enable(m_Log != NULL || (m_Splitter->GetWindow1() != m_Gfx && m_Splitter->GetWindow2() != m_Gfx));
277        ui.Check(m_Log == NULL);
278    }
279    void OnPrintUpdate(wxUpdateUIEvent &ui) { ui.Enable(!m_File.empty()); }
280    void OnExportUpdate(wxUpdateUIEvent &ui) { ui.Enable(!m_File.empty()); }
281    void OnExtendUpdate(wxUpdateUIEvent &ui) {
282        ui.Enable(!IsExtendedElevation());
283    }
284
285    // temporary bodges until event handling problem is sorted out:
286    void OnDefaultsUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnDefaultsUpdate(event); }
287    void OnPlanUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnPlanUpdate(event); }
288    void OnElevationUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnElevationUpdate(event); }
289    void OnDisplayOverlappingNamesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnDisplayOverlappingNamesUpdate(event); }
290    void OnColourByUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnColourByUpdate(event); }
291    void OnColourByDepthUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnColourByDepthUpdate(event); }
292    void OnColourByDateUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnColourByDateUpdate(event); }
293    void OnColourByErrorUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnColourByErrorUpdate(event); }
294    void OnColourByGradientUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnColourByGradientUpdate(event); }
295    void OnColourByLengthUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnColourByLengthUpdate(event); }
296    void OnColourBySurveyUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnColourBySurveyUpdate(event); }
297    void OnShowCrossesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowCrossesUpdate(event); }
298    void OnShowEntrancesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowEntrancesUpdate(event); }
299    void OnShowFixedPtsUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowFixedPtsUpdate(event); }
300    void OnShowExportedPtsUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowExportedPtsUpdate(event); }
301    void OnShowStationNamesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowStationNamesUpdate(event); }
302    void OnShowSurveyLegsUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowSurveyLegsUpdate(event); }
303    void OnSplaysUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnSplaysUpdate(event); }
304    void OnHideSplaysUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnHideSplaysUpdate(event); }
305    void OnShowSplaysDashedUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowSplaysDashedUpdate(event); }
306    void OnShowSplaysFadedUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowSplaysFadedUpdate(event); }
307    void OnShowSplaysNormalUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowSplaysNormalUpdate(event); }
308    void OnDupesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnDupesUpdate(event); }
309    void OnHideDupesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnHideDupesUpdate(event); }
310    void OnShowDupesDashedUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowDupesDashedUpdate(event); }
311    void OnShowDupesFadedUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowDupesFadedUpdate(event); }
312    void OnShowDupesNormalUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowDupesNormalUpdate(event); }
313    void OnShowSurfaceUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnShowSurfaceUpdate(event); }
314    void OnMoveEastUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnMoveEastUpdate(event); }
315    void OnMoveNorthUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnMoveNorthUpdate(event); }
316    void OnMoveSouthUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnMoveSouthUpdate(event); }
317    void OnMoveWestUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnMoveWestUpdate(event); }
318    void OnToggleRotationUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnToggleRotationUpdate(event); }
319    void OnReverseControlsUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnReverseControlsUpdate(event); }
320    void OnToggleScalebarUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnToggleScalebarUpdate(event); }
321    void OnToggleColourKeyUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnToggleColourKeyUpdate(event); }
322    void OnViewCompassUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewCompassUpdate(event); }
323    void OnViewGridUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewGridUpdate(event); }
324    void OnViewBoundingBoxUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewBoundingBoxUpdate(event); }
325    void OnViewTerrainUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewTerrainUpdate(event); }
326    void OnViewClinoUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewClinoUpdate(event); }
327    void OnViewPerspectiveUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewPerspectiveUpdate(event); }
328    void OnViewSmoothShadingUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewSmoothShadingUpdate(event); }
329    void OnViewTexturedUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewTexturedUpdate(event); }
330    void OnViewFogUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewFogUpdate(event); }
331    void OnViewSmoothLinesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewSmoothLinesUpdate(event); }
332    void OnViewFullScreenUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnViewFullScreenUpdate(event); }
333    void OnReverseDirectionOfRotationUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnReverseDirectionOfRotationUpdate(event); }
334    void OnCancelDistLineUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnCancelDistLineUpdate(event); }
335    void OnIndicatorsUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnIndicatorsUpdate(event); }
336
337    void OnDefaults(wxCommandEvent&) { if (m_Control) m_Control->OnDefaults(); }
338    void OnPlan(wxCommandEvent&) { if (m_Control) m_Control->OnPlan(); }
339    void OnElevation(wxCommandEvent&) { if (m_Control) m_Control->OnElevation(); }
340    void OnDisplayOverlappingNames(wxCommandEvent&) { if (m_Control) m_Control->OnDisplayOverlappingNames(); }
341    void OnColourByDepth(wxCommandEvent&) { if (m_Control) m_Control->OnColourByDepth(); }
342    void OnColourByDate(wxCommandEvent&) { if (m_Control) m_Control->OnColourByDate(); }
343    void OnColourByError(wxCommandEvent&) { if (m_Control) m_Control->OnColourByError(); }
344    void OnColourByGradient(wxCommandEvent&) { if (m_Control) m_Control->OnColourByGradient(); }
345    void OnColourByLength(wxCommandEvent&) { if (m_Control) m_Control->OnColourByLength(); }
346    void OnColourBySurvey(wxCommandEvent&) { if (m_Control) m_Control->OnColourBySurvey(); }
347    void OnShowCrosses(wxCommandEvent&) { if (m_Control) m_Control->OnShowCrosses(); }
348    void OnShowEntrances(wxCommandEvent&) { if (m_Control) m_Control->OnShowEntrances(); }
349    void OnShowFixedPts(wxCommandEvent&) { if (m_Control) m_Control->OnShowFixedPts(); }
350    void OnShowExportedPts(wxCommandEvent&) { if (m_Control) m_Control->OnShowExportedPts(); }
351    void OnShowStationNames(wxCommandEvent&) { if (m_Control) m_Control->OnShowStationNames(); }
352    void OnShowSurveyLegs(wxCommandEvent&) { if (m_Control) m_Control->OnShowSurveyLegs(); }
353    void OnHideSplays(wxCommandEvent&) { if (m_Control) m_Control->OnHideSplays(); }
354    void OnShowSplaysDashed(wxCommandEvent&) { if (m_Control) m_Control->OnShowSplaysDashed(); }
355    void OnShowSplaysFaded(wxCommandEvent&) { if (m_Control) m_Control->OnShowSplaysFaded(); }
356    void OnShowSplaysNormal(wxCommandEvent&) { if (m_Control) m_Control->OnShowSplaysNormal(); }
357    void OnHideDupes(wxCommandEvent&) { if (m_Control) m_Control->OnHideDupes(); }
358    void OnShowDupesDashed(wxCommandEvent&) { if (m_Control) m_Control->OnShowDupesDashed(); }
359    void OnShowDupesFaded(wxCommandEvent&) { if (m_Control) m_Control->OnShowDupesFaded(); }
360    void OnShowDupesNormal(wxCommandEvent&) { if (m_Control) m_Control->OnShowDupesNormal(); }
361    void OnShowSurface(wxCommandEvent&) { if (m_Control) m_Control->OnShowSurface(); }
362    void OnMoveEast(wxCommandEvent&) { if (m_Control) m_Control->OnMoveEast(); }
363    void OnMoveNorth(wxCommandEvent&) { if (m_Control) m_Control->OnMoveNorth(); }
364    void OnMoveSouth(wxCommandEvent&) { if (m_Control) m_Control->OnMoveSouth(); }
365    void OnMoveWest(wxCommandEvent&) { if (m_Control) m_Control->OnMoveWest(); }
366    void OnToggleRotation(wxCommandEvent&) { if (m_Control) m_Control->OnToggleRotation(); }
367    void OnReverseControls(wxCommandEvent&) { if (m_Control) m_Control->OnReverseControls(); }
368    void OnToggleScalebar(wxCommandEvent&) { if (m_Control) m_Control->OnToggleScalebar(); }
369    void OnToggleColourKey(wxCommandEvent&) { if (m_Control) m_Control->OnToggleColourKey(); }
370    void OnViewCompass(wxCommandEvent&) { if (m_Control) m_Control->OnViewCompass(); }
371    void OnViewClino(wxCommandEvent&) { if (m_Control) m_Control->OnViewClino(); }
372    void OnViewGrid(wxCommandEvent&) { if (m_Control) m_Control->OnViewGrid(); }
373    void OnViewBoundingBox(wxCommandEvent&) { if (m_Control) m_Control->OnViewBoundingBox(); }
374    void OnViewTerrain(wxCommandEvent&) { if (m_Control) m_Control->OnViewTerrain(); }
375    void OnViewPerspective(wxCommandEvent&) { if (m_Control) m_Control->OnViewPerspective(); }
376    void OnViewSmoothShading(wxCommandEvent&) { if (m_Control) m_Control->OnViewSmoothShading(); }
377    void OnViewTextured(wxCommandEvent&) { if (m_Control) m_Control->OnViewTextured(); }
378    void OnViewFog(wxCommandEvent&) { if (m_Control) m_Control->OnViewFog(); }
379    void OnViewSmoothLines(wxCommandEvent&) { if (m_Control) m_Control->OnViewSmoothLines(); }
380    void OnViewFullScreen(wxCommandEvent&) { ViewFullScreen(); }
381    void ViewFullScreen();
382    bool FullScreenModeShowingMenus() const;
383    void FullScreenModeShowMenus(bool show);
384    void OnReverseDirectionOfRotation(wxCommandEvent&) { if (m_Control) m_Control->OnReverseDirectionOfRotation(); }
385    void OnCancelDistLine(wxCommandEvent&) { if (m_Control) m_Control->OnCancelDistLine(); }
386
387    void OnToggleMetric(wxCommandEvent&) { if (m_Control) m_Control->OnToggleMetric(); }
388    void OnToggleDegrees(wxCommandEvent&) { if (m_Control) m_Control->OnToggleDegrees(); }
389    void OnTogglePercent(wxCommandEvent&) { if (m_Control) m_Control->OnTogglePercent(); }
390    void OnToggleTubes(wxCommandEvent&) { if (m_Control) m_Control->OnToggleTubes(); }
391
392    void OnToggleMetricUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnToggleMetricUpdate(event); }
393    void OnToggleDegreesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnToggleDegreesUpdate(event); }
394    void OnTogglePercentUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnTogglePercentUpdate(event); }
395    void OnToggleTubesUpdate(wxUpdateUIEvent& event) { if (m_Control) m_Control->OnToggleTubesUpdate(event); }
396
397    // end of horrible bodges
398
399    void OnViewSidePanelUpdate(wxUpdateUIEvent& event);
400    void OnViewSidePanel(wxCommandEvent& event);
401    void ToggleSidePanel();
402    bool ShowingSidePanel();
403
404    void SelectTreeItem(const LabelInfo* label) {
405        if (label->tree_id.IsOk())
406            m_Tree->SelectItem(label->tree_id);
407        else
408            m_Tree->UnselectAll();
409    }
410
411    void ClearTreeSelection();
412
413    void ClearCoords();
414    void SetCoords(const Vector3 &v);
415    const LabelInfo * GetTreeSelection() const;
416    void SetCoords(Double x, Double y, const LabelInfo * there);
417    void SetAltitude(Double z, const LabelInfo * there);
418
419    void ShowInfo(const LabelInfo *here = NULL, const LabelInfo *there = NULL);
420    void DisplayTreeInfo(const wxTreeItemData* data = NULL);
421    void TreeItemSelected(const wxTreeItemData* data);
422    PresentationMark GetPresMark(int which);
423    bool Animating() const { return m_Gfx && m_Gfx->Animating(); }
424
425    // Restrict to subsurvey `survey` (or show all if `survey` empty).
426    void RestrictTo(const wxString & survey);
427
428    wxString GetSurvey() const { return m_Survey; }
429
430    int GetNumHighlightedPts() const { return m_NumHighlighted; }
431
432    const SurveyFilter* GetTreeFilter() const { return m_Tree->GetFilter(); }
433
434    // Used when the tree filters change.  FIXME: Overkill?
435    void ForceFullRedraw() {
436        m_Gfx->InvalidateAllLists();
437        m_Gfx->ForceRefresh();
438    }
439
440private:
441    DECLARE_EVENT_TABLE()
442};
443
444#endif
Note: See TracBrowser for help on using the repository browser.