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;
41class CDI : public wxWindow {
42public:
43 CDI(wxWindow *parent, wxWindowID id, long style, const wxString &name);
44
45 void OnPaint(wxPaintEvent &event);
46 void SetColorScheme(ColorScheme cs);
47 void MouseEvent(wxMouseEvent &event);
48
49 wxBrush *m_pbackBrush;
50 wxBrush *m_proadBrush;
51 wxPen *m_proadPen;
52
53 DECLARE_EVENT_TABLE()
54};
55
60class AnnunText : public wxWindow {
61public:
62 AnnunText(wxWindow *parent, wxWindowID id, const wxString &LegendElement,
63 const wxString &ValueElement);
64
65 ~AnnunText();
66
67 void SetALabel(const wxString &l);
68 void SetAValue(const wxString &v);
69 void OnPaint(wxPaintEvent &event);
70 void RefreshFonts(void);
71 void SetLegendElement(const wxString &element);
72 void SetValueElement(const wxString &element);
73 void SetColorScheme(ColorScheme cs);
74 void MouseEvent(wxMouseEvent &event);
75
76private:
77 void CalculateMinSize(void);
78
79 wxBrush m_backBrush;
80 wxColour m_default_text_color;
81
82 wxString m_label;
83 wxString m_value;
84 wxFont *m_plabelFont;
85 wxFont *m_pvalueFont;
86
87 wxString m_LegendTextElement;
88 wxString m_ValueTextElement;
89 wxColour m_legend_color;
90 wxColour m_val_color;
91
92 DECLARE_EVENT_TABLE()
93};
94
118class ConsoleCanvasWin : public wxWindow {
119public:
120 ConsoleCanvasWin(wxWindow *parent);
128 void UpdateRouteData();
135 void ShowWithFreshFonts(void);
136 void UpdateFonts(void);
137 void SetColorScheme(ColorScheme cs);
138 void LegRoute();
139 void OnContextMenu(wxContextMenuEvent &event);
140 void OnContextMenuSelection(wxCommandEvent &event);
141 void RefreshConsoleData(void);
142 void ToggleShowHighway();
143
153
154 wxWindow *m_pParent;
155 wxStaticText *pThisLegText;
156 wxBoxSizer *m_pitemBoxSizerLeg;
157
158 AnnunText *pXTE;
159 AnnunText *pBRG;
160 AnnunText *pRNG;
161 AnnunText *pTTG;
162 AnnunText *pVMG;
163 CDI *pCDI;
164
165 wxFont *pThisLegFont;
166 bool m_bNeedClear;
167 wxBrush *pbackBrush;
168
169private:
170 void OnPaint(wxPaintEvent &event);
171 void OnShow(wxShowEvent &event);
172 char m_speedUsed;
173
174 DECLARE_EVENT_TABLE()
175};
176
177class ConsoleCanvasFrame : public wxFrame {
178public:
179 ConsoleCanvasFrame(wxWindow *parent);
187 void UpdateRouteData();
194 void ShowWithFreshFonts(void);
195 void UpdateFonts(void);
196 void SetColorScheme(ColorScheme cs);
197 void LegRoute();
198 void OnContextMenu(wxContextMenuEvent &event);
199 void OnContextMenuSelection(wxCommandEvent &event);
200 void RefreshConsoleData(void);
201 void ToggleShowHighway();
202
212
213 wxWindow *m_pParent;
214 wxStaticText *pThisLegText;
215 wxBoxSizer *m_pitemBoxSizerLeg;
216
217 AnnunText *pXTE;
218 AnnunText *pBRG;
219 AnnunText *pRNG;
220 AnnunText *pTTG;
221 AnnunText *pVMG;
222 CDI *pCDI;
223
224 wxFont *pThisLegFont;
225 bool m_bNeedClear;
226 wxBrush *pbackBrush;
227
228private:
229 void OnPaint(wxPaintEvent &event);
230 void OnShow(wxShowEvent &event);
231 char m_speedUsed;
232
233 DECLARE_EVENT_TABLE()
234};
235
237public:
238 APConsole(wxWindow *parent);
239 virtual ~APConsole();
240
241 void SetColorScheme(ColorScheme cs);
242 bool IsShown();
243 void UpdateFonts(void);
244 void RefreshConsoleData(void);
245 void Raise();
246 void ShowWithFreshFonts(void);
247 void Show(bool bshow = true);
248 CDI *GetCDI();
249 wxSize GetSize();
250 void ToggleShowHighway();
251 void Move(wxPoint p);
252
253private:
254 ConsoleCanvasWin *m_con_win;
255 ConsoleCanvasFrame *m_con_frame;
256};
257
258#endif
Annunciator Text display.
Definition concanv.h:60
Course Deviation Indicator display.
Definition concanv.h:41
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:118
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