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