OpenCPN Partial API docs
Loading...
Searching...
No Matches
concanv.h
1/******************************************************************************
2 *
3 * Project: OpenCPN
4 * Purpose: Console Canvas
5 * Author: David Register
6 *
7 ***************************************************************************
8 * Copyright (C) 2010 by David S. Register *
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 * This program is distributed in the hope that it will be useful, *
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
18 * GNU General Public License for more details. *
19 * *
20 * You should have received a copy of the GNU General Public License *
21 * along with this program; if not, write to the *
22 * Free Software Foundation, Inc., *
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
24 ***************************************************************************
25 *
26 */
27
28#ifndef __concanv_H__
29#define __concanv_H__
30
31//----------------------------------------------------------------------------
32// constants
33//----------------------------------------------------------------------------
34
35#include "ocpn_frame.h" //FIXME (dave) Only needed for colorscheme stuff
36
37#define SPEED_VMG 0
38#define SPEED_SOG 1
39
40#define ID_LEGROUTE 1000
41#define SECONDS_PER_DAY 86400
42
43// Class declarations
44class Routeman;
45
50class CDI : public wxWindow {
51public:
52 CDI(wxWindow *parent, wxWindowID id, long style, const wxString &name);
53
54 void OnPaint(wxPaintEvent &event);
55 void SetColorScheme(ColorScheme cs);
56 void MouseEvent(wxMouseEvent &event);
57
58 wxBrush *m_pbackBrush;
59 wxBrush *m_proadBrush;
60 wxPen *m_proadPen;
61
62 DECLARE_EVENT_TABLE()
63};
64
69class AnnunText : public wxWindow {
70public:
71 AnnunText(wxWindow *parent, wxWindowID id, const wxString &LegendElement,
72 const wxString &ValueElement);
73
74 ~AnnunText();
75
76 void SetALabel(const wxString &l);
77 void SetAValue(const wxString &v);
78 void OnPaint(wxPaintEvent &event);
79 void RefreshFonts(void);
80 void SetLegendElement(const wxString &element);
81 void SetValueElement(const wxString &element);
82 void SetColorScheme(ColorScheme cs);
83 void MouseEvent(wxMouseEvent &event);
84
85private:
86 void CalculateMinSize(void);
87
88 wxBrush m_backBrush;
89 wxColour m_default_text_color;
90
91 wxString m_label;
92 wxString m_value;
93 wxFont *m_plabelFont;
94 wxFont *m_pvalueFont;
95
96 wxString m_LegendTextElement;
97 wxString m_ValueTextElement;
98 wxColour m_legend_color;
99 wxColour m_val_color;
100
101 DECLARE_EVENT_TABLE()
102};
103
127class ConsoleCanvas : public wxFrame {
128public:
129 ConsoleCanvas(wxWindow *frame);
137 void UpdateRouteData();
144 void ShowWithFreshFonts(void);
145 void UpdateFonts(void);
146 void SetColorScheme(ColorScheme cs);
147 void LegRoute();
148 void OnContextMenu(wxContextMenuEvent &event);
149 void OnContextMenuSelection(wxCommandEvent &event);
150 void RefreshConsoleData(void);
160
161 wxWindow *m_pParent;
162 wxStaticText *pThisLegText;
163 wxBoxSizer *m_pitemBoxSizerLeg;
164
165 AnnunText *pXTE;
166 AnnunText *pBRG;
167 AnnunText *pRNG;
168 AnnunText *pTTG;
169 AnnunText *pVMG;
170 CDI *pCDI;
171
172 wxFont *pThisLegFont;
173 bool m_bNeedClear;
174 wxBrush *pbackBrush;
175
176private:
177 void OnPaint(wxPaintEvent &event);
178 void OnShow(wxShowEvent &event);
179 char m_speedUsed;
180
181 DECLARE_EVENT_TABLE()
182};
183
184#endif
Annunciator Text display.
Definition concanv.h:69
Course Deviation Indicator display.
Definition concanv.h:50
void OnPaint(wxPaintEvent &event)
Definition concanv.cpp:682
Primary navigation console display for route and vessel tracking.
Definition concanv.h:127
void ShowWithFreshFonts(void)
Recomputes and applies new fonts to console elements.
Definition concanv.cpp:440
void UpdateRouteData()
Updates route-related data displays.
Definition concanv.cpp:261
void ToggleRouteTotalDisplay()
Toggles between route total and current leg display modes.
Definition concanv.cpp:251