OpenCPN Partial API docs
Loading...
Searching...
No Matches
track_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 TRACKPRINTOUT_H_
26#define TRACKPRINTOUT_H_
27
28#include <wx/cmdline.h>
29#include <wx/datetime.h>
30#include <wx/print.h>
31
32#ifdef __WXMSW__
33#include <wx/msw/private.h>
34#endif
35
36#include "model/ocpn_types.h"
37
38#include "dialog_input.h"
39#include "navutil.h"
40#include "printout_base.h"
41#include "printtable.h"
42#include "track_prop_dlg.h"
43#include "ui_utils.h"
44
45enum class TrackPrintOptions {
46 kTrackPosition,
47 kTrackCourse,
48 kTrackDistance,
49 kTrackTime,
50 kTrackSpeed
51};
52
57public:
58 TrackPrintDialog(wxWindow* parent, const std::set<int>& options)
59 : InputDialog(parent, _("Print Track").ToStdString()) {
60 AddSelection(options, TrackPrintOptions::kTrackPosition,
61 _("Print Track Position").ToStdString());
62 AddSelection(options, TrackPrintOptions::kTrackCourse,
63 _("Print Track Course").ToStdString());
64 AddSelection(options, TrackPrintOptions::kTrackDistance,
65 _("Print Track Distance").ToStdString());
66 AddSelection(options, TrackPrintOptions::kTrackTime,
67 _("Print Track Time").ToStdString());
68 AddSelection(options, TrackPrintOptions::kTrackSpeed,
69 _("Print Track Speed").ToStdString());
70 };
71};
72
77public:
83 TrackPrintout(Track* track, OCPNTrackListCtrl* lcPoints,
84 std::set<int> options);
85
86 void OnPreparePrinting() override;
87
88protected:
89 PrintTable m_table;
90 Track* m_track;
91
92 int m_text_offset_x;
93 int m_text_offset_y;
94
95 void DrawPage(wxDC* dc, int page) override;
96};
97
98#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 track print selection.
Printout a table with track selected information.
void DrawPage(wxDC *dc, int page) override
Called by the print framework to draw the page.
Represents a track, which is a series of connected track points.
Definition track.h:117
Utility functions.
Navigation data types.
Print support abstract base class.
OpenCPN Route table printout.
Track Properties Dialog.
GUI library utils and events.