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#define NAME_COLUMN 2
35#define DISTANCE_COLUMN 3
36
37enum { SORT_ON_DISTANCE = 1, SORT_ON_NAME };
38
39enum TrackContextMenu { TRACK_MERGE = 1, TRACK_COPY_TEXT, TRACK_CLEAN };
40
41class wxButton;
42class Route;
43class Track;
44class Layer;
45class RoutePoint;
46
47class RouteManagerDialog : public wxFrame {
48 DECLARE_EVENT_TABLE()
49
50public:
51 static RouteManagerDialog *getInstance(wxWindow *parent);
52 static bool getInstanceFlag() { return instanceFlag; }
54
55 void OnClose(wxCloseEvent &event);
56 void OnOK(wxCommandEvent &event);
57
58 void SetColorScheme();
59 void RecalculateSize();
60 void UpdateRouteListCtrl(); // Rebuild route list
61 void UpdateTrkListCtrl();
62 void UpdateWptListCtrl(RoutePoint *rp_select = NULL,
63 bool b_retain_sort = true);
64 void UpdateLayListCtrl();
65 void UpdateWptListCtrlViz();
66
67 void UpdateLists();
68
69 void OnTabSwitch(wxNotebookEvent &event);
70 static void WptShowPropertiesDialog(RoutePoint *wp, wxWindow *parent);
71 void TrackToRoute(Track *track);
72
73private:
74 static bool instanceFlag;
75 static RouteManagerDialog *single;
76
77 RouteManagerDialog(wxWindow *parent);
78
79 void Create();
80 void UpdateRteButtons(); // Correct button state
81 void MakeAllRoutesInvisible(); // Mark all routes as invisible. Does not
82 // flush settings.
83 void ZoomtoRoute(Route *route); // Attempt to zoom route into the view
84 void UpdateTrkButtons(); // Correct button state
85 void UpdateWptButtons(); // Correct button state
86 void UpdateLayButtons(); // Correct button state
87 void ToggleLayerContentsOnChart(Layer *layer);
88 void ToggleLayerContentsOnListing(Layer *layer);
89 void ToggleLayerContentsNames(Layer *layer);
90 void AddNewLayer(bool isPersistent);
91
92 // event handlers
93 void OnRteDeleteClick(wxCommandEvent &event);
94 void OnRtePropertiesClick(wxCommandEvent &event);
95 void OnRteZoomtoClick(wxCommandEvent &event);
96 void OnRteActivateClick(wxCommandEvent &event);
97 void OnRteReverseClick(wxCommandEvent &event);
98 void OnRteExportClick(wxCommandEvent &event);
99 void OnRteResequenceClick(wxCommandEvent &event);
100 void OnRteSendToPeerClick(wxCommandEvent &event);
101 void OnRteToggleVisibility(wxMouseEvent &event);
102 void OnRteBtnLeftDown(
103 wxMouseEvent &event); // record control key state for some action buttons
104 void OnRteDeleteAllClick(wxCommandEvent &event);
105 void OnRteSelected(wxListEvent &event);
106 void OnRteSendToGPSClick(wxCommandEvent &event);
107 void OnRteDefaultAction(wxListEvent &event);
108 void OnRteColumnClicked(wxListEvent &event);
109 void OnTrkDefaultAction(wxListEvent &event);
110 void OnTrkNewClick(wxCommandEvent &event);
111 void OnTrkPropertiesClick(wxCommandEvent &event);
112 void OnTrkDeleteClick(wxCommandEvent &event);
113 void OnTrkExportClick(wxCommandEvent &event);
114 void OnTrkRouteFromTrackClick(wxCommandEvent &event);
115 void OnTrkDeleteAllClick(wxCommandEvent &event);
116 void OnTrkSelected(wxListEvent &event);
117 void OnTrkToggleVisibility(wxMouseEvent &event);
118 void OnTrkColumnClicked(wxListEvent &event);
119 void OnTrkRightClick(wxListEvent &event);
120 void OnTrkMenuSelected(wxCommandEvent &event);
121 void OnTrkSendToPeerClick(wxCommandEvent &event);
122 void OnWptDefaultAction(wxListEvent &event);
123 void OnWptNewClick(wxCommandEvent &event);
124 void OnWptPropertiesClick(wxCommandEvent &event);
125 void OnWptZoomtoClick(wxCommandEvent &event);
126 void OnWptDeleteClick(wxCommandEvent &event);
127 void OnWptGoToClick(wxCommandEvent &event);
128 void OnWptExportClick(wxCommandEvent &event);
129 void OnWptSendToGPSClick(wxCommandEvent &event);
130 void OnWptDeleteAllClick(wxCommandEvent &event);
131 void OnWptSelected(wxListEvent &event);
132 void OnWptToggleVisibility(wxMouseEvent &event);
133 void OnWptColumnClicked(wxListEvent &event);
134 void OnWptSendToPeerClick(wxCommandEvent &event);
135 void OnLayDefaultAction(wxListEvent &event);
136 void OnLayNewClick(wxCommandEvent &event);
137 void OnPerLayNewClick(wxCommandEvent &event);
138 void OnLayPropertiesClick(wxCommandEvent &event);
139 void OnLayToggleChartClick(wxCommandEvent &event);
140 void OnLayToggleListingClick(wxCommandEvent &event);
141 void OnLayToggleNamesClick(wxCommandEvent &event);
142 void OnLayDeleteClick(wxCommandEvent &event);
143 void OnLaySelected(wxListEvent &event);
144 void OnLayToggleVisibility(wxMouseEvent &event);
145 void OnLayColumnClicked(wxListEvent &event);
146 void OnImportClick(wxCommandEvent &event);
147 void OnExportClick(wxCommandEvent &event);
148 void OnExportVizClick(wxCommandEvent &event);
149 void OnFilterChanged(wxCommandEvent &event);
150 void OnKey(wxKeyEvent &ke);
151 void OnShowAllRteCBClicked(wxCommandEvent &event);
152 void OnShowAllWpCBClicked(wxCommandEvent &event);
153 void OnShowAllTrkCBClicked(wxCommandEvent &event);
154 void OnShowAllLayCBClicked(wxCommandEvent &event);
155
156 // properties
157 wxNotebook *m_pNotebook;
158 wxPanel *m_pPanelRte;
159 wxPanel *m_pPanelTrk;
160 wxPanel *m_pPanelWpt;
161 wxPanel *m_pPanelLay;
162 wxListCtrl *m_pRouteListCtrl;
163 wxListCtrl *m_pTrkListCtrl;
164 wxListCtrl *m_pWptListCtrl;
165 wxListCtrl *m_pLayListCtrl;
166 wxStaticText *m_stFilterWpt;
167 wxTextCtrl *m_tFilterWpt;
168 wxStaticText *m_stFilterRte;
169 wxTextCtrl *m_tFilterRte;
170 wxStaticText *m_stFilterTrk;
171 wxTextCtrl *m_tFilterTrk;
172 wxStaticText *m_stFilterLay;
173 wxTextCtrl *m_tFilterLay;
174
175 wxButton *btnRteProperties;
176 wxButton *btnRteActivate;
177 wxButton *btnRteZoomto;
178 wxButton *btnRteReverse;
179 wxButton *btnRteDelete;
180 wxButton *btnRteExport;
181 wxButton *btnRteResequence;
182 wxButton *btnRteSendToGPS;
183 wxButton *btnRteSendToPeer;
184 wxButton *btnRteDeleteAll;
185 wxButton *btnTrkNew;
186 wxButton *btnTrkProperties;
187 wxButton *btnTrkDelete;
188 wxButton *btnTrkExport;
189 wxButton *btnTrkRouteFromTrack;
190 wxButton *btnTrkSendToPeer;
191 wxButton *btnTrkDeleteAll;
192 wxButton *btnWptNew;
193 wxButton *btnWptProperties;
194 wxButton *btnWptZoomto;
195 wxButton *btnWptDelete;
196 wxButton *btnWptGoTo;
197 wxButton *btnWptExport;
198 wxButton *btnWptSendToGPS;
199 wxButton *btnWptSendToPeer;
200 wxButton *btnWptDeleteAll;
201 wxButton *btnLayNew;
202 wxButton *btnPerLayNew;
203 // wxButton *btnLayProperties;
204 wxCheckBox *cbLayToggleChart;
205 wxCheckBox *cbLayToggleListing;
206 wxCheckBox *cbLayToggleNames;
207 wxButton *btnLayDelete;
208 wxButton *btnImport;
209 wxButton *btnExport;
210 wxButton *btnExportViz;
211 wxCheckBox *m_cbShowAllRte;
212 wxCheckBox *m_cbShowAllWP;
213 wxCheckBox *m_cbShowAllTrk;
214 wxCheckBox *m_cbShowAllLay;
215
216 bool m_bPossibleClick; // do
217 bool m_bCtrlDown; // record control key state for some action buttons
218 bool m_bNeedConfigFlush; // if true, update config in destructor
219
220 int m_lastWptItem;
221 int m_lastTrkItem;
222 int m_lastRteItem;
223
224 int m_charWidth;
225 int m_listIconSize;
226};
227
228#endif // _RouteManagerDialog_h_
229// kate: indent-width 6; indent-mode cstyle; space-indent on;
Definition: Layer.h:32
Definition: route.h:70
Definition: track.h:79