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 OKEvent(wxCommandEvent &event);
56 void NXEvent(wxCommandEvent &event);
57 void PREvent(wxCommandEvent &event);
58 void OnCloseWindow(wxCloseEvent &event);
59 void TimezoneOnChoice(wxCommandEvent &event);
60
61 void RePosition(void);
62
63 void RecalculateSize();
64 void SetTimeFactors();
65
66private:
67 wxTextCtrl *m_ptextctrl;
68 wxTimer m_TCWinPopupTimer;
69 RolloverWin *m_pTCRolloverWin;
70 int curs_x;
71 int curs_y;
72 int m_plot_type;
73 wxSize m_tc_size;
74 wxPoint m_position; // window ULC in screen coordinates
75 int m_x; // x coord of mouse click that launched window
76 int m_y; // y coord of mouse click that launched window
77 bool m_created;
78 int m_refDIM;
79 bool m_bcompactText;
80 int m_tsx; // test button width
81 int m_tsy; // test button height
82 float m_tcwin_scaler; // factor to scale TCWin and contents by
83
84 IDX_entry *pIDX;
85 wxButton *OK_button;
86 wxButton *NX_button;
87 wxButton *PR_button;
88 wxChoice *m_choiceTimezone;
89 int m_tzoneDisplay;
90
91 int im; // span of values to graph
92 int ib; // minimum value to graph
93 int it; // maximum value to graph
94 int val_off; // offset
95 int i_skip; // vertical stride in graph
96 wxRect m_graph_rect;
97
98 float tcv[26];
99 time_t tt_tcv[26];
100
101 wxListCtrl *m_tList;
102 bool btc_valid;
103 ChartCanvas *pParent;
104 int m_stationOffset_mins;
105 int m_diff_mins;
106 wxString m_stz;
107 int m_t_graphday_GMT;
108 wxDateTime m_graphday;
109 int m_plot_y_offset;
110
111 SplineList m_sList;
112
113 wxFont *pSFont;
114 wxFont *pSMFont;
115 wxFont *pMFont;
116 wxFont *pLFont;
117
118 wxPen *pblack_1;
119 wxPen *pblack_2;
120 wxPen *pblack_3;
121 wxPen *pblack_4;
122 wxPen *pred_2;
123 wxBrush *pltgray;
124 wxBrush *pltgray2;
125
126 int m_button_height;
127
128 int xSpot;
129 int ySpot;
130
131 DECLARE_EVENT_TABLE()
132};
133
134#endif
Definition: IDX_entry.h:41
Definition: TCWin.h:46