OpenCPN Partial API docs
Loading...
Searching...
No Matches
route_printout.h
Go to the documentation of this file.
1/***************************************************************************
2 * Copyright (C) 2010 by David S. Register *
3 * Copyright (C) 2025 by NoCodeHummel *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, see <https://www.gnu.org/licenses/>. *
17 **************************************************************************/
18
25#ifndef ROUTEPRINTOUT_H_
26#define ROUTEPRINTOUT_H_
27
28#include <set>
29
30#include <wx/print.h>
31#include <wx/dc.h>
32
33#ifdef __WXMSW__
34#include <wx/msw/private.h>
35#endif
36
37#include "model/ocpn_types.h"
38
39#include "dialog_input.h"
40#include "navutil.h"
41#include "ocpn_frame.h"
42#include "printout_base.h"
43#include "printtable.h"
44#include "ui_utils.h"
45
46enum class RoutePrintOptions {
47 kWaypointName,
48 kWaypointPosition,
49 kWaypointCourse,
50 kWaypointDistance,
51 kWaypointDescription,
52 kWaypointSpeed,
53 kWaypointETA,
54 kWaypointETD,
55 kWaypointTideEvent
56};
57
62public:
63 RoutePrintDialog(wxWindow* parent, const std::set<int>& options)
64 : InputDialog(parent, _("Print Route").ToStdString()) {
65 AddSelection(options, RoutePrintOptions::kWaypointName,
66 _("Print Waypoint Name").ToStdString());
67 AddSelection(options, RoutePrintOptions::kWaypointPosition,
68 _("Print Waypoint Position").ToStdString());
69 AddSelection(options, RoutePrintOptions::kWaypointCourse,
70 _("Print Waypoint Course to Next").ToStdString());
71 AddSelection(options, RoutePrintOptions::kWaypointDistance,
72 _("Print Waypoint Distance to Next").ToStdString());
73 AddSelection(options, RoutePrintOptions::kWaypointSpeed,
74 _("Waypoint Leg Speed").ToStdString());
75 AddSelection(options, RoutePrintOptions::kWaypointETA,
76 _("Waypoint Estimated Time Arrival").ToStdString());
77 AddSelection(options, RoutePrintOptions::kWaypointETD,
78 _("Waypoint Estimated Time Departure").ToStdString());
79 AddSelection(options, RoutePrintOptions::kWaypointTideEvent,
80 _("Waypoint Next Tide Event").ToStdString());
81 AddSelection(options, RoutePrintOptions::kWaypointDescription,
82 _("Print Waypoint Description").ToStdString());
83 };
84};
85
91public:
98 RoutePrintout(Route* route, const std::set<int>& options,
99 const int tz_selection);
100
101 void OnPreparePrinting() override;
102
103protected:
104 PrintTable m_table;
105 Route* m_route;
106
107 int m_text_offset_x;
108 int m_text_offset_y;
109
110 void DrawPage(wxDC* dc, int page) override;
111};
112
113#endif
Application print support.
Input dialog with panel and flex grid sizer.
SwitchField * AddSelection(int key, const std::string &label, bool value)
Add key selection switch.
Extension of a class Table with printing into dc.
Definition printtable.h:178
Input dialog with route print selection.
Printout route information and a table with selected route point information.
void DrawPage(wxDC *dc, int page) override
Called by the print framework to draw the page.
Represents a navigational route in the navigation system.
Definition route.h:99
Utility functions.
OpenCPN top window.
Navigation data types.
Print support abstract base class.
OpenCPN Route table printout.
GUI library utils and events.