OpenCPN Partial API docs
Loading...
Searching...
No Matches
route_printout.h
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, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19 **************************************************************************/
20#ifndef __ROUTEPRINTOUT_H__
21#define __ROUTEPRINTOUT_H__
22
23#include <set>
24#include <wx/print.h>
25#include <wx/datetime.h>
26#include <wx/cmdline.h>
27
28#ifdef __WXMSW__
29#include <wx/msw/private.h>
30#endif
31
32#include "dialog_input.h"
33#include "model/ocpn_types.h"
34#include "navutil.h"
35#include "ocpn_frame.h"
36#include "printout_base.h"
37#include "printtable.h"
38#include "ui_utils.h"
39
40enum class RoutePrintOptions {
41 kWaypointName,
42 kWaypointPosition,
43 kWaypointCourse,
44 kWaypointDistance,
45 kWaypointDescription
46};
47
52public:
53 RoutePrintDialog(wxWindow* parent, const std::set<int>& options)
54 : InputDialog(parent, _("Print Route").ToStdString()) {
55 AddSelection(options, RoutePrintOptions::kWaypointName,
56 _("Print Waypoint Name").ToStdString());
57 AddSelection(options, RoutePrintOptions::kWaypointPosition,
58 _("Print Waypoint Position").ToStdString());
59 AddSelection(options, RoutePrintOptions::kWaypointCourse,
60 _("Print Waypoint Course to Next").ToStdString());
61 AddSelection(options, RoutePrintOptions::kWaypointDistance,
62 _("Print Waypoint Distance to Next").ToStdString());
63 AddSelection(options, RoutePrintOptions::kWaypointDescription,
64 _("Print Waypoint Description").ToStdString());
65 };
66};
67
73public:
79 RoutePrintout(Route* route, const std::set<int>& options);
80
81 void OnPreparePrinting() override;
82
83protected:
84 PrintTable m_table;
85 Route* m_route;
86
87 int m_text_offset_x;
88 int m_text_offset_y;
89
90 void DrawPage(wxDC* dc, int page) override;
91};
92
93#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:185
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:98
GUI library utils and events.