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 "printout_base.h"
42#include "printtable.h"
43#include "ui_utils.h"
44
45enum class RoutePrintOptions {
46 kWaypointName,
47 kWaypointPosition,
48 kWaypointCourse,
49 kWaypointDistance,
50 kWaypointDescription,
51 kWaypointSpeed,
52 kWaypointETA,
53 kWaypointETD,
54 kWaypointTideEvent
55};
56
61public:
62 RoutePrintDialog(wxWindow* parent, const std::set<int>& options)
63 : InputDialog(parent, _("Print Route").ToStdString()) {
64 AddSelection(options, RoutePrintOptions::kWaypointName,
65 _("Print Waypoint Name").ToStdString());
66 AddSelection(options, RoutePrintOptions::kWaypointPosition,
67 _("Print Waypoint Position").ToStdString());
68 AddSelection(options, RoutePrintOptions::kWaypointCourse,
69 _("Print Waypoint Course to Next").ToStdString());
70 AddSelection(options, RoutePrintOptions::kWaypointDistance,
71 _("Print Waypoint Distance to Next").ToStdString());
72 AddSelection(options, RoutePrintOptions::kWaypointSpeed,
73 _("Waypoint Leg Speed").ToStdString());
74 AddSelection(options, RoutePrintOptions::kWaypointETA,
75 _("Waypoint Estimated Time Arrival").ToStdString());
76 AddSelection(options, RoutePrintOptions::kWaypointETD,
77 _("Waypoint Estimated Time Departure").ToStdString());
78 AddSelection(options, RoutePrintOptions::kWaypointTideEvent,
79 _("Waypoint Next Tide Event").ToStdString());
80 AddSelection(options, RoutePrintOptions::kWaypointDescription,
81 _("Print Waypoint Description").ToStdString());
82 };
83};
84
90public:
97 RoutePrintout(Route* route, const std::set<int>& options,
98 const int tz_selection);
99
100 void OnPreparePrinting() override;
101
102protected:
103 PrintTable m_table;
104 Route* m_route;
105
106 int m_text_offset_x;
107 int m_text_offset_y;
108
109 void DrawPage(wxDC* dc, int page) override;
110};
111
112#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.
Navigation data types.
Print support abstract base class.
OpenCPN Route table printout.
GUI library utils and events.