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#define SPEED_VMG 0
28#define SPEED_SOG 1
29
30#define ID_LEGROUTE 1000
31#define SECONDS_PER_DAY 86400
32
33class APConsole; // forward
34extern APConsole *console;
39class CDI : public wxWindow {
40public:
41 CDI(wxWindow *parent, wxWindowID id, long style, const wxString &name);
42
43 void OnPaint(wxPaintEvent &event);
44 void SetColorScheme(ColorScheme cs);
45 void MouseEvent(wxMouseEvent &event);
46
47 wxBrush *m_pbackBrush;
48 wxBrush *m_proadBrush;
49 wxPen *m_proadPen;
50
51 DECLARE_EVENT_TABLE()
52};
53
58class AnnunText : public wxWindow {
59public:
60 AnnunText(wxWindow *parent, wxWindowID id, const wxString &LegendElement,
61 const wxString &ValueElement);
62
63 ~AnnunText();
64
65 void SetALabel(const wxString &l);
66 void SetAValue(const wxString &v);
67 void OnPaint(wxPaintEvent &event);
68 void RefreshFonts(void);
69 void SetLegendElement(const wxString &element);
70 void SetValueElement(const wxString &element);
71 void SetColorScheme(ColorScheme cs);
72 void MouseEvent(wxMouseEvent &event);
73
74private:
75 void CalculateMinSize(void);
76
77 wxBrush m_backBrush;
78 wxColour m_default_text_color;
79
80 wxString m_label;
81 wxString m_value;
82 wxFont *m_plabelFont;
83 wxFont *m_pvalueFont;
84
85 wxString m_LegendTextElement;
86 wxString m_ValueTextElement;
87 wxColour m_legend_color;
88 wxColour m_val_color;
89
90 DECLARE_EVENT_TABLE()
91};
92
116class ConsoleCanvasWin : public wxWindow {
117public:
118 ConsoleCanvasWin(wxWindow *parent);
126 void UpdateRouteData();
133 void ShowWithFreshFonts(void);
134 void UpdateFonts(void);
135 void SetColorScheme(ColorScheme cs);
136 void LegRoute();
137 void OnContextMenu(wxContextMenuEvent &event);
138 void OnContextMenuSelection(wxCommandEvent &event);
139 void RefreshConsoleData(void);
140 void ToggleShowHighway();
141
151
152 wxWindow *m_pParent;
153 wxStaticText *pThisLegText;
154 wxBoxSizer *m_pitemBoxSizerLeg;
155
156 AnnunText *pXTE;
157 AnnunText *pBRG;
158 AnnunText *pRNG;
159 AnnunText *pTTG;
160 AnnunText *pVMG;
161 CDI *pCDI;
162
163 wxFont *pThisLegFont;
164 bool m_bNeedClear;
165 wxBrush *pbackBrush;
166
167private:
168 void OnPaint(wxPaintEvent &event);
169 void OnShow(wxShowEvent &event);
170 char m_speedUsed;
171
172 DECLARE_EVENT_TABLE()
173};
174
175class ConsoleCanvasFrame : public wxFrame {
176public:
177 ConsoleCanvasFrame(wxWindow *parent);
185 void UpdateRouteData();
192 void ShowWithFreshFonts(void);
193 void UpdateFonts(void);
194 void SetColorScheme(ColorScheme cs);
195 void LegRoute();
196 void OnContextMenu(wxContextMenuEvent &event);
197 void OnContextMenuSelection(wxCommandEvent &event);
198 void RefreshConsoleData(void);
199 void ToggleShowHighway();
200
210
211 wxWindow *m_pParent;
212 wxStaticText *pThisLegText;
213 wxBoxSizer *m_pitemBoxSizerLeg;
214
215 AnnunText *pXTE;
216 AnnunText *pBRG;
217 AnnunText *pRNG;
218 AnnunText *pTTG;
219 AnnunText *pVMG;
220 CDI *pCDI;
221
222 wxFont *pThisLegFont;
223 bool m_bNeedClear;
224 wxBrush *pbackBrush;
225
226private:
227 void OnPaint(wxPaintEvent &event);
228 void OnShow(wxShowEvent &event);
229 char m_speedUsed;
230
231 DECLARE_EVENT_TABLE()
232};
233
235public:
236 APConsole(wxWindow *parent);
237 virtual ~APConsole();
238
239 void SetColorScheme(ColorScheme cs);
240 bool IsShown();
241 void UpdateFonts(void);
242 void RefreshConsoleData(void);
243 void Raise();
244 void ShowWithFreshFonts(void);
245 void Show(bool bshow = true);
246 CDI *GetCDI();
247 wxSize GetSize();
248 void ToggleShowHighway();
249 void Move(wxPoint p);
250
251private:
252 ConsoleCanvasWin *m_con_win;
253 ConsoleCanvasFrame *m_con_frame;
254};
255
256#endif
Annunciator Text display.
Definition concanv.h:58
Course Deviation Indicator display.
Definition concanv.h:39
void OnPaint(wxPaintEvent &event)
Definition concanv.cpp:1088
void ToggleRouteTotalDisplay()
Toggles between route total and current leg display modes.
Definition concanv.cpp:656
void ShowWithFreshFonts(void)
Recomputes and applies new fonts to console elements.
Definition concanv.cpp:843
void UpdateRouteData()
Updates route-related data displays.
Definition concanv.cpp:673
Primary navigation console display for route and vessel tracking.
Definition concanv.h:116
void UpdateRouteData()
Updates route-related data displays.
Definition concanv.cpp:265
void ShowWithFreshFonts(void)
Recomputes and applies new fonts to console elements.
Definition concanv.cpp:434
void ToggleRouteTotalDisplay()
Toggles between route total and current leg display modes.
Definition concanv.cpp:248
APConsole * console
Global instance.
Definition concanv.cpp:55