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 "ocp_cursor.h"
37
38class ChartCanvas; // circular
39
45class CanvasMenuHandler : public wxEvtHandler {
46public:
47 CanvasMenuHandler(ChartCanvas *parentCanvas, Route *selectedRoute,
48 Track *selectedTrack, RoutePoint *selectedPoint,
49 int selectedAIS_MMSI, void *selectedTCIndex,
50 wxWindow *nmea_log);
51
53
54 void CanvasPopupMenu(int x, int y, int seltype);
55 void PopupMenuHandler(wxCommandEvent &event);
56 static int GetNextContextMenuId();
57 void PrepareMenuItem(wxMenuItem *item);
58 void MenuPrepend1(wxMenu *menu, int id, wxString label);
59 void MenuAppend1(wxMenu *menu, int id, wxString label);
60 void SetMenuItemFont1(wxMenuItem *item);
61
62 static wxFont m_scaledFont;
63
64private:
65 void AddPluginContextMenuItems(wxMenu *contextMenu, wxMenu *menuRoute,
66 wxMenu *menuTrack, wxMenu *menuWaypoint,
67 wxMenu *menuAIS);
68
69 int popx, popy;
70 ChartCanvas *parent;
71 Route *m_pSelectedRoute;
72 Track *m_pSelectedTrack;
73 RoutePoint *m_pFoundRoutePoint;
74 Route *m_pHead; // for split function
75 Route *m_pTail;
76 int m_SelectedIdx;
77 int m_FoundAIS_MMSI;
78 void *m_pIDXCandidate;
79 double m_DIPFactor;
80 wxWindow *m_nmea_log;
81};
82
83#endif
Generic Chart canvas base.
Handles context menu events for the chart canvas.
Definition canvas_menu.h:45
ChartCanvas - Main chart display and interaction component.
Definition chcanv.h:173
Represents a waypoint or mark within the navigation system.
Definition route_point.h:71
Represents a navigational route in the navigation system.
Definition route.h:99
Represents a track, which is a series of connected track points.
Definition track.h:117
Platform independent GL includes.
Platform specific wxCursor extension.
Route abstraction.
Waypoint or mark abstraction.