OpenCPN Partial API docs
Loading...
Searching...
No Matches
chartdldrgui.h
1
2// C++ code generated with wxFormBuilder (version Jun 6 2014)
3// http://www.wxformbuilder.org/
4//
5// PLEASE DO "NOT" EDIT THIS FILE!
7
8#ifndef __CHARTDLDRGUI_H__
9#define __CHARTDLDRGUI_H__
10
11#include <wx/artprov.h>
12#include <wx/xrc/xmlres.h>
13#include <wx/intl.h>
14#include <wx/treectrl.h>
15#include <wx/gdicmn.h>
16#include <wx/font.h>
17#include <wx/colour.h>
18#include <wx/settings.h>
19#include <wx/string.h>
20#include <wx/sizer.h>
21#include <wx/panel.h>
22#include <wx/bitmap.h>
23#include <wx/image.h>
24#include <wx/icon.h>
25#include <wx/stattext.h>
26#include <wx/textctrl.h>
27#include <wx/notebook.h>
28#include <wx/statbox.h>
29#include <wx/filepicker.h>
30#include <wx/button.h>
31#include <wx/dialog.h>
32#include <wx/listctrl.h>
33#include <wx/combobox.h>
34#include <wx/checkbox.h>
35#include <wx/statline.h>
36#include <wx/dcmemory.h>
37#include "ocpn_plugin.h"
38
39#if defined(CHART_LIST)
40#include <wx/dataview.h>
41#endif /* CHART_LIST */
43
44#if defined(CHART_LIST) // Are we building using wxDataViewListCtrl?
45// We don't use ArrayOfChartPanels when using wxDataViewListCtrl
46#else
47class ChartPanel;
49#endif /* CHART_LIST */
50
51class DLDR_OCPNChartDirPanel : public wxPanel {
52public:
53 DLDR_OCPNChartDirPanel(wxWindow* parent, wxWindowID id, const wxPoint& pos,
54 const wxSize& size);
56
57 void OnPaint(wxPaintEvent& event);
58 int GetUnselectedHeight() { return m_unselectedHeight; }
59 int GetRefHeight() { return m_refHeight; }
60 void SetText(wxString text);
61
62private:
63 // bool m_bSelected;
64 wxColour m_boxColour;
65 int m_unselectedHeight;
66 wxString m_ChartDir;
67 int m_refHeight;
68
69 DECLARE_EVENT_TABLE()
70};
71
75class AddSourceDlg : public wxDialog {
76private:
77protected:
78 wxPanel* m_panelPredefined;
79 wxPanel* m_panelCustom;
80 wxStaticText* m_stName;
81 wxStaticText* m_stUrl;
82 wxStdDialogButtonSizer* m_sdbSizerBtns;
83 wxButton* m_sdbSizerBtnsOK;
84 wxButton* m_sdbSizerBtnsCancel;
85
86 // Virtual event handlers, overide them in your derived class
87 virtual void OnSourceSelected(wxTreeEvent& event) { event.Skip(); }
88 virtual void OnOkClick(wxCommandEvent& event) { event.Skip(); }
89 virtual void OnCancelClick(wxCommandEvent& event) { event.Skip(); }
90 void OnDirSelClick(wxCommandEvent& event);
91 void applyStyle();
92
93public:
94 wxNotebook* m_nbChoice;
95 wxTreeCtrl* m_treeCtrlPredefSrcs;
96 wxTextCtrl* m_tSourceName;
97 wxTextCtrl* m_tChartSourceUrl;
98 // wxDirPickerCtrl* m_dpChartDirectory;
99 wxTextCtrl* m_tcChartDirectory;
100 DLDR_OCPNChartDirPanel* m_panelChartDirectory;
101
102 wxButton* m_buttonChartDirectory;
103 wxScrolledWindow* m_sourceswin;
104 wxString m_dirExpanded;
105
106 AddSourceDlg(wxWindow* parent, wxWindowID id = wxID_ANY,
107 const wxString& title = _("New chart source"),
108 const wxPoint& pos = wxDefaultPosition,
109 const wxSize& size = wxDefaultSize,
110 long style = wxDEFAULT_DIALOG_STYLE);
112 void OnNbPage(wxNotebookEvent& event);
113};
114
118class ChartDldrPanel : public wxPanel {
119private:
120protected:
121 wxListCtrl* m_lbChartSources;
122 wxButton* m_bAddSource;
123 wxButton* m_bDeleteSource;
124 wxButton* m_bEditSource;
125 wxButton* m_bUpdateChartList;
126 wxButton* m_bUpdateAllCharts;
127 wxStaticText* m_stCatalogInfo;
128 wxButton* m_bDnldCharts;
129 // wxButton* m_bShowLocal;
130#if defined(CHART_LIST)
131 // Buttons for selecting charts to download
132 wxButton* m_bClear;
133 wxButton* m_bSelectNew;
134 wxButton* m_bSelectUpdated;
135 wxButton* m_bSelectAll;
136#endif /* CHART_LIST */
137 wxNotebook* m_DLoadNB;
138 wxString m_csTitle;
139 wxStaticText* m_chartsLabel;
140#if !defined(CHART_LIST) // The chart list viewer does not use m_panelArray
141 std::vector<std::unique_ptr<ChartPanel>> m_panelArray;
142#endif /* CHART_LIST */
143 wxBoxSizer* m_boxSizerCharts;
144
145 // Virtual event handlers, overide them in your derived class
146 virtual void OnPaint(wxPaintEvent& event) { event.Skip(); }
147 virtual void OnLeftDClick(wxMouseEvent& event) { event.Skip(); }
148 virtual void SelectSource(wxListEvent& event) { event.Skip(); }
149 virtual void AddSource(wxCommandEvent& event) { event.Skip(); }
150 virtual void DeleteSource(wxCommandEvent& event) { event.Skip(); }
151 virtual void EditSource(wxCommandEvent& event) { event.Skip(); }
152 virtual void UpdateChartList(wxCommandEvent& event) { event.Skip(); }
153 virtual void UpdateAllCharts(wxCommandEvent& event) { event.Skip(); }
154 virtual void DoHelp(wxCommandEvent& event) { event.Skip(); }
155 virtual void OnDownloadCharts(wxCommandEvent& event) { event.Skip(); }
156 virtual void OnShowLocalDir(wxCommandEvent& event) { event.Skip(); }
157 virtual void OnSize(wxSizeEvent& event);
158#ifdef HAVE_WX_GESTURE_EVENTS
159 void OnLongPress(wxLongPressEvent& event);
160#endif
161
162#if defined(CHART_LIST)
163 virtual void OnSelectChartItem(wxCommandEvent& event) { event.Skip(); }
164 virtual void OnSelectNewCharts(wxCommandEvent& event) { event.Skip(); }
165 virtual void OnSelectUpdatedCharts(wxCommandEvent& event) { event.Skip(); }
166 virtual void OnSelectAllCharts(wxCommandEvent& event) { event.Skip(); }
167#endif /* CHART_LIST */
168public:
169#if defined(CHART_LIST)
170 wxDataViewListCtrl* m_scrollWinChartList;
171 virtual wxDataViewListCtrl* getChartList() { return m_scrollWinChartList; }
172 virtual bool isNew(int item) {
173 return (m_scrollWinChartList->GetTextValue(item, 1) == _("New"));
174 }
175 virtual bool isUpdated(int item) {
176 return (m_scrollWinChartList->GetTextValue(item, 1) == _("Out of date"));
177 }
178 virtual void clearChartList() { m_scrollWinChartList->DeleteAllItems(); }
179#else
180 wxScrolledWindow* m_scrollWinChartList;
181#endif /* CHART_LIST */
182
183 virtual void SetChartInfo(const wxString& info) {
184 m_stCatalogInfo->SetLabel(info);
185 m_stCatalogInfo->Show(true);
186 }
187 ChartDldrPanel(wxWindow* parent, wxWindowID id = wxID_ANY,
188 const wxPoint& pos = wxDefaultPosition,
189 const wxSize& size = wxSize(-1, -1),
190 long style = wxTAB_TRAVERSAL);
192 // ChartDldrPanel() { }
193
194 virtual void OnContextMenu(wxMouseEvent& event) { event.Skip(); }
195};
196
200class ChartDldrPrefsDlg : public wxDialog {
201private:
202protected:
203 // wxDirPickerCtrl* m_dpDefaultDir;
204 wxStaticText* m_stPreselect;
205 wxCheckBox* m_cbSelectUpdated;
206 wxCheckBox* m_cbSelectNew;
207 wxStaticLine* m_staticline1;
208 wxCheckBox* m_cbBulkUpdate;
209 wxStdDialogButtonSizer* m_sdbSizerBtns;
210 wxButton* m_bHelp;
211 wxButton* m_sdbSizerBtnsOK;
212 wxButton* m_sdbSizerBtnsCancel;
213 wxButton* m_buttonChartDirectory;
214 wxButton* m_buttonDownloadMasterCatalog;
215 wxTextCtrl* m_tcDefaultDir;
216 DLDR_OCPNChartDirPanel* m_panelChartDirectory;
217
218 void OnDirSelClick(wxCommandEvent& event);
219 void OnDownloadMasterCatalog(wxCommandEvent& event);
220
221 // Virtual event handlers, overide them in your derived class
222 virtual void OnCancelClick(wxCommandEvent& event);
223 virtual void OnOkClick(wxCommandEvent& event);
224
225public:
226 ChartDldrPrefsDlg(wxWindow* parent, wxWindowID id = wxID_ANY,
227 const wxString& title = _("Chart Downloader Preferences"),
228 const wxPoint& pos = wxDefaultPosition,
229 const wxSize& size = wxSize(462, 331),
230 long style = wxDEFAULT_DIALOG_STYLE);
232};
233
234// We only use this object type in "old-style" chart listing
235#if !defined(CHART_LIST)
236class ChartPanel : public wxPanel {
237public:
238 ChartPanel(wxWindow* parent, wxWindowID id, const wxPoint& pos,
239 const wxSize& size, wxString Name, wxString stat, wxString latest,
240 ChartDldrPanel* DldrPanel, bool bcheck);
241 ~ChartPanel();
242
243 void OnContextMenu(wxMouseEvent& event);
244 wxCheckBox* GetCB() { return m_cb; }
245 bool isNew() { return (m_stat == _("New")); }
246 bool isUpdated() { return (m_stat == _("Out of date")); }
247 void OnLeftUp(wxMouseEvent& event);
248#ifdef HAVE_WX_GESTURE_EVENTS
249 void OnLongPress(wxLongPressEvent& event);
250#endif
251
252private:
253 wxCheckBox* m_cb;
254 // wxStaticText *m_chartInfo;
255 // wxStaticText *m_chartInfo2;
256 wxString m_stat;
257 wxString m_latest;
258 ChartDldrPanel* m_dldrPanel;
259 bool m_popupWanted;
260};
261#endif /* CHART_PANEL */
262
263#endif //__CHARTDLDRGUI_H__
Class AddSourceDlg.
Implementing ChartDldrPanel.
Class ChartDldrPanel.
Class ChartDldrPrefsDlg.
PlugIn Object Definition/API.