OpenCPN Partial API docs
Loading...
Searching...
No Matches
canvas_menu.h
Go to the documentation of this file.
1/**************************************************************************
2 * Copyright (C) 2015 by David S. Register *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, see <https://www.gnu.org/licenses/>. *
16 **************************************************************************/
17
24#ifndef __CANVASMENU_H__
25#define __CANVASMENU_H__
26
27#include "gl_headers.h"
28
29#include <wx/glcanvas.h>
30#include <wx/treectrl.h>
31
32#include "model/route.h"
33#include "model/route_point.h"
34
35#include "chcanv.h"
36#include "ocpCursor.h"
37
38class ChartCanvas; // circular
39
40//----------------------------------------------------------------------------
41// Forward Declarations
42//----------------------------------------------------------------------------
43
49class CanvasMenuHandler : public wxEvtHandler {
50public:
51 CanvasMenuHandler(ChartCanvas *parentCanvas, Route *selectedRoute,
52 Track *selectedTrack, RoutePoint *selectedPoint,
53 int selectedAIS_MMSI, void *selectedTCIndex,
54 wxWindow *nmea_log);
55
57
58 void CanvasPopupMenu(int x, int y, int seltype);
59 void PopupMenuHandler(wxCommandEvent &event);
60 static int GetNextContextMenuId();
61 void PrepareMenuItem(wxMenuItem *item);
62 void MenuPrepend1(wxMenu *menu, int id, wxString label);
63 void MenuAppend1(wxMenu *menu, int id, wxString label);
64 void SetMenuItemFont1(wxMenuItem *item);
65
66 static wxFont m_scaledFont;
67
68private:
69 void AddPluginContextMenuItems(wxMenu *contextMenu, wxMenu *menuRoute,
70 wxMenu *menuTrack, wxMenu *menuWaypoint,
71 wxMenu *menuAIS);
72
73 int popx, popy;
74 ChartCanvas *parent;
75 Route *m_pSelectedRoute;
76 Track *m_pSelectedTrack;
77 RoutePoint *m_pFoundRoutePoint;
78 Route *m_pHead; // for split function
79 Route *m_pTail;
80 int m_SelectedIdx;
81 int m_FoundAIS_MMSI;
82 void *m_pIDXCandidate;
83 double m_DIPFactor;
84 wxWindow *m_nmea_log;
85};
86
87#endif
Generic Chart canvas base.
Handles context menu events for the chart canvas.
Definition canvas_menu.h:49
ChartCanvas - Main chart display and interaction component.
Definition chcanv.h:151
Represents a waypoint or mark within the navigation system.
Definition route_point.h:70
Represents a navigational route in the navigation system.
Definition route.h:98
Represents a track, which is a series of connected track points.
Definition track.h:114
Platform independent GL includes.