OpenCPN Partial API docs
canvasMenu.h
1 /***************************************************************************
2  *
3  * Project: OpenCPN
4  * Purpose: CanvasMenuHandler
5  * Author: David Register
6  *
7  ***************************************************************************
8  * Copyright (C) 2015 by David S. Register *
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU General Public License as published by *
12  * the Free Software Foundation; either version 2 of the License, or *
13  * (at your option) any later version. *
14  * *
15  * This program is distributed in the hope that it will be useful, *
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
18  * GNU General Public License for more details. *
19  * *
20  * You should have received a copy of the GNU General Public License *
21  * along with this program; if not, write to the *
22  * Free Software Foundation, Inc., *
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
24  **************************************************************************/
25 
26 #ifndef __CANVASMENU_H__
27 #define __CANVASMENU_H__
28 
29 #include "bbox.h"
30 
31 #include <wx/datetime.h>
32 #include <wx/treectrl.h>
33 #include <wx/dirctrl.h>
34 #include <wx/sound.h>
35 #include <wx/grid.h>
36 #include <wx/wxhtml.h>
37 
38 #include "ocpndc.h"
39 #include "undo.h"
40 
41 #include "ocpCursor.h"
42 #include "S57QueryDialog.h"
43 #include "GoToPositionDialog.h"
44 #include "DetailSlider.h"
45 #include "RolloverWin.h"
46 #include "AISTargetQueryDialog.h"
47 #include "timers.h"
48 #include "emboss_data.h"
49 
50 
51 class wxGLContext;
52 class GSHHSChart;
53 class IDX_entry;
54 
55 //----------------------------------------------------------------------------
56 // Forward Declarations
57 //----------------------------------------------------------------------------
58 class Route;
59 class TCWin;
60 class RoutePoint;
61 class SelectItem;
62 class BoundingBox;
63 class ocpnBitmap;
64 class WVSChart;
65 class MyFrame;
66 class ChartBaseBSB;
67 class ChartBase;
68 class AisTargetData;
69 class S57ObjectTree;
70 class S57ObjectDesc;
71 class RolloverWin;
72 class Quilt;
73 class PixelCache;
74 class ChInfoWin;
75 class glChartCanvas;
76 class Track;
77 
78 //----------------------------------------------------------------------------
79 // CanvasMenuHandler
80 //----------------------------------------------------------------------------
81 class CanvasMenuHandler : public wxEvtHandler {
82 public:
83  CanvasMenuHandler(ChartCanvas *parentCanvas, Route *selectedRoute,
84  Track *selectedTrack, RoutePoint *selectedPoint,
85  int selectedAIS_MMSI, void *selectedTCIndex);
86 
88 
89  void CanvasPopupMenu(int x, int y, int seltype);
90  void PopupMenuHandler(wxCommandEvent &event);
91  static int GetNextContextMenuId();
92  void PrepareMenuItem( wxMenuItem *item );
93  void MenuPrepend1(wxMenu *menu, int id, wxString label);
94  void MenuAppend1(wxMenu *menu, int id, wxString label);
95  void SetMenuItemFont1(wxMenuItem *item);
96 
97  static wxFont m_scaledFont;
98 
99 private:
100  int popx, popy;
101  ChartCanvas *parent;
102  Route *m_pSelectedRoute;
103  Track *m_pSelectedTrack;
104  RoutePoint *m_pFoundRoutePoint;
105  Route *m_pHead; // for split function
106  Route *m_pTail;
107  int m_SelectedIdx;
108  int m_FoundAIS_MMSI;
109  void *m_pIDXCandidate;
110  double m_DIPFactor;
111 };
112 
113 #endif
Definition: IDX_entry.h:41
Definition: Quilt.h:83
Definition: route.h:75
Definition: TCWin.h:46
Definition: track.h:78