OpenCPN Partial API docs
Loading...
Searching...
No Matches
concanv.h
Go to the documentation of this file.
1/**************************************************************************
2 * Copyright (C) 2010 by David S. Register *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, see <https://www.gnu.org/licenses/>. *
16 **************************************************************************/
17
24#ifndef concanv_H_
25#define concanv_H_
26
27#include "ocpn_frame.h" //FIXME (dave) Only needed for colorscheme stuff
28
29#define SPEED_VMG 0
30#define SPEED_SOG 1
31
32#define ID_LEGROUTE 1000
33#define SECONDS_PER_DAY 86400
34
35class APConsole; // forward
36extern APConsole *console;
37
42class CDI : public wxWindow {
43public:
44 CDI(wxWindow *parent, wxWindowID id, long style, const wxString &name);
45
46 void OnPaint(wxPaintEvent &event);
47 void SetColorScheme(ColorScheme cs);
48 void MouseEvent(wxMouseEvent &event);
49
50 wxBrush *m_pbackBrush;
51 wxBrush *m_proadBrush;
52 wxPen *m_proadPen;
53
54 DECLARE_EVENT_TABLE()
55};
56
61class AnnunText : public wxWindow {
62public:
63 AnnunText(wxWindow *parent, wxWindowID id, const wxString &LegendElement,
64 const wxString &ValueElement);
65
66 ~AnnunText();
67
68 void SetALabel(const wxString &l);
69 void SetAValue(const wxString &v);
70 void OnPaint(wxPaintEvent &event);
71 void RefreshFonts(void);
72 void SetLegendElement(const wxString &element);
73 void SetValueElement(const wxString &element);
74 void SetColorScheme(ColorScheme cs);
75 void MouseEvent(wxMouseEvent &event);
76
77private:
78 void CalculateMinSize(void);
79
80 wxBrush m_backBrush;
81 wxColour m_default_text_color;
82
83 wxString m_label;
84 wxString m_value;
85 wxFont *m_plabelFont;
86 wxFont *m_pvalueFont;
87
88 wxString m_LegendTextElement;
89 wxString m_ValueTextElement;
90 wxColour m_legend_color;
91 wxColour m_val_color;
92
93 DECLARE_EVENT_TABLE()
94};
95
119class ConsoleCanvasWin : public wxWindow {
120public:
121 ConsoleCanvasWin(wxWindow *parent);
129 void UpdateRouteData();
136 void ShowWithFreshFonts(void);
137 void UpdateFonts(void);
138 void SetColorScheme(ColorScheme cs);
139 void LegRoute();
140 void OnContextMenu(wxContextMenuEvent &event);
141 void OnContextMenuSelection(wxCommandEvent &event);
142 void RefreshConsoleData(void);
143 void ToggleShowHighway();
144
154
155 wxWindow *m_pParent;
156 wxStaticText *pThisLegText;
157 wxBoxSizer *m_pitemBoxSizerLeg;
158
159 AnnunText *pXTE;
160 AnnunText *pBRG;
161 AnnunText *pRNG;
162 AnnunText *pTTG;
163 AnnunText *pVMG;
164 CDI *pCDI;
165
166 wxFont *pThisLegFont;
167 bool m_bNeedClear;
168 wxBrush *pbackBrush;
169
170private:
171 void OnPaint(wxPaintEvent &event);
172 void OnShow(wxShowEvent &event);
173 char m_speedUsed;
174
175 DECLARE_EVENT_TABLE()
176};
177
178class ConsoleCanvasFrame : public wxFrame {
179public:
180 ConsoleCanvasFrame(wxWindow *parent);
188 void UpdateRouteData();
195 void ShowWithFreshFonts(void);
196 void UpdateFonts(void);
197 void SetColorScheme(ColorScheme cs);
198 void LegRoute();
199 void OnContextMenu(wxContextMenuEvent &event);
200 void OnContextMenuSelection(wxCommandEvent &event);
201 void RefreshConsoleData(void);
202 void ToggleShowHighway();
203
213
214 wxWindow *m_pParent;
215 wxStaticText *pThisLegText;
216 wxBoxSizer *m_pitemBoxSizerLeg;
217
218 AnnunText *pXTE;
219 AnnunText *pBRG;
220 AnnunText *pRNG;
221 AnnunText *pTTG;
222 AnnunText *pVMG;
223 CDI *pCDI;
224
225 wxFont *pThisLegFont;
226 bool m_bNeedClear;
227 wxBrush *pbackBrush;
228
229private:
230 void OnPaint(wxPaintEvent &event);
231 void OnShow(wxShowEvent &event);
232 char m_speedUsed;
233
234 DECLARE_EVENT_TABLE()
235};
236
238public:
239 APConsole(wxWindow *parent);
240 virtual ~APConsole();
241
242 void SetColorScheme(ColorScheme cs);
243 bool IsShown();
244 void UpdateFonts(void);
245 void RefreshConsoleData(void);
246 void Raise();
247 void ShowWithFreshFonts(void);
248 void Show(bool bshow = true);
249 CDI *GetCDI();
250 wxSize GetSize();
251 void ToggleShowHighway();
252 void Move(wxPoint p);
253
254private:
255 ConsoleCanvasWin *m_con_win;
256 ConsoleCanvasFrame *m_con_frame;
257};
258
259#endif
Annunciator Text display.
Definition concanv.h:61
Course Deviation Indicator display.
Definition concanv.h:42
void OnPaint(wxPaintEvent &event)
Definition concanv.cpp:1101
void ToggleRouteTotalDisplay()
Toggles between route total and current leg display modes.
Definition concanv.cpp:659
void ShowWithFreshFonts(void)
Recomputes and applies new fonts to console elements.
Definition concanv.cpp:852
void UpdateRouteData()
Updates route-related data displays.
Definition concanv.cpp:676
Primary navigation console display for route and vessel tracking.
Definition concanv.h:119
void UpdateRouteData()
Updates route-related data displays.
Definition concanv.cpp:262
void ShowWithFreshFonts(void)
Recomputes and applies new fonts to console elements.
Definition concanv.cpp:437
void ToggleRouteTotalDisplay()
Toggles between route total and current leg display modes.
Definition concanv.cpp:245
APConsole * console
Global instance.
Definition concanv.cpp:52