OpenCPN Partial API docs
Loading...
Searching...
No Matches
route_prop_dlg_impl.h
Go to the documentation of this file.
1/**************************************************************************
2 * Copyright (C) 2013 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#pragma once
25#ifndef _ROUTEPROPDLGIMPL_H_
26#define _ROUTEPROPDLGIMPL_H_
27
28#include <cmath>
29
30#include <wx/dataview.h>
31#include <wx/dvrenderers.h>
32
33#include "model/config_vars.h"
34#include "model/ocpn_types.h"
35#include "model/route.h"
36
37#include "color_types.h"
38#include "link_prop_dlg.h"
39#include "route_prop_dlg.h"
40
41class RoutePropDlgImpl; // forward
45public:
47
48 static RoutePropDlgImpl* getInstance(wxWindow* parent);
49 void SetRouteAndUpdate(Route* pR, bool only_points = FALSE);
50 Route* GetRoute() { return m_pRoute; }
51 void SetEnroutePoint(RoutePoint* rp) { return; } // TODO
52 void UpdatePoints();
53 void SetColorScheme(ColorScheme cs);
54 void RecalculateSize();
55 static bool getInstanceFlag();
56
57protected:
58 void RoutePropDlgOnClose(wxCloseEvent& event) {
59 SaveGeometry();
60 ResetChanges();
61 Hide();
62 event.Veto();
63 }
64 void RoutePropDlgOnSize(wxSizeEvent& event) { event.Skip(); }
65 void RoutePropDlgOnNotebookPageChanged(wxNotebookEvent& event) {
66 event.Skip();
67 }
68 void PlanSpeedOnKillFocus(wxFocusEvent& event);
69 void PlanSpeedOnTextEnter(wxCommandEvent& event);
70 void DepartureDateOnDateChanged(wxDateEvent& event);
71 void DepartureTimeOnTimeChanged(wxDateEvent& event);
72 void TimezoneOnChoice(wxCommandEvent& event);
73 void WaypointsOnDataViewListCtrlItemContextMenu(wxDataViewEvent& event);
74 void WaypointsOnDataViewListCtrlItemEditingDone(wxDataViewEvent& event);
75 void WaypointsOnDataViewListCtrlItemValueChanged(wxDataViewEvent& event);
76 void WaypointsOnDataViewListCtrlSelectionChanged(wxDataViewEvent& event);
77 void PrintOnButtonClick(wxCommandEvent& event);
78 void ExtendOnButtonClick(wxCommandEvent& event);
79 void SplitOnButtonClick(wxCommandEvent& event);
80 void BtnsOnCancelButtonClick(wxCommandEvent& event) {
81 SaveGeometry();
82 ResetChanges();
83 Hide();
84 }
85 void BtnsOnOKButtonClick(wxCommandEvent& event);
86 void OnRoutePropMenuSelected(wxCommandEvent& event);
87 void OnRoutepropCopyTxtClick(wxCommandEvent& event);
88 void ItemEditOnMenuSelection(wxCommandEvent& event);
89 void ItemAddOnMenuSelection(wxCommandEvent& event);
90 void ItemDeleteOnMenuSelection(wxCommandEvent& event);
91 void AddLinkOnButtonClick(wxCommandEvent& event);
92 void BtnEditOnToggleButton(wxCommandEvent& event);
93 void OnHyperlinkClick(wxHyperlinkEvent& event);
94 void HyperlinkContextMenu(wxMouseEvent& event);
95 void m_scrolledWindowLinksOnContextMenu(wxMouseEvent& event);
97 wxDateTime GetDepartureTS();
98 void SaveChanges();
99 void ResetChanges();
100
101 void OnActivate(wxActivateEvent& event);
102
103 RoutePropDlgImpl(wxWindow* parent, wxWindowID id = wxID_ANY,
104 const wxString& title = _("Route Properties"),
105 const wxPoint& pos = wxDefaultPosition,
106 const wxSize& size = wxSize(550, 450),
107 long style = FRAME_WITH_LINKS_STYLE);
108
109private:
110 void SaveGeometry();
111 static bool instanceFlag;
112 static RoutePropDlgImpl* single;
113
119 Route* m_pRoute;
125 Route m_OrigRoute;
132 Route* m_pHead;
139 Route* m_pTail;
145 RoutePoint* m_pExtendPoint;
151 Route* m_pExtendRoute;
157 RoutePoint* m_pEnroutePoint;
164 bool m_bStartNow;
165
176 int m_tz_selection;
177
178 wxDataViewColumn* etd_col;
179
180 wxHyperlinkCtrl* m_pEditedLink;
181
182 bool IsThisRouteExtendable();
183
184 wxString MakeTideInfo(wxString stationName, double lat, double lon,
185 wxDateTime utcTime);
186};
187
188#endif // _ROUTEPROPDLGIMPL_H_
Represents a waypoint or mark within the navigation system.
Definition route_point.h:71
void ItemDeleteOnMenuSelection(wxCommandEvent &event)
wxDateTime GetDepartureTS()
Returns the departure time of the route, in UTC.
Class RoutePropDlg.
Represents a navigational route in the navigation system.
Definition route.h:99
Global variables stored in configuration file.
Navigation data types.
Route abstraction.
RoutePropDlgImpl * pRoutePropDialog
Global instance.