32#include <wx/listctrl.h>
33#include "ocpn_frame.h"
34#include <wx/hyperlink.h>
37#include <wx/bmpcbox.h>
38#include <wx/notebook.h>
39#include <wx/filesys.h>
40#include <wx/clrpicker.h>
41#include <wx/odcombo.h>
42#include <wx/gbsizer.h>
43#include <wx/spinctrl.h>
44#include "LinkPropDlg.h"
46#include <wx/htmllbox.h>
47#include <wx/datectrl.h>
48#include <wx/timectrl.h>
49#include <wx/dateevt.h>
51#include <wx/combobox.h>
58#include "time_textbox.h"
61#define ID_WPT_RANGERINGS_NO 7507
62#define ID_RCLK_MENU_COPY_TEXT 7013
63#define ID_RCLK_MENU_DELETE 7015
64#define ID_RCLK_MENU_COPY 7016
65#define ID_RCLK_MENU_COPY_LL 7017
66#define ID_RCLK_MENU_PASTE 7018
67#define ID_RCLK_MENU_PASTE_LL 7019
68#define ID_RCLK_MENU_DELETE_LINK 7023
69#define ID_RCLK_MENU_EDIT_LINK 7024
70#define ID_RCLK_MENU_ADD_LINK 7025
73#include "OCPNPlatform.h"
91#define ID_MARKPROP 8000
92#define SYMBOL_MARKPROP_STYLE \
93 wxCAPTION | wxRESIZE_BORDER | wxSYSTEM_MENU | wxCLOSE_BOX
94#define SYMBOL_MARKPROP_TITLE _("Waypoint Properties")
95#define SYMBOL_MARKPROP_IDNAME ID_MARKPROP
96#define SYMBOL_MARKPROP_SIZE wxSize(200, 300)
97#define SYMBOL_MARKPROP_POSITION wxDefaultPosition
98#define ID_MARKPROP_CANCEL 8001
99#define ID_MARKPROP_OK 8002
100#define ID_ICONCTRL 8003
101#define ID_LATCTRL 8004
102#define ID_LONCTRL 8005
103#define ID_SHOWNAMECHECKBOXBASIC 8006
104#define ID_BITMAPCOMBOCTRL 8007
105#define ID_NAMECTRL 8008
106#define wxID_HTMLLIST 8009
107#define ID_DESCR_CTR_DESC 8010
108#define ID_DESCR_CTR_BASIC 8011
109#define ID_BTN_DESC_BASIC 8012
110#define ID_ETA_DATEPICKERCTRL 8013
111#define ID_ETA_TIMEPICKERCTRL 8014
112#define ID_SHOWNAMECHECKBOX_EXT 8015
113#define ID_CHECKBOX_VIS_EXT 8016
114#define ID_CHECKBOX_SCAMIN_VIS 8017
115#define ID_SET_DEFAULT_ICON 8018
116#define ID_SET_DEFAULT_RANGERINGS 8019
117#define ID_SET_DEFAULT_ARRIVALRADIUS 8020
118#define ID_SET_DEFAULT_SCAMIN 8021
119#define ID_SET_DEFAULT_NAMEVIS 8022
120#define ID_SET_DEFAULT_ALL 8023
121#define ID_BTN_LINK_MENU 8024
122#define ID_DEFAULT 8025
123#define ID_BTN_SHOW_TIDES 8026
132#define wxCLOSE_BOX 0x1000
134#ifndef wxFIXED_MINSIZE
135#define wxFIXED_MINSIZE 0
138WX_DECLARE_OBJARRAY(wxBitmap, ArrayOfBitmaps);
148 OCPNIconCombo(wxWindow* parent, wxWindowID
id,
const wxString& value = _T(
""),
149 const wxPoint& pos = wxDefaultPosition,
150 const wxSize& size = wxDefaultSize,
int n = 0,
151 const wxString choices[] = NULL,
long style = 0,
152 const wxValidator& validator = wxDefaultValidator,
153 const wxString& name = _T(
"OCPNIconCombo"));
157 void OnDrawItem(wxDC& dc,
const wxRect& rect,
int item,
int flags)
const;
158 wxCoord OnMeasureItem(
size_t item)
const;
159 wxCoord OnMeasureItemWidth(
size_t item)
const;
161 int Append(
const wxString& item, wxBitmap bmp);
166 ArrayOfBitmaps bmpArray;
175extern const wxEventType EVT_LLCHANGE;
179 DECLARE_EVENT_TABLE()
183 const wxString& value = _T(
""),
184 const wxPoint& pos = wxDefaultPosition,
185 const wxSize& size = wxDefaultSize,
long style = 0,
186 const wxValidator& validator = wxDefaultValidator,
187 const wxString& name = wxTextCtrlNameStr);
189 void OnKillFocus(wxFocusEvent& event);
191 wxEvtHandler* m_pParentEventHandler;
198 DECLARE_EVENT_TABLE()
203 static bool instanceFlag;
206 bool m_bShowName_save;
207 wxString m_Name_save;
208 wxString m_IconName_save;
209 int m_current_icon_Index;
212 wxString m_Description_save;
213 HyperlinkList* m_pMyLinkList;
214 bool m_bIsVisible_save;
215 bool m_bUseScaMin_save;
216 int m_iScaminVal_save;
217 bool m_bShowWaypointRangeRings_save;
218 int m_iWaypointRangeRingsNumber_save;
219 float m_fWaypointRangeRingsStep_save;
220 wxColour m_wxcWaypointRangeRingsColour_save;
221 double m_WaypointArrivalRadius_save;
222 float m_PlannedSpeed_save;
223 wxDateTime m_ArrETA_save;
224 std::map<double, const IDX_entry*> m_tss;
225 wxString m_lasttspos;
229 wxBoxSizer* bSizerBasicProperties;
230 wxBoxSizer* bSizerLinks;
231 wxButton* m_buttonExtDescription;
232 wxButton* m_buttonLinksMenu;
233 wxBitmapButton* m_buttonShowTides;
234 wxButton* DefaultsBtn;
235 wxCheckBox* m_checkBoxScaMin;
236 wxCheckBox* m_checkBoxShowName;
237 wxCheckBox* m_checkBoxShowNameExt;
238 wxCheckBox* m_checkBoxVisible;
239 wxChoice* m_choiceWaypointRangeRingsUnits;
240 wxColourPickerCtrl* m_PickColor;
241 wxCheckBox* m_cbEtaPresent;
242 wxBoxSizer* bMainSizer;
243 wxFlexGridSizer* fSizerBasicProperties;
244 wxFlexGridSizer* waypointradarGrid;
245 wxFlexGridSizer* waypointrrSelect;
246 wxGridBagSizer* bGB_SizerProperties;
247 wxFlexGridSizer* gbSizerInnerProperties;
248 wxNotebook* m_notebookProperties;
249 wxObject* m_contextObject;
250 wxScrolledWindow* m_panelBasicProperties;
251 wxPanel* m_panelDescription;
252 wxScrolledWindow* m_panelExtendedProperties;
253 wxSimpleHtmlListBox* m_htmlList;
254 wxSize m_defaultClientSize;
255 wxChoice* m_ChoiceWaypointRangeRingsNumber;
256 wxStaticBitmap* m_bitmapIcon;
257 wxStaticBoxSizer* sbS_Description;
258 wxStaticBoxSizer* sbSizerExtProperties;
259 wxStaticBoxSizer* sbSizerLinks;
260 wxStaticBoxSizer* sbSizerBasicProperties;
261 wxStaticBoxSizer* sbRangeRingsExtProperties;
262 wxStaticBoxSizer* sbSizerDescription;
263 wxStaticText* m_staticTextArrivalRadius;
264 wxStaticText* m_staticTextDescription;
265 wxStaticText* m_staticTextEditEnabled;
266 wxStaticText* m_staticTextGpx;
267 wxStaticText* m_staticTextGuid;
268 wxStaticText* m_staticTextTideStation;
269 wxStaticText* m_staticTextIcon;
270 wxStaticText* m_staticTextLatitude;
271 wxStaticText* m_staticTextLayer;
272 wxStaticText* m_staticTextLongitude;
273 wxStaticText* m_staticTextName;
274 wxStaticText* m_staticTextScaMin;
275 wxStaticText* m_staticTextShowNameExt;
276 wxStaticText* m_staticTextRR1;
277 wxStaticText* m_staticTextRR2;
278 wxChoice* m_RangeRingUnits;
279 wxStaticText* m_staticTextRR4;
280 wxStaticText* m_staticTextArrivalUnits;
281 wxStaticText* m_staticTextPlSpeed;
282 wxStaticText* m_staticTextEta;
283 wxStaticText* m_staticTextPlSpeedUnits;
284 wxStdDialogButtonSizer* m_sdbSizerButtons;
285 wxTextCtrl* m_textArrivalRadius;
286 wxTextCtrl* m_textCtrlExtDescription;
287 wxTextCtrl* m_textCtrlGpx;
288 wxTextCtrl* m_textCtrlGuid;
289 wxScrolledWindow* m_scrolledWindowLinks;
290 wxHyperlinkCtrl* m_hyperlink17;
292 wxToggleButton* m_toggleBtnEdit;
293 wxButton* m_buttonAddLink;
295#ifdef __OCPN__ANDROID__
296 wxChoice* m_comboBoxTideStation;
298 wxComboBox* m_comboBoxTideStation;
300 wxTextCtrl* m_textDescription;
301 wxTextCtrl* m_textLatitude;
302 wxTextCtrl* m_textLongitude;
303 wxTextCtrl* m_textName;
304 wxTextCtrl* m_textScaMin;
305 wxTextCtrl* m_textWaypointRangeRingsStep;
306 wxTextCtrl* m_textCtrlPlSpeed;
307 wxBitmap _img_MUI_settings_svg;
308 wxButton* m_sdbSizerButtonsCancel;
309 wxButton* m_sdbSizerButtonsOK;
311 wxDatePickerCtrl* m_EtaDatePickerCtrl;
315 wxTimePickerCtrl* m_EtaTimePickerCtrl;
317 wxArrayString m_choiceTideChoices;
320 wxHyperlinkCtrl* m_pEditedLink;
322 void initialize_images(
void);
323 void OnBitmapCombClick(wxCommandEvent& event);
324 void OnPositionCtlUpdated(wxCommandEvent& event);
325 void OnExtDescriptionClick(wxCommandEvent& event);
326 void OnDescChangedExt(wxCommandEvent& event);
327 void OnDescChangedBasic(wxCommandEvent& event);
328 void OnMarkInfoCancelClick(wxCommandEvent& event);
329 void OnMarkInfoOKClick(wxCommandEvent& event);
330 void OnShowWaypointNameSelectBasic(wxCommandEvent& event);
331 void OnShowWaypointNameSelectExt(wxCommandEvent& event);
332 void OnSelectScaMinExt(wxCommandEvent& event);
333 void OnWptRangeRingsNoChange(wxCommandEvent& event);
334 void OnCopyPasteLatLon(wxCommandEvent& event);
335 void OnWaypointRangeRingSelect(wxCommandEvent& event);
336 void m_htmlListContextMenuBtn(wxCommandEvent& event);
337 void m_htmlListContextMenu(wxMouseEvent& event);
338 void OnRightClickLatLon(wxCommandEvent& event);
339 void OnHtmlLinkClicked(wxHtmlLinkEvent& event);
340 void OnHyperLinkClick(wxHyperlinkEvent& event);
342 void On_html_link_popupmenu_Click(wxCommandEvent& event);
343 void DefautlBtnClicked(wxCommandEvent& event);
344 void OnNotebookPageChanged(wxNotebookEvent& event);
345 void OnTimeChanged(wxDateEvent& event) { m_cbEtaPresent->SetValue(
true); }
346 void OnTideStationCombobox(wxCommandEvent& event);
347 void OnClose(wxCloseEvent& event);
348 void ShowTidesBtnClicked(wxCommandEvent& event);
349 void OnAddLink(wxCommandEvent& event);
352 MarkInfoDlg(wxWindow* parent, wxWindowID
id = wxID_ANY,
353 const wxString& title = _(
"Waypoint Properties"),
354 const wxPoint& pos = wxDefaultPosition,
355 const wxSize& size = wxSize(-1, -1),
356 long style = FRAME_WITH_LINKS_STYLE);
359 void InitialFocus(
void);
360 void RecalculateSize(
void);
361 RoutePoint* GetRoutePoint(
void) {
return m_pRoutePoint; }
362 void SetColorScheme(ColorScheme cs);
364 void UpdateHtmlList();
365 void SetDialogTitle(
const wxString& title) { SetTitle(title); }
366 bool UpdateProperties(
bool positionOnly =
false);
367 void ValidateMark(
void);
369 void OnActivate(wxActivateEvent& event);
371 wxSimpleHtmlListBox* GetSimpleBox() {
372 return wxDynamicCast(m_htmlList, wxSimpleHtmlListBox);
374 void OnHtmlCellClicked(wxHtmlCellEvent& event);
388 wxCheckBox* RangRingsCB;
389 wxCheckBox* ArrivalRCB;
394 wxStaticText* stArrivalR;
395 wxStaticText* stIcon;
396 wxStaticText* stName;
397 wxStaticText* stScale;
398 wxStaticText* StaticText1;
Class SaveDefaultsDialog.