OpenCPN Partial API docs
Loading...
Searching...
No Matches
routemanagerdialog.h
1/*
2 This program is free software; you can redistribute it and/or
3 modify it under the terms of the GNU General Public License
4 as published by the Free Software Foundation; either version 2
5 of the License, or (at your option) any later version.
6
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 GNU General Public License for more details.
11
12 You should have received a copy of the GNU General Public License
13 along with this program; if not, write to the Free Software
14 Foundation, Inc., 51 Franklin Street, Fifth Floor,
15 Boston, MA 02110-1301, USA.
16
17 ---
18 Copyright (C) 2010, Anders Lund <anders@alweb.dk>
19 */
20
21#ifndef _RouteManagerDialog_h_
22#define _RouteManagerDialog_h_
23
24#include <wx/frame.h>
25#include <wx/timer.h>
26#include <wx/notebook.h>
27#include <wx/panel.h>
28#include <wx/listctrl.h>
29#include <wx/notebook.h>
30#include <wx/stattext.h>
31#include <wx/textctrl.h>
32#include <wx/checkbox.h>
33
34#include "observable.h"
35
36#define NAME_COLUMN 2
37#define DISTANCE_COLUMN 3
38
40class RouteManagerDialog; // forward
41extern RouteManagerDialog *pRouteManagerDialog;
43enum { SORT_ON_DISTANCE = 1, SORT_ON_NAME, SORT_ON_DATE };
44
45enum TrackContextMenu { TRACK_MERGE = 1, TRACK_COPY_TEXT, TRACK_CLEAN };
46
47class wxButton;
48class Route;
49class Track;
50class Layer;
51class RoutePoint;
52
53class RouteManagerDialog : public wxFrame {
54 DECLARE_EVENT_TABLE()
55
56public:
57 static RouteManagerDialog *getInstance(wxWindow *parent);
58 static bool getInstanceFlag() { return instanceFlag; }
60
61 void OnClose(wxCloseEvent &event);
62 void OnOK(wxCommandEvent &event);
63
64 void SetColorScheme();
65 void RecalculateSize();
66 void UpdateRouteListCtrl(); // Rebuild route list
67 void UpdateTrkListCtrl();
68 void UpdateWptListCtrl(RoutePoint *rp_select = NULL,
69 bool b_retain_sort = true);
70 void UpdateLayListCtrl();
71 void UpdateWptListCtrlViz();
72
73 void UpdateLists();
74
75 void OnTabSwitch(wxNotebookEvent &event);
76 static void WptShowPropertiesDialog(RoutePoint *wp, wxWindow *parent);
77 void TrackToRoute(Track *track);
78
79private:
80 static bool instanceFlag;
81 static RouteManagerDialog *single;
82
83 RouteManagerDialog(wxWindow *parent);
84
85 void Create();
86 void UpdateRteButtons(); // Correct button state
87 void MakeAllRoutesInvisible(); // Mark all routes as invisible. Does not
88 // flush settings.
89 void ZoomtoRoute(Route *route); // Attempt to zoom route into the view
90 void UpdateTrkButtons(); // Correct button state
91 void UpdateWptButtons(); // Correct button state
92 void UpdateLayButtons(); // Correct button state
93 void ToggleLayerContentsOnChart(Layer *layer);
94 void ToggleLayerContentsOnListing(Layer *layer);
95 void ToggleLayerContentsNames(Layer *layer);
96 void AddNewLayer(bool isPersistent);
97
98 // event handlers
99 void OnRteDeleteClick(wxCommandEvent &event);
100 void OnRtePropertiesClick(wxCommandEvent &event);
101 void OnRteZoomtoClick(wxCommandEvent &event);
102 void OnRteActivateClick(wxCommandEvent &event);
103 void OnRteReverseClick(wxCommandEvent &event);
104 void OnRteExportClick(wxCommandEvent &event);
105 void OnRteResequenceClick(wxCommandEvent &event);
106 void OnRteSendToPeerClick(wxCommandEvent &event);
107 void OnRteToggleVisibility(wxMouseEvent &event);
108 void OnRteBtnLeftDown(
109 wxMouseEvent &event); // record control key state for some action buttons
110 void OnRteDeleteAllClick(wxCommandEvent &event);
111 void OnRteSelected(wxListEvent &event);
112 void OnRteSendToGPSClick(wxCommandEvent &event);
113 void OnRteDefaultAction(wxListEvent &event);
114 void OnRteColumnClicked(wxListEvent &event);
115 void OnTrkDefaultAction(wxListEvent &event);
116 void OnTrkNewClick(wxCommandEvent &event);
117 void OnTrkPropertiesClick(wxCommandEvent &event);
118 void OnTrkDeleteClick(wxCommandEvent &event);
119 void OnTrkExportClick(wxCommandEvent &event);
120 void OnTrkRouteFromTrackClick(wxCommandEvent &event);
121 void OnTrkDeleteAllClick(wxCommandEvent &event);
122 void OnTrkSelected(wxListEvent &event);
123 void OnTrkToggleVisibility(wxMouseEvent &event);
124 void OnTrkColumnClicked(wxListEvent &event);
125 void OnTrkRightClick(wxListEvent &event);
126 void OnTrkMenuSelected(wxCommandEvent &event);
127 void OnTrkSendToPeerClick(wxCommandEvent &event);
128 void OnWptDefaultAction(wxListEvent &event);
129 void OnWptNewClick(wxCommandEvent &event);
130 void OnWptPropertiesClick(wxCommandEvent &event);
131 void OnWptZoomtoClick(wxCommandEvent &event);
132 void OnWptDeleteClick(wxCommandEvent &event);
133 void OnWptGoToClick(wxCommandEvent &event);
134 void OnWptExportClick(wxCommandEvent &event);
135 void OnWptSendToGPSClick(wxCommandEvent &event);
136 void OnWptDeleteAllClick(wxCommandEvent &event);
137 void OnWptSelected(wxListEvent &event);
138 void OnWptToggleVisibility(wxMouseEvent &event);
139 void OnWptColumnClicked(wxListEvent &event);
140 void OnWptSendToPeerClick(wxCommandEvent &event);
141 void OnLayDefaultAction(wxListEvent &event);
142 void OnLayNewClick(wxCommandEvent &event);
143 void OnPerLayNewClick(wxCommandEvent &event);
144 void OnLayPropertiesClick(wxCommandEvent &event);
145 void OnLayToggleChartClick(wxCommandEvent &event);
146 void OnLayToggleListingClick(wxCommandEvent &event);
147 void OnLayToggleNamesClick(wxCommandEvent &event);
148 void OnLayDeleteClick(wxCommandEvent &event);
149 void OnLaySelected(wxListEvent &event);
150 void OnLayToggleVisibility(wxMouseEvent &event);
151 void OnLayColumnClicked(wxListEvent &event);
152 void OnImportClick(wxCommandEvent &event);
153 void OnExportClick(wxCommandEvent &event);
154 void OnExportVizClick(wxCommandEvent &event);
155 void OnBackupClick(wxCommandEvent &event);
156 void OnFilterChanged(wxCommandEvent &event);
157 void OnKey(wxKeyEvent &ke);
158 void OnShowAllRteCBClicked(wxCommandEvent &event);
159 void OnShowAllWpCBClicked(wxCommandEvent &event);
160 void OnShowAllTrkCBClicked(wxCommandEvent &event);
161 void OnShowAllLayCBClicked(wxCommandEvent &event);
162
163 // properties
164 wxNotebook *m_pNotebook;
165 wxPanel *m_pPanelRte;
166 wxPanel *m_pPanelTrk;
167 wxPanel *m_pPanelWpt;
168 wxPanel *m_pPanelLay;
169 wxListCtrl *m_pRouteListCtrl;
170 wxListCtrl *m_pTrkListCtrl;
171 wxListCtrl *m_pWptListCtrl;
172 wxListCtrl *m_pLayListCtrl;
173 wxStaticText *m_stFilterWpt;
174 wxTextCtrl *m_tFilterWpt;
175 wxStaticText *m_stFilterRte;
176 wxTextCtrl *m_tFilterRte;
177 wxStaticText *m_stFilterTrk;
178 wxTextCtrl *m_tFilterTrk;
179 wxStaticText *m_stFilterLay;
180 wxTextCtrl *m_tFilterLay;
181
182 wxButton *btnRteProperties;
183 wxButton *btnRteActivate;
184 wxButton *btnRteZoomto;
185 wxButton *btnRteReverse;
186 wxButton *btnRteDelete;
187 wxButton *btnRteExport;
188 wxButton *btnRteResequence;
189 wxButton *btnRteSendToGPS;
190 wxButton *btnRteSendToPeer;
191 wxButton *btnRteDeleteAll;
192 wxButton *btnTrkNew;
193 wxButton *btnTrkProperties;
194 wxButton *btnTrkDelete;
195 wxButton *btnTrkExport;
196 wxButton *btnTrkRouteFromTrack;
197 wxButton *btnTrkSendToPeer;
198 wxButton *btnTrkDeleteAll;
199 wxButton *btnWptNew;
200 wxButton *btnWptProperties;
201 wxButton *btnWptZoomto;
202 wxButton *btnWptDelete;
203 wxButton *btnWptGoTo;
204 wxButton *btnWptExport;
205 wxButton *btnWptSendToGPS;
206 wxButton *btnWptSendToPeer;
207 wxButton *btnWptDeleteAll;
208 wxButton *btnLayNew;
209 wxButton *btnPerLayNew;
210 // wxButton *btnLayProperties;
211 wxCheckBox *cbLayToggleChart;
212 wxCheckBox *cbLayToggleListing;
213 wxCheckBox *cbLayToggleNames;
214 wxButton *btnLayDelete;
215 wxButton *btnImport;
216 wxButton *btnExport;
217 wxButton *btnExportViz;
218 wxButton *btnBackup;
219 wxCheckBox *m_cbShowAllRte;
220 wxCheckBox *m_cbShowAllWP;
221 wxCheckBox *m_cbShowAllTrk;
222 wxCheckBox *m_cbShowAllLay;
223
224 bool m_bPossibleClick; // do
225 bool m_bCtrlDown; // record control key state for some action buttons
226 bool m_bNeedConfigFlush; // if true, update config in destructor
227
228 int m_lastWptItem;
229 int m_lastTrkItem;
230 int m_lastRteItem;
231
232 int m_charWidth;
233 int m_listIconSize;
234
235 ObsListener routes_update_listener;
236};
237
238#endif // _RouteManagerDialog_h_
239// kate: indent-width 6; indent-mode cstyle; space-indent on;
Represents a layer of chart objects in OpenCPN.
Definition Layer.h:40
Define an action to be performed when a KeyProvider is notified.
Definition observable.h:257
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
General observable implementation with several specializations.