OpenCPN Partial API docs
Loading...
Searching...
No Matches
track_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
21#ifndef __TRACKPRINTOUT_H__
22#define __TRACKPRINTOUT_H__
23
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 "TrackPropDlg.h"
36#include "printout_base.h"
37#include "printtable.h"
38#include "ui_utils.h"
39
40enum class TrackPrintOptions {
41 kTrackPosition,
42 kTrackCourse,
43 kTrackDistance,
44 kTrackTime,
45 kTrackSpeed
46};
47
52public:
53 TrackPrintDialog(wxWindow* parent, const std::set<int>& options)
54 : InputDialog(parent, _("Print Track").ToStdString()) {
55 AddSelection(options, TrackPrintOptions::kTrackPosition,
56 _("Print Track Position").ToStdString());
57 AddSelection(options, TrackPrintOptions::kTrackCourse,
58 _("Print Track Course").ToStdString());
59 AddSelection(options, TrackPrintOptions::kTrackDistance,
60 _("Print Track Distance").ToStdString());
61 AddSelection(options, TrackPrintOptions::kTrackTime,
62 _("Print Track Time").ToStdString());
63 AddSelection(options, TrackPrintOptions::kTrackSpeed,
64 _("Print Track Speed").ToStdString());
65 };
66};
67
72public:
78 TrackPrintout(Track* track, OCPNTrackListCtrl* lcPoints,
79 std::set<int> options);
80
81 void OnPreparePrinting() override;
82
83protected:
84 PrintTable m_table;
85 Track* m_track;
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 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:111
GUI library utils and events.