OpenCPN Partial API docs
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 
33 class IDX_entry;
34 class ChartCanvas;
35 class RolloverWin;
36 class wxTimerEvent;
37 class wxCommandEvent;
38 class wxCloseEvent;
39 class wxTextCtrl;
40 class wxButton;
41 class wxListCtrl;
42 class wxChoice;
43 
44 WX_DECLARE_LIST(wxPoint, SplineList); // for spline curve points
45 
46 class TCWin : public wxFrame {
47 public:
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 
66 private:
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  int m_choiceSize_x;
84 
85  IDX_entry *pIDX;
86  wxButton *OK_button;
87  wxButton *NX_button;
88  wxButton *PR_button;
89  wxChoice *m_choiceTimezone;
90  int m_tzoneDisplay;
91 
92  int im; // span of values to graph
93  int ib; // minimum value to graph
94  int it; // maximum value to graph
95  int val_off; // offset
96  int i_skip; // vertical stride in graph
97  wxRect m_graph_rect;
98 
99  float tcv[26];
100  time_t tt_tcv[26];
101 
102  wxListCtrl *m_tList;
103  bool btc_valid;
104  ChartCanvas *pParent;
105  int m_stationOffset_mins;
106  int m_diff_mins;
107  wxString m_stz;
108  int m_t_graphday_GMT;
109  wxDateTime m_graphday;
110  int m_plot_y_offset;
111 
112  SplineList m_sList;
113 
114  wxFont *pSFont;
115  wxFont *pSMFont;
116  wxFont *pMFont;
117  wxFont *pLFont;
118 
119  wxPen *pblack_1;
120  wxPen *pblack_2;
121  wxPen *pblack_3;
122  wxPen *pblack_4;
123  wxPen *pred_2;
124  wxPen *pgraph;
125  wxBrush *pltgray;
126  wxBrush *pltgray2;
127 
128  int m_button_height;
129  int m_refTextHeight;
130 
131  int xSpot;
132  int ySpot;
133 
134  DECLARE_EVENT_TABLE()
135 };
136 
137 #endif
Definition: IDX_entry.h:41
Definition: TCWin.h:46