32 #include <wx/listctrl.h>
33 #include "ocpn_frame.h"
34 #include <wx/hyperlink.h>
35 #include <wx/choice.h>
36 #include <wx/tglbtn.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"
45 #include "model/hyperlink.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>
53 #include <wx/dialog.h>
58 #include "time_textbox.h"
62 #define DIALOG_PARENT wxFrame
64 #define DIALOG_PARENT wxDialog
67 #define ID_WPT_RANGERINGS_NO 7507
68 #define ID_RCLK_MENU_COPY_TEXT 7013
69 #define ID_RCLK_MENU_DELETE 7015
70 #define ID_RCLK_MENU_COPY 7016
71 #define ID_RCLK_MENU_COPY_LL 7017
72 #define ID_RCLK_MENU_PASTE 7018
73 #define ID_RCLK_MENU_PASTE_LL 7019
74 #define ID_RCLK_MENU_DELETE_LINK 7023
75 #define ID_RCLK_MENU_EDIT_LINK 7024
76 #define ID_RCLK_MENU_ADD_LINK 7025
79 #include "OCPNPlatform.h"
97 #define ID_MARKPROP 8000
98 #define SYMBOL_MARKPROP_STYLE \
99 wxCAPTION | wxRESIZE_BORDER | wxSYSTEM_MENU | wxCLOSE_BOX
100 #define SYMBOL_MARKPROP_TITLE _("Waypoint Properties")
101 #define SYMBOL_MARKPROP_IDNAME ID_MARKPROP
102 #define SYMBOL_MARKPROP_SIZE wxSize(200, 300)
103 #define SYMBOL_MARKPROP_POSITION wxDefaultPosition
104 #define ID_MARKPROP_CANCEL 8001
105 #define ID_MARKPROP_OK 8002
106 #define ID_ICONCTRL 8003
107 #define ID_LATCTRL 8004
108 #define ID_LONCTRL 8005
109 #define ID_SHOWNAMECHECKBOXBASIC 8006
110 #define ID_BITMAPCOMBOCTRL 8007
111 #define ID_NAMECTRL 8008
112 #define wxID_HTMLLIST 8009
113 #define ID_DESCR_CTR_DESC 8010
114 #define ID_DESCR_CTR_BASIC 8011
115 #define ID_BTN_DESC_BASIC 8012
116 #define ID_ETA_DATEPICKERCTRL 8013
117 #define ID_ETA_TIMEPICKERCTRL 8014
118 #define ID_SHOWNAMECHECKBOX_EXT 8015
119 #define ID_CHECKBOX_VIS_EXT 8016
120 #define ID_CHECKBOX_SCAMIN_VIS 8017
121 #define ID_SET_DEFAULT_ICON 8018
122 #define ID_SET_DEFAULT_RANGERINGS 8019
123 #define ID_SET_DEFAULT_ARRIVALRADIUS 8020
124 #define ID_SET_DEFAULT_SCAMIN 8021
125 #define ID_SET_DEFAULT_NAMEVIS 8022
126 #define ID_SET_DEFAULT_ALL 8023
127 #define ID_BTN_LINK_MENU 8024
128 #define ID_DEFAULT 8025
129 #define ID_BTN_SHOW_TIDES 8026
138 #define wxCLOSE_BOX 0x1000
140 #ifndef wxFIXED_MINSIZE
141 #define wxFIXED_MINSIZE 0
144 WX_DECLARE_OBJARRAY(wxBitmap, ArrayOfBitmaps);
154 OCPNIconCombo(wxWindow* parent, wxWindowID
id,
const wxString& value = _T(
""),
155 const wxPoint& pos = wxDefaultPosition,
156 const wxSize& size = wxDefaultSize,
int n = 0,
157 const wxString choices[] = NULL,
long style = 0,
158 const wxValidator& validator = wxDefaultValidator,
159 const wxString& name = _T(
"OCPNIconCombo"));
163 void OnDrawItem(wxDC& dc,
const wxRect& rect,
int item,
int flags)
const;
164 wxCoord OnMeasureItem(
size_t item)
const;
165 wxCoord OnMeasureItemWidth(
size_t item)
const;
167 int Append(
const wxString& item, wxBitmap bmp);
172 ArrayOfBitmaps bmpArray;
181 extern const wxEventType EVT_LLCHANGE;
185 DECLARE_EVENT_TABLE()
189 const wxString& value = _T(
""),
190 const wxPoint& pos = wxDefaultPosition,
191 const wxSize& size = wxDefaultSize,
long style = 0,
192 const wxValidator& validator = wxDefaultValidator,
193 const wxString& name = wxTextCtrlNameStr);
195 void OnKillFocus(wxFocusEvent& event);
197 wxEvtHandler* m_pParentEventHandler;
204 DECLARE_EVENT_TABLE()
209 std::vector<RoutePoint*> m_pRoutePoints;
210 static bool instanceFlag;
213 bool m_bShowName_save;
214 wxString m_Name_save;
215 wxString m_IconName_save;
216 int m_current_icon_Index;
219 wxString m_Description_save;
220 HyperlinkList* m_pMyLinkList;
221 bool m_bIsVisible_save;
222 bool m_bUseScaMin_save;
223 int m_iScaminVal_save;
224 bool m_bShowWaypointRangeRings_save;
225 int m_iWaypointRangeRingsNumber_save;
226 float m_fWaypointRangeRingsStep_save;
227 wxColour m_wxcWaypointRangeRingsColour_save;
228 double m_WaypointArrivalRadius_save;
229 float m_PlannedSpeed_save;
230 wxDateTime m_ArrETA_save;
231 std::map<double, const IDX_entry*> m_tss;
232 wxString m_lasttspos;
237 wxBoxSizer* bSizerBasicProperties;
238 wxBoxSizer* bSizerLinks;
239 wxButton* m_buttonExtDescription;
240 wxButton* m_buttonLinksMenu;
241 wxBitmapButton* m_buttonShowTides;
242 wxButton* DefaultsBtn;
243 wxCheckBox* m_checkBoxScaMin;
244 wxCheckBox* m_checkBoxShowName;
245 wxCheckBox* m_checkBoxShowNameExt;
246 wxCheckBox* m_checkBoxVisible;
247 wxChoice* m_choiceWaypointRangeRingsUnits;
248 wxColourPickerCtrl* m_PickColor;
249 wxCheckBox* m_cbEtaPresent;
250 wxBoxSizer* bMainSizer;
251 wxFlexGridSizer* fSizerBasicProperties;
252 wxFlexGridSizer* waypointradarGrid;
253 wxFlexGridSizer* waypointrrSelect;
254 wxGridBagSizer* bGB_SizerProperties;
255 wxFlexGridSizer* gbSizerInnerProperties;
256 wxNotebook* m_notebookProperties;
257 wxObject* m_contextObject;
258 wxScrolledWindow* m_panelBasicProperties;
259 wxPanel* m_panelDescription;
260 wxScrolledWindow* m_panelExtendedProperties;
261 wxSimpleHtmlListBox* m_htmlList;
262 wxSize m_defaultClientSize;
263 wxChoice* m_ChoiceWaypointRangeRingsNumber;
264 wxStaticBitmap* m_bitmapIcon;
265 wxStaticBoxSizer* sbS_Description;
266 wxStaticBoxSizer* sbSizerExtProperties;
267 wxStaticBoxSizer* sbSizerLinks;
268 wxStaticBoxSizer* sbSizerBasicProperties;
269 wxStaticBoxSizer* sbRangeRingsExtProperties;
270 wxStaticBoxSizer* sbSizerDescription;
271 wxStaticText* m_staticTextArrivalRadius;
272 wxStaticText* m_staticTextDescription;
273 wxStaticText* m_staticTextEditEnabled;
274 wxStaticText* m_staticTextGpx;
275 wxStaticText* m_staticTextGuid;
276 wxStaticText* m_staticTextTideStation;
277 wxStaticText* m_staticTextIcon;
278 wxStaticText* m_staticTextLatitude;
279 wxStaticText* m_staticTextLayer;
280 wxStaticText* m_staticTextLongitude;
281 wxStaticText* m_staticTextName;
282 wxStaticText* m_staticTextScaMin;
283 wxStaticText* m_staticTextShowNameExt;
284 wxStaticText* m_staticTextRR1;
285 wxStaticText* m_staticTextRR2;
286 wxChoice* m_RangeRingUnits;
287 wxStaticText* m_staticTextRR4;
288 wxStaticText* m_staticTextArrivalUnits;
289 wxStaticText* m_staticTextPlSpeed;
290 wxStaticText* m_staticTextEta;
291 wxStaticText* m_staticTextPlSpeedUnits;
292 wxStdDialogButtonSizer* m_sdbSizerButtons;
293 wxTextCtrl* m_textArrivalRadius;
294 wxTextCtrl* m_textCtrlExtDescription;
295 wxTextCtrl* m_textCtrlGpx;
296 wxTextCtrl* m_textCtrlGuid;
297 wxScrolledWindow* m_scrolledWindowLinks;
298 wxHyperlinkCtrl* m_hyperlink17;
300 wxToggleButton* m_toggleBtnEdit;
301 wxButton* m_buttonAddLink;
303 #ifdef __OCPN__ANDROID__
304 wxChoice* m_comboBoxTideStation;
306 wxComboBox* m_comboBoxTideStation;
308 wxTextCtrl* m_textDescription;
309 wxTextCtrl* m_textLatitude;
310 wxTextCtrl* m_textLongitude;
311 wxTextCtrl* m_textName;
312 wxTextCtrl* m_textScaMin;
313 wxTextCtrl* m_textWaypointRangeRingsStep;
314 wxTextCtrl* m_textCtrlPlSpeed;
315 wxBitmap _img_MUI_settings_svg;
316 wxButton* m_sdbSizerButtonsCancel;
317 wxButton* m_sdbSizerButtonsOK;
319 wxDatePickerCtrl* m_EtaDatePickerCtrl;
323 wxTimePickerCtrl* m_EtaTimePickerCtrl;
325 wxArrayString m_choiceTideChoices;
328 wxHyperlinkCtrl* m_pEditedLink;
330 void initialize_images(
void);
331 void OnBitmapCombClick(wxCommandEvent& event);
332 void OnPositionCtlUpdated(wxCommandEvent& event);
333 void OnExtDescriptionClick(wxCommandEvent& event);
334 void OnDescChangedExt(wxCommandEvent& event);
335 void OnDescChangedBasic(wxCommandEvent& event);
336 void OnMarkInfoCancelClick(wxCommandEvent& event);
337 void OnMarkInfoOKClick(wxCommandEvent& event);
338 void OnShowWaypointNameSelectBasic(wxCommandEvent& event);
339 void OnShowWaypointNameSelectExt(wxCommandEvent& event);
340 void OnSelectScaMinExt(wxCommandEvent& event);
341 void OnWptRangeRingsNoChange(wxCommandEvent& event);
342 void OnCopyPasteLatLon(wxCommandEvent& event);
343 void OnWaypointRangeRingSelect(wxCommandEvent& event);
344 void m_htmlListContextMenuBtn(wxCommandEvent& event);
345 void m_htmlListContextMenu(wxMouseEvent& event);
346 void OnRightClickLatLon(wxCommandEvent& event);
347 void OnHtmlLinkClicked(wxHtmlLinkEvent& event);
348 void OnHyperLinkClick(wxHyperlinkEvent& event);
350 void On_html_link_popupmenu_Click(wxCommandEvent& event);
351 void DefautlBtnClicked(wxCommandEvent& event);
352 void OnNotebookPageChanged(wxNotebookEvent& event);
353 void OnTimeChanged(wxDateEvent& event) { m_cbEtaPresent->SetValue(
true); }
354 void OnTideStationCombobox(wxCommandEvent& event);
355 void OnClose(wxCloseEvent& event);
356 void ShowTidesBtnClicked(wxCommandEvent& event);
357 void OnAddLink(wxCommandEvent& event);
360 MarkInfoDlg(wxWindow* parent, wxWindowID
id = wxID_ANY,
361 const wxString& title = _(
"Waypoint Properties"),
362 const wxPoint& pos = wxDefaultPosition,
363 const wxSize& size = wxSize(-1, -1),
364 long style = FRAME_WITH_LINKS_STYLE);
367 void InitialFocus(
void);
368 void RecalculateSize(
void);
369 RoutePoint* GetRoutePoint(
void) {
return m_pRoutePoint; }
370 void SetColorScheme(ColorScheme cs);
371 void SetRoutePoints(
const std::vector<RoutePoint*> &);
373 void SetBulkEdit(
bool bBulkEdit);
374 void UpdateHtmlList();
375 void SetDialogTitle(
const wxString& title) { SetTitle(title); }
376 bool UpdateProperties(
bool positionOnly =
false);
377 void ValidateMark(
void);
379 void OnActivate(wxActivateEvent& event);
381 wxSimpleHtmlListBox* GetSimpleBox() {
382 return wxDynamicCast(m_htmlList, wxSimpleHtmlListBox);
384 void OnHtmlCellClicked(wxHtmlCellEvent& event);
398 wxCheckBox* RangRingsCB;
399 wxCheckBox* ArrivalRCB;
404 wxStaticText* stArrivalR;
405 wxStaticText* stIcon;
406 wxStaticText* stName;
407 wxStaticText* stScale;
408 wxStaticText* StaticText1;
Class SaveDefaultsDialog.