OpenCPN Partial API docs
Loading...
Searching...
No Matches
TCWin.h
1/******************************************************************************
2 *
3 * Project: OpenCPN
4 *
5 ***************************************************************************
6 * Copyright (C) 2013 by David S. Register *
7 * *
8 * This program is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU General Public License as published by *
10 * the Free Software Foundation; either version 2 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * This program is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU General Public License *
19 * along with this program; if not, write to the *
20 * Free Software Foundation, Inc., *
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
22 ***************************************************************************
23 */
24
25#ifndef __TCWIN_H__
26#define __TCWIN_H__
27
28#include <wx/frame.h>
29#include <wx/datetime.h>
30#include <wx/timer.h>
31#include <wx/list.h>
32
33class IDX_entry;
34class ChartCanvas;
35class RolloverWin;
36class wxTimerEvent;
37class wxCommandEvent;
38class wxCloseEvent;
39class wxTextCtrl;
40class wxButton;
41class wxListCtrl;
42class wxChoice;
43
44WX_DECLARE_LIST(wxPoint, SplineList); // for spline curve points
45
46class TCWin : public wxFrame {
47public:
48 TCWin(ChartCanvas *parent, int x, int y, void *pvIDX);
49 ~TCWin();
50
51 void OnSize(wxSizeEvent &event);
52 void OnPaint(wxPaintEvent &event);
53 void MouseEvent(wxMouseEvent &event);
54 void OnTCWinPopupTimerEvent(wxTimerEvent &event);
55 void OnTimeIndicatorTimer(wxTimerEvent &event);
56 void OKEvent(wxCommandEvent &event);
57 void NXEvent(wxCommandEvent &event);
58 void PREvent(wxCommandEvent &event);
59 void OnCloseWindow(wxCloseEvent &event);
60 void TimezoneOnChoice(wxCommandEvent &event);
61
62 void RePosition(void);
63
64 void RecalculateSize();
65 void SetTimeFactors();
66
67private:
68 wxTextCtrl *m_ptextctrl;
69 wxTimer m_TCWinPopupTimer;
70 wxTimer m_TimeIndicatorTimer;
71 RolloverWin *m_pTCRolloverWin;
72 int curs_x;
73 int curs_y;
74 int m_plot_type;
75 wxSize m_tc_size;
76 wxPoint m_position; // window ULC in screen coordinates
77 int m_x; // x coord of mouse click that launched window
78 int m_y; // y coord of mouse click that launched window
79 bool m_created;
80 int m_refDIM;
81 bool m_bcompactText;
82 int m_tsx; // test button width
83 int m_tsy; // test button height
84 float m_tcwin_scaler; // factor to scale TCWin and contents by
85 int m_choiceSize_x;
86
87 IDX_entry *pIDX;
88 wxButton *OK_button;
89 wxButton *NX_button;
90 wxButton *PR_button;
91 wxChoice *m_choiceTimezone;
92 int m_tzoneDisplay;
93
94 int im; // span of values to graph
95 int ib; // minimum value to graph
96 int it; // maximum value to graph
97 int val_off; // offset
98 int i_skip; // vertical stride in graph
99 wxRect m_graph_rect;
100
101 float tcv[26];
102 time_t tt_tcv[26];
103
104 wxListCtrl *m_tList;
105 bool btc_valid;
106 ChartCanvas *pParent;
107 int m_stationOffset_mins;
108 int m_diff_mins;
109 wxString m_stz;
110 int m_t_graphday_GMT;
111 wxDateTime m_graphday;
112 int m_plot_y_offset;
113
114 SplineList m_sList;
115
116 wxFont *pSFont;
117 wxFont *pSMFont;
118 wxFont *pMFont;
119 wxFont *pLFont;
120
121 wxPen *pblack_1;
122 wxPen *pblack_2;
123 wxPen *pblack_3;
124 wxPen *pblack_4;
125 wxPen *pred_2;
126 wxPen *pred_time;
127 wxPen *pgraph;
128 wxBrush *pltgray;
129 wxBrush *pltgray2;
130
131 int m_button_height;
132 int m_refTextHeight;
133
134 int xSpot;
135 int ySpot;
136
137 DECLARE_EVENT_TABLE()
138};
139
140#endif
ChartCanvas - Main chart display and interaction component.
Definition chcanv.h:153
Represents an index entry for tidal and current data.
Definition IDX_entry.h:49
Definition TCWin.h:46