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 ConsoleCanvasWin : public wxWindow {
128public:
129 ConsoleCanvasWin(wxWindow *parent);
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);
151 void ToggleShowHighway();
152
162
163 wxWindow *m_pParent;
164 wxStaticText *pThisLegText;
165 wxBoxSizer *m_pitemBoxSizerLeg;
166
167 AnnunText *pXTE;
168 AnnunText *pBRG;
169 AnnunText *pRNG;
170 AnnunText *pTTG;
171 AnnunText *pVMG;
172 CDI *pCDI;
173
174 wxFont *pThisLegFont;
175 bool m_bNeedClear;
176 wxBrush *pbackBrush;
177
178private:
179 void OnPaint(wxPaintEvent &event);
180 void OnShow(wxShowEvent &event);
181 char m_speedUsed;
182
183 DECLARE_EVENT_TABLE()
184};
185
186class ConsoleCanvasFrame : public wxFrame {
187public:
188 ConsoleCanvasFrame(wxWindow *parent);
196 void UpdateRouteData();
203 void ShowWithFreshFonts(void);
204 void UpdateFonts(void);
205 void SetColorScheme(ColorScheme cs);
206 void LegRoute();
207 void OnContextMenu(wxContextMenuEvent &event);
208 void OnContextMenuSelection(wxCommandEvent &event);
209 void RefreshConsoleData(void);
210 void ToggleShowHighway();
211
221
222 wxWindow *m_pParent;
223 wxStaticText *pThisLegText;
224 wxBoxSizer *m_pitemBoxSizerLeg;
225
226 AnnunText *pXTE;
227 AnnunText *pBRG;
228 AnnunText *pRNG;
229 AnnunText *pTTG;
230 AnnunText *pVMG;
231 CDI *pCDI;
232
233 wxFont *pThisLegFont;
234 bool m_bNeedClear;
235 wxBrush *pbackBrush;
236
237private:
238 void OnPaint(wxPaintEvent &event);
239 void OnShow(wxShowEvent &event);
240 char m_speedUsed;
241
242 DECLARE_EVENT_TABLE()
243};
244
246public:
247 APConsole(wxWindow *parent);
248 virtual ~APConsole();
249
250 void SetColorScheme(ColorScheme cs);
251 bool IsShown();
252 void UpdateFonts(void);
253 void RefreshConsoleData(void);
254 void Raise();
255 void ShowWithFreshFonts(void);
256 void Show(bool bshow = true);
257 CDI *GetCDI();
258 wxSize GetSize();
259 void ToggleShowHighway();
260 void Move(wxPoint p);
261
262private:
263 ConsoleCanvasWin *m_con_win;
264 ConsoleCanvasFrame *m_con_frame;
265};
266
267#endif
Annunciator Text display.
Definition concanv.h:69
Course Deviation Indicator display.
Definition concanv.h:50
void OnPaint(wxPaintEvent &event)
Definition concanv.cpp:1120
void ToggleRouteTotalDisplay()
Toggles between route total and current leg display modes.
Definition concanv.cpp:675
void ShowWithFreshFonts(void)
Recomputes and applies new fonts to console elements.
Definition concanv.cpp:871
void UpdateRouteData()
Updates route-related data displays.
Definition concanv.cpp:692
Primary navigation console display for route and vessel tracking.
Definition concanv.h:127
void UpdateRouteData()
Updates route-related data displays.
Definition concanv.cpp:275
void ShowWithFreshFonts(void)
Recomputes and applies new fonts to console elements.
Definition concanv.cpp:453
void ToggleRouteTotalDisplay()
Toggles between route total and current leg display modes.
Definition concanv.cpp:258