OpenCPN Partial API docs
Loading...
Searching...
No Matches
RoutePropDlgImpl.h
1/***************************************************************************
2 *
3 * Project: OpenCPN
4 *
5 ***************************************************************************
6 * Copyright (C) 2013 by David S. Register *
7 * *
8 * This program is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU General Public License as published by *
10 * the Free Software Foundation; either version 2 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * This program is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU General Public License *
19 * along with this program; if not, write to the *
20 * Free Software Foundation, Inc., *
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
22 **************************************************************************/
23
24#pragma once
25#ifndef _ROUTEPROPDLGIMPL_H_
26#define _ROUTEPROPDLGIMPL_H_
27
28#include "RoutePropDlg.h"
29#include "model/route.h"
30#include <wx/dataview.h>
31#include <wx/dvrenderers.h>
32#include "model/ocpn_types.h"
33#include "color_types.h"
34#include <cmath>
35#include "LinkPropDlg.h"
36
37class RoutePropDlgImpl; // forward
38
39extern RoutePropDlgImpl* pRoutePropDialog;
41extern int g_route_prop_x, g_route_prop_y, g_route_prop_sx, g_route_prop_sy;
42
44public:
46
47 static RoutePropDlgImpl* getInstance(wxWindow* parent);
48 void SetRouteAndUpdate(Route* pR, bool only_points = FALSE);
49 Route* GetRoute(void) { return m_pRoute; }
50 void SetEnroutePoint(RoutePoint* rp) { return; } // TODO
51 void UpdatePoints();
52 void SetColorScheme(ColorScheme cs);
53 void RecalculateSize(void);
54 static bool getInstanceFlag();
55
56protected:
57 void RoutePropDlgOnClose(wxCloseEvent& event) {
58 SaveGeometry();
59 ResetChanges();
60 Hide();
61 event.Veto();
62 }
63 void RoutePropDlgOnSize(wxSizeEvent& event) { event.Skip(); }
64 void RoutePropDlgOnNotebookPageChanged(wxNotebookEvent& event) {
65 event.Skip();
66 }
67 void PlanSpeedOnKillFocus(wxFocusEvent& event);
68 void PlanSpeedOnTextEnter(wxCommandEvent& event);
69 void DepartureDateOnDateChanged(wxDateEvent& event);
70 void DepartureTimeOnTimeChanged(wxDateEvent& event);
71 void TimezoneOnChoice(wxCommandEvent& event);
72 void WaypointsOnDataViewListCtrlItemContextMenu(wxDataViewEvent& event);
73 void WaypointsOnDataViewListCtrlItemEditingDone(wxDataViewEvent& event);
74 void WaypointsOnDataViewListCtrlItemValueChanged(wxDataViewEvent& event);
75 void WaypointsOnDataViewListCtrlSelectionChanged(wxDataViewEvent& event);
76 void PrintOnButtonClick(wxCommandEvent& event);
77 void ExtendOnButtonClick(wxCommandEvent& event);
78 void SplitOnButtonClick(wxCommandEvent& event);
79 void BtnsOnCancelButtonClick(wxCommandEvent& event) {
80 SaveGeometry();
81 ResetChanges();
82 Hide();
83 }
84 void BtnsOnOKButtonClick(wxCommandEvent& event);
85 void OnRoutePropMenuSelected(wxCommandEvent& event);
86 void OnRoutepropCopyTxtClick(wxCommandEvent& event);
87 void ItemEditOnMenuSelection(wxCommandEvent& event);
88 void ItemAddOnMenuSelection(wxCommandEvent& event);
89 void ItemDeleteOnMenuSelection(wxCommandEvent& event);
90 void AddLinkOnButtonClick(wxCommandEvent& event);
91 void BtnEditOnToggleButton(wxCommandEvent& event);
92 void OnHyperlinkClick(wxHyperlinkEvent& event);
93 void HyperlinkContextMenu(wxMouseEvent& event);
94 void m_scrolledWindowLinksOnContextMenu(wxMouseEvent& event);
96 wxDateTime GetDepartureTS();
97 void SaveChanges();
98 void ResetChanges();
99
100 void OnActivate(wxActivateEvent& event);
101
102 RoutePropDlgImpl(wxWindow* parent, wxWindowID id = wxID_ANY,
103 const wxString& title = _("Route Properties"),
104 const wxPoint& pos = wxDefaultPosition,
105 const wxSize& size = wxSize(550, 450),
106 long style = FRAME_WITH_LINKS_STYLE);
107
108private:
109 void SaveGeometry();
110 static bool instanceFlag;
111 static RoutePropDlgImpl* single;
112
118 Route* m_pRoute;
124 Route m_OrigRoute;
131 Route* m_pHead;
138 Route* m_pTail;
144 RoutePoint* m_pExtendPoint;
150 Route* m_pExtendRoute;
156 RoutePoint* m_pEnroutePoint;
163 bool m_bStartNow;
164
175 int m_tz_selection;
176
177 wxDataViewColumn* etd_col;
178
179 wxHyperlinkCtrl* m_pEditedLink;
180
181 bool IsThisRouteExtendable();
182
183 wxString MakeTideInfo(wxString stationName, double lat, double lon,
184 wxDateTime utcTime);
185};
186
187#endif // _ROUTEPROPDLGIMPL_H_
Represents a waypoint or mark within the navigation system.
Definition route_point.h:70
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:98