4 // Main frame handling for Aven.
6 // Copyright (C) 2000-2003,2005 Mark R. Shinwell
7 // Copyright (C) 2001-2003,2004,2005,2006,2010,2011,2012,2013,2014,2015,2016 Olly Betts
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
28 #include <wx/docview.h> // for m_FileHistory
29 #include <wx/listctrl.h>
30 #include <wx/notebook.h>
32 #include <wx/printdlg.h>
34 #include "aventreectrl.h"
36 #include "guicontrol.h"
37 #include "img_hosted.h"
38 #include "labelinfo.h"
43 //#include "prefsdlg.h"
54 // Currently on OS X, we force use of a generic toolbar, which needs to be put
56 # define USING_GENERIC_TOOLBAR
65 menu_FILE_OPEN_TERRAIN
,
75 menu_PRES_EXPORT_MOVIE
,
86 menu_ROTATION_REVERSE
,
87 menu_ORIENT_MOVE_NORTH
,
88 menu_ORIENT_MOVE_EAST
,
89 menu_ORIENT_MOVE_SOUTH
,
90 menu_ORIENT_MOVE_WEST
,
92 menu_ORIENT_ELEVATION
,
97 menu_SPLAYS_SHOW_DASHED
,
98 menu_SPLAYS_SHOW_FADED
,
99 menu_SPLAYS_SHOW_NORMAL
,
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
,
114 menu_VIEW_BOUNDING_BOX
,
116 menu_VIEW_SHOW_TUBES
,
117 menu_VIEW_PERSPECTIVE
,
118 menu_VIEW_SMOOTH_SHADING
,
121 menu_VIEW_SMOOTH_LINES
,
122 menu_VIEW_FULLSCREEN
,
124 menu_COLOUR_BY_DEPTH
,
126 menu_COLOUR_BY_ERROR
,
127 menu_COLOUR_BY_GRADIENT
,
128 menu_COLOUR_BY_LENGTH
,
139 menu_CTL_CANCEL_DIST_LINE
,
140 menu_SURVEY_RESTRICT
,
141 menu_SURVEY_SHOW_ALL
,
149 class MainFrm
: public wxFrame
, public Model
{
150 wxFileHistory m_history
;
152 bool was_showing_sidepanel_before_fullscreen
;
155 GUIControl
* m_Control
;
156 wxSplitterWindow
* m_Splitter
;
157 AvenTreeCtrl
* m_Tree
;
158 wxTextCtrl
* m_FindBox
;
159 // wxCheckBox* m_RegexpCheckBox;
160 wxNotebook
* m_Notebook
;
161 AvenPresList
* m_PresList
;
163 // Processed version of data - same as m_File if m_File is processed data.
164 wxString m_FileProcessed
;
167 // Strings for status bar reporting of distances.
168 wxString here_text
, coords_text
, dist_text
, distfree_text
;
170 int m_NumHighlighted
= 0;
173 bool fullscreen_showing_menus
;
176 PrefsDlg
* m_PrefsDlg
;
179 void FillTree(const wxString
& root_name
);
180 bool ProcessSVXFile(const wxString
& file
);
181 // void FixLRUD(traverse & centreline);
183 void CreateMenuBar();
185 void CreateSidePanel();
187 void UpdateStatusBar();
189 #ifdef USING_GENERIC_TOOLBAR
190 wxToolBar
* GetToolBar() const {
191 wxSizer
* sizer
= GetSizer();
192 if (!sizer
) return NULL
;
193 return (wxToolBar
*)sizer
->GetItem(size_t(0))->GetWindow();
198 MainFrm(const wxString
& title
, const wxPoint
& pos
, const wxSize
& size
);
200 // public for CavernLog.
201 bool LoadData(const wxString
& file
, const wxString
& prefix
);
202 void AddToFileHistory(const wxString
& file
);
204 void InitialiseAfterLoad(const wxString
& file
, const wxString
& prefix
);
205 void OnShowLog(wxCommandEvent
& event
);
207 void OnMRUFile(wxCommandEvent
& event
);
208 void OpenFile(const wxString
& file
, const wxString
& survey
= wxString());
210 void OnPresNewUpdate(wxUpdateUIEvent
& event
);
211 void OnPresOpenUpdate(wxUpdateUIEvent
& event
);
212 void OnPresSaveUpdate(wxUpdateUIEvent
& event
);
213 void OnPresSaveAsUpdate(wxUpdateUIEvent
& event
);
214 void OnPresMarkUpdate(wxUpdateUIEvent
& event
);
215 void OnPresFRewindUpdate(wxUpdateUIEvent
& event
);
216 void OnPresRewindUpdate(wxUpdateUIEvent
& event
);
217 void OnPresReverseUpdate(wxUpdateUIEvent
& event
);
218 void OnPresPlayUpdate(wxUpdateUIEvent
& event
);
219 void OnPresFFUpdate(wxUpdateUIEvent
& event
);
220 void OnPresFFFUpdate(wxUpdateUIEvent
& event
);
221 void OnPresPauseUpdate(wxUpdateUIEvent
& event
);
222 void OnPresStopUpdate(wxUpdateUIEvent
& event
);
223 void OnPresExportMovieUpdate(wxUpdateUIEvent
& event
);
224 void OnOpenTerrainUpdate(wxUpdateUIEvent
& event
);
227 void OnFind(wxCommandEvent
& event
);
228 void OnIdle(wxIdleEvent
& event
);
229 void OnGotoFound(wxCommandEvent
& event
);
230 void OnHide(wxCommandEvent
& event
);
231 void OnHideUpdate(wxUpdateUIEvent
& ui
);
233 void OnOpen(wxCommandEvent
& event
);
234 void OnOpenTerrain(wxCommandEvent
&);
235 void HideLog(wxWindow
* log_window
);
236 void OnScreenshot(wxCommandEvent
& event
);
237 void OnScreenshotUpdate(wxUpdateUIEvent
& event
);
238 void OnFilePreferences(wxCommandEvent
& event
);
239 void OnPrint(wxCommandEvent
& event
);
241 void OnPageSetup(wxCommandEvent
& event
);
242 void OnPresNew(wxCommandEvent
& event
);
243 void OnPresOpen(wxCommandEvent
& event
);
244 void OnPresSave(wxCommandEvent
& event
);
245 void OnPresSaveAs(wxCommandEvent
& event
);
246 void OnPresMark(wxCommandEvent
& event
);
247 void OnPresFRewind(wxCommandEvent
& event
);
248 void OnPresRewind(wxCommandEvent
& event
);
249 void OnPresReverse(wxCommandEvent
& event
);
250 void OnPresPlay(wxCommandEvent
& event
);
251 void OnPresFF(wxCommandEvent
& event
);
252 void OnPresFFF(wxCommandEvent
& event
);
253 void OnPresPause(wxCommandEvent
& event
);
254 void OnPresStop(wxCommandEvent
& event
);
255 void OnPresExportMovie(wxCommandEvent
& event
);
256 void OnExport(wxCommandEvent
& event
);
257 void OnExtend(wxCommandEvent
& event
);
258 void OnQuit(wxCommandEvent
& event
);
260 void OnAbout(wxCommandEvent
& event
);
261 void OnClose(wxCloseEvent
&);
263 void OnSetFocus(wxFocusEvent
&) { if (m_Gfx
) m_Gfx
->SetFocus(); }
265 void OnKeyPress(wxKeyEvent
&e
) {
268 m_Gfx
->OnKeyPress(e
);
272 void OnShowLogUpdate(wxUpdateUIEvent
&ui
) {
273 ui
.Enable(m_Log
!= NULL
|| (m_Splitter
->GetWindow1() != m_Gfx
&& m_Splitter
->GetWindow2() != m_Gfx
));
274 ui
.Check(m_Log
== NULL
);
276 void OnPrintUpdate(wxUpdateUIEvent
&ui
) { ui
.Enable(!m_File
.empty()); }
277 void OnExportUpdate(wxUpdateUIEvent
&ui
) { ui
.Enable(!m_File
.empty()); }
278 void OnExtendUpdate(wxUpdateUIEvent
&ui
) {
279 ui
.Enable(!IsExtendedElevation());
282 // temporary bodges until event handling problem is sorted out:
283 void OnDefaultsUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnDefaultsUpdate(event
); }
284 void OnPlanUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnPlanUpdate(event
); }
285 void OnElevationUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnElevationUpdate(event
); }
286 void OnDisplayOverlappingNamesUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnDisplayOverlappingNamesUpdate(event
); }
287 void OnColourByUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnColourByUpdate(event
); }
288 void OnColourByDepthUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnColourByDepthUpdate(event
); }
289 void OnColourByDateUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnColourByDateUpdate(event
); }
290 void OnColourByErrorUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnColourByErrorUpdate(event
); }
291 void OnColourByGradientUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnColourByGradientUpdate(event
); }
292 void OnColourByLengthUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnColourByLengthUpdate(event
); }
293 void OnShowCrossesUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnShowCrossesUpdate(event
); }
294 void OnShowEntrancesUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnShowEntrancesUpdate(event
); }
295 void OnShowFixedPtsUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnShowFixedPtsUpdate(event
); }
296 void OnShowExportedPtsUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnShowExportedPtsUpdate(event
); }
297 void OnShowStationNamesUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnShowStationNamesUpdate(event
); }
298 void OnShowSurveyLegsUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnShowSurveyLegsUpdate(event
); }
299 void OnSplaysUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnSplaysUpdate(event
); }
300 void OnHideSplaysUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnHideSplaysUpdate(event
); }
301 void OnShowSplaysDashedUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnShowSplaysDashedUpdate(event
); }
302 void OnShowSplaysFadedUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnShowSplaysFadedUpdate(event
); }
303 void OnShowSplaysNormalUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnShowSplaysNormalUpdate(event
); }
304 void OnDupesUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnDupesUpdate(event
); }
305 void OnHideDupesUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnHideDupesUpdate(event
); }
306 void OnShowDupesDashedUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnShowDupesDashedUpdate(event
); }
307 void OnShowDupesFadedUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnShowDupesFadedUpdate(event
); }
308 void OnShowDupesNormalUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnShowDupesNormalUpdate(event
); }
309 void OnShowSurfaceUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnShowSurfaceUpdate(event
); }
310 void OnMoveEastUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnMoveEastUpdate(event
); }
311 void OnMoveNorthUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnMoveNorthUpdate(event
); }
312 void OnMoveSouthUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnMoveSouthUpdate(event
); }
313 void OnMoveWestUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnMoveWestUpdate(event
); }
314 void OnToggleRotationUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnToggleRotationUpdate(event
); }
315 void OnReverseControlsUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnReverseControlsUpdate(event
); }
316 void OnToggleScalebarUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnToggleScalebarUpdate(event
); }
317 void OnToggleColourKeyUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnToggleColourKeyUpdate(event
); }
318 void OnViewCompassUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnViewCompassUpdate(event
); }
319 void OnViewGridUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnViewGridUpdate(event
); }
320 void OnViewBoundingBoxUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnViewBoundingBoxUpdate(event
); }
321 void OnViewTerrainUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnViewTerrainUpdate(event
); }
322 void OnViewClinoUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnViewClinoUpdate(event
); }
323 void OnViewPerspectiveUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnViewPerspectiveUpdate(event
); }
324 void OnViewSmoothShadingUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnViewSmoothShadingUpdate(event
); }
325 void OnViewTexturedUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnViewTexturedUpdate(event
); }
326 void OnViewFogUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnViewFogUpdate(event
); }
327 void OnViewSmoothLinesUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnViewSmoothLinesUpdate(event
); }
328 void OnViewFullScreenUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnViewFullScreenUpdate(event
); }
329 void OnReverseDirectionOfRotationUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnReverseDirectionOfRotationUpdate(event
); }
330 void OnCancelDistLineUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnCancelDistLineUpdate(event
); }
331 void OnIndicatorsUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnIndicatorsUpdate(event
); }
333 void OnDefaults(wxCommandEvent
&) { if (m_Control
) m_Control
->OnDefaults(); }
334 void OnPlan(wxCommandEvent
&) { if (m_Control
) m_Control
->OnPlan(); }
335 void OnElevation(wxCommandEvent
&) { if (m_Control
) m_Control
->OnElevation(); }
336 void OnDisplayOverlappingNames(wxCommandEvent
&) { if (m_Control
) m_Control
->OnDisplayOverlappingNames(); }
337 void OnColourByDepth(wxCommandEvent
&) { if (m_Control
) m_Control
->OnColourByDepth(); }
338 void OnColourByDate(wxCommandEvent
&) { if (m_Control
) m_Control
->OnColourByDate(); }
339 void OnColourByError(wxCommandEvent
&) { if (m_Control
) m_Control
->OnColourByError(); }
340 void OnColourByGradient(wxCommandEvent
&) { if (m_Control
) m_Control
->OnColourByGradient(); }
341 void OnColourByLength(wxCommandEvent
&) { if (m_Control
) m_Control
->OnColourByLength(); }
342 void OnShowCrosses(wxCommandEvent
&) { if (m_Control
) m_Control
->OnShowCrosses(); }
343 void OnShowEntrances(wxCommandEvent
&) { if (m_Control
) m_Control
->OnShowEntrances(); }
344 void OnShowFixedPts(wxCommandEvent
&) { if (m_Control
) m_Control
->OnShowFixedPts(); }
345 void OnShowExportedPts(wxCommandEvent
&) { if (m_Control
) m_Control
->OnShowExportedPts(); }
346 void OnShowStationNames(wxCommandEvent
&) { if (m_Control
) m_Control
->OnShowStationNames(); }
347 void OnShowSurveyLegs(wxCommandEvent
&) { if (m_Control
) m_Control
->OnShowSurveyLegs(); }
348 void OnHideSplays(wxCommandEvent
&) { if (m_Control
) m_Control
->OnHideSplays(); }
349 void OnShowSplaysDashed(wxCommandEvent
&) { if (m_Control
) m_Control
->OnShowSplaysDashed(); }
350 void OnShowSplaysFaded(wxCommandEvent
&) { if (m_Control
) m_Control
->OnShowSplaysFaded(); }
351 void OnShowSplaysNormal(wxCommandEvent
&) { if (m_Control
) m_Control
->OnShowSplaysNormal(); }
352 void OnHideDupes(wxCommandEvent
&) { if (m_Control
) m_Control
->OnHideDupes(); }
353 void OnShowDupesDashed(wxCommandEvent
&) { if (m_Control
) m_Control
->OnShowDupesDashed(); }
354 void OnShowDupesFaded(wxCommandEvent
&) { if (m_Control
) m_Control
->OnShowDupesFaded(); }
355 void OnShowDupesNormal(wxCommandEvent
&) { if (m_Control
) m_Control
->OnShowDupesNormal(); }
356 void OnShowSurface(wxCommandEvent
&) { if (m_Control
) m_Control
->OnShowSurface(); }
357 void OnMoveEast(wxCommandEvent
&) { if (m_Control
) m_Control
->OnMoveEast(); }
358 void OnMoveNorth(wxCommandEvent
&) { if (m_Control
) m_Control
->OnMoveNorth(); }
359 void OnMoveSouth(wxCommandEvent
&) { if (m_Control
) m_Control
->OnMoveSouth(); }
360 void OnMoveWest(wxCommandEvent
&) { if (m_Control
) m_Control
->OnMoveWest(); }
361 void OnToggleRotation(wxCommandEvent
&) { if (m_Control
) m_Control
->OnToggleRotation(); }
362 void OnReverseControls(wxCommandEvent
&) { if (m_Control
) m_Control
->OnReverseControls(); }
363 void OnToggleScalebar(wxCommandEvent
&) { if (m_Control
) m_Control
->OnToggleScalebar(); }
364 void OnToggleColourKey(wxCommandEvent
&) { if (m_Control
) m_Control
->OnToggleColourKey(); }
365 void OnViewCompass(wxCommandEvent
&) { if (m_Control
) m_Control
->OnViewCompass(); }
366 void OnViewClino(wxCommandEvent
&) { if (m_Control
) m_Control
->OnViewClino(); }
367 void OnViewGrid(wxCommandEvent
&) { if (m_Control
) m_Control
->OnViewGrid(); }
368 void OnViewBoundingBox(wxCommandEvent
&) { if (m_Control
) m_Control
->OnViewBoundingBox(); }
369 void OnViewTerrain(wxCommandEvent
&) { if (m_Control
) m_Control
->OnViewTerrain(); }
370 void OnViewPerspective(wxCommandEvent
&) { if (m_Control
) m_Control
->OnViewPerspective(); }
371 void OnViewSmoothShading(wxCommandEvent
&) { if (m_Control
) m_Control
->OnViewSmoothShading(); }
372 void OnViewTextured(wxCommandEvent
&) { if (m_Control
) m_Control
->OnViewTextured(); }
373 void OnViewFog(wxCommandEvent
&) { if (m_Control
) m_Control
->OnViewFog(); }
374 void OnViewSmoothLines(wxCommandEvent
&) { if (m_Control
) m_Control
->OnViewSmoothLines(); }
375 void OnViewFullScreen(wxCommandEvent
&) { ViewFullScreen(); }
376 void ViewFullScreen();
377 bool FullScreenModeShowingMenus() const;
378 void FullScreenModeShowMenus(bool show
);
379 void OnReverseDirectionOfRotation(wxCommandEvent
&) { if (m_Control
) m_Control
->OnReverseDirectionOfRotation(); }
380 void OnCancelDistLine(wxCommandEvent
&) { if (m_Control
) m_Control
->OnCancelDistLine(); }
382 void OnToggleMetric(wxCommandEvent
&) { if (m_Control
) m_Control
->OnToggleMetric(); }
383 void OnToggleDegrees(wxCommandEvent
&) { if (m_Control
) m_Control
->OnToggleDegrees(); }
384 void OnTogglePercent(wxCommandEvent
&) { if (m_Control
) m_Control
->OnTogglePercent(); }
385 void OnToggleTubes(wxCommandEvent
&) { if (m_Control
) m_Control
->OnToggleTubes(); }
387 void OnToggleMetricUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnToggleMetricUpdate(event
); }
388 void OnToggleDegreesUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnToggleDegreesUpdate(event
); }
389 void OnTogglePercentUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnTogglePercentUpdate(event
); }
390 void OnToggleTubesUpdate(wxUpdateUIEvent
& event
) { if (m_Control
) m_Control
->OnToggleTubesUpdate(event
); }
392 // end of horrible bodges
394 void OnViewSidePanelUpdate(wxUpdateUIEvent
& event
);
395 void OnViewSidePanel(wxCommandEvent
& event
);
396 void ToggleSidePanel();
397 bool ShowingSidePanel();
399 void SelectTreeItem(const LabelInfo
* label
) {
400 if (label
->tree_id
.IsOk())
401 m_Tree
->SelectItem(label
->tree_id
);
403 m_Tree
->UnselectAll();
406 void ClearTreeSelection();
409 void SetCoords(const Vector3
&v
);
410 const LabelInfo
* GetTreeSelection() const;
411 void SetCoords(Double x
, Double y
, const LabelInfo
* there
);
412 void SetAltitude(Double z
, const LabelInfo
* there
);
414 void ShowInfo(const LabelInfo
*here
= NULL
, const LabelInfo
*there
= NULL
);
415 void DisplayTreeInfo(const wxTreeItemData
* data
= NULL
);
416 void TreeItemSelected(const wxTreeItemData
* data
, bool zoom
);
417 PresentationMark
GetPresMark(int which
);
418 bool Animating() const { return m_Gfx
&& m_Gfx
->Animating(); }
420 // Restrict to subsurvey `survey` (or show all if `survey` empty).
421 void RestrictTo(const wxString
& survey
);
423 wxString
GetSurvey() const { return m_Survey
; }
425 int GetNumHighlightedPts() const { return m_NumHighlighted
; }
428 DECLARE_EVENT_TABLE()
431 // Older wxGTK loses pop-up dialogs under the always-on-top, maximised window.
432 // Not sure when this got fixed, but wx 2.8.10 definitely works properly on
435 // To work around this issue, create this object on the stack, and it will
436 // temporarily un-fullscreen the window while the dialog as a workaround.
437 class AvenAllowOnTop
{
438 #if defined __WXGTK__ && !wxCHECK_VERSION(2,8,10)
441 explicit AvenAllowOnTop(MainFrm
* mainfrm_
) {
442 if (mainfrm_
&& mainfrm_
->IsFullScreen()) {
444 mainfrm
->ViewFullScreen();
450 if (mainfrm
) mainfrm
->ViewFullScreen();
454 AvenAllowOnTop(MainFrm
*) { }