34#include <wx/datetime.h>
35#include <wx/clipbrd.h>
37#include <wx/printdlg.h>
38#include <wx/stattext.h>
39#include <wx/clrpicker.h>
40#include <wx/bmpbuttn.h>
45#include "model/georef.h"
46#include "model/navutil_base.h"
47#include "model/own_ship.h"
48#include "model/position_parser.h"
49#include "model/route.h"
50#include "model/routeman.h"
51#include "model/select.h"
53#include "ocpn_frame.h"
54#include "OCPNPlatform.h"
55#include "pluginmanager.h"
56#include "routemanagerdialog.h"
57#include "RoutePropDlgImpl.h"
64#include "androidUTIL.h"
65#include <QtWidgets/QScroller>
77extern wxString g_default_wp_icon;
83extern float g_MarkScaleFactorExp;
87WX_DECLARE_LIST(wxBitmap, BitmapList);
88#include <wx/listimpl.cpp>
89WX_DEFINE_LIST(BitmapList);
91#include <wx/arrimpl.cpp>
92WX_DEFINE_OBJARRAY(ArrayOfBitmaps);
94#define EXTENDED_PROP_PAGE 2
96OCPNIconCombo::OCPNIconCombo(wxWindow* parent, wxWindowID
id,
97 const wxString& value,
const wxPoint& pos,
98 const wxSize& size,
int n,
99 const wxString choices[],
long style,
100 const wxValidator& validator,
const wxString& name)
101 : wxOwnerDrawnComboBox(parent, id, value, pos, size, n, choices, style,
104 GetFont().GetPointSize() / g_Platform->getFontPointsperPixel();
105 itemHeight = (int)wxRound(fontHeight);
108OCPNIconCombo::~OCPNIconCombo() {}
110void OCPNIconCombo::OnDrawItem(wxDC& dc,
const wxRect& rect,
int item,
112 int offset_x = bmpArray[item].GetWidth();
113 int bmpHeight = bmpArray[item].GetHeight();
114 dc.DrawBitmap(bmpArray[item], rect.x, rect.y + (rect.height - bmpHeight) / 2,
117 if (flags & wxODCB_PAINTING_CONTROL) {
118 wxString text = GetValue();
121#if wxCHECK_VERSION(2, 9, 0)
122 if (ShouldUseHintText()) {
124 wxColour col = wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT);
125 dc.SetTextForeground(col);
128 margin_x = GetMargins().x;
131 dc.DrawText(text, rect.x + margin_x + offset_x,
132 (rect.height - dc.GetCharHeight()) / 2 + rect.y);
134 dc.DrawText(GetVListBoxComboPopup()->GetString(item), rect.x + 2 + offset_x,
135 (rect.height - dc.GetCharHeight()) / 2 + rect.y);
139wxCoord OCPNIconCombo::OnMeasureItem(
size_t item)
const {
140 int bmpHeight = bmpArray[item].GetHeight();
142 return wxMax(itemHeight, bmpHeight);
145wxCoord OCPNIconCombo::OnMeasureItemWidth(
size_t item)
const {
return -1; }
147int OCPNIconCombo::Append(
const wxString& item, wxBitmap bmp) {
149 int idx = wxOwnerDrawnComboBox::Append(item);
154void OCPNIconCombo::Clear(
void) {
155 wxOwnerDrawnComboBox::Clear();
169const wxEventType EVT_LLCHANGE = wxNewEventType();
178 const wxString& value, const wxPoint& pos,
179 const wxSize& size,
long style,
180 const wxValidator& validator,
181 const wxString& name)
182 : wxTextCtrl(parent,
id, value, pos, size, style, validator, name) {
183 m_pParentEventHandler = parent->GetEventHandler();
186void LatLonTextCtrl::OnKillFocus(wxFocusEvent& event) {
188 wxCommandEvent up_event(EVT_LLCHANGE, GetId());
189 up_event.SetEventObject((wxObject*)
this);
190 m_pParentEventHandler->AddPendingEvent(up_event);
199EVT_BUTTON(wxID_OK, MarkInfoDlg::OnMarkInfoOKClick)
200EVT_BUTTON(wxID_CANCEL, MarkInfoDlg::OnMarkInfoCancelClick)
201EVT_BUTTON(ID_BTN_DESC_BASIC, MarkInfoDlg::OnExtDescriptionClick)
202EVT_BUTTON(ID_DEFAULT, MarkInfoDlg::DefautlBtnClicked)
203EVT_BUTTON(ID_BTN_SHOW_TIDES, MarkInfoDlg::ShowTidesBtnClicked)
204EVT_COMBOBOX(ID_BITMAPCOMBOCTRL, MarkInfoDlg::OnBitmapCombClick)
205EVT_CHECKBOX(ID_CHECKBOX_SCAMIN_VIS, MarkInfoDlg::OnSelectScaMinExt)
206EVT_TEXT(ID_DESCR_CTR_DESC, MarkInfoDlg::OnDescChangedExt)
207EVT_TEXT(ID_DESCR_CTR_BASIC, MarkInfoDlg::OnDescChangedBasic)
208EVT_TEXT(ID_LATCTRL, MarkInfoDlg::OnPositionCtlUpdated)
209EVT_TEXT(ID_LONCTRL, MarkInfoDlg::OnPositionCtlUpdated)
210EVT_CHOICE(ID_WPT_RANGERINGS_NO, MarkInfoDlg::OnWptRangeRingsNoChange)
212EVT_HTML_LINK_CLICKED(wxID_ANY, MarkInfoDlg::OnHtmlLinkClicked)
213EVT_COMMAND(wxID_ANY, EVT_LAYOUT_RESIZE, MarkInfoDlg::OnLayoutResize)
214EVT_CLOSE(MarkInfoDlg::OnClose)
220 const wxPoint& pos, const wxSize& size,
long style) {
221 DIALOG_PARENT::Create(parent,
id, title, pos, size, style);
225 int metric = GetCharHeight();
229 wxString wqs = getFontQtStylesheet(qFont);
230 wxCharBuffer sbuf = wqs.ToUTF8();
231 QString qsb = QString(sbuf.data());
232 QString qsbq = getQtStyleSheet();
233 this->GetHandle()->setStyleSheet(qsb + qsbq);
235 if (sdc.IsOk()) sdc.GetTextExtent(_T(
"W"), NULL, &metric, NULL, NULL, qFont);
238 m_pMyLinkList = NULL;
239 SetColorScheme((ColorScheme)0);
240 m_pRoutePoint = NULL;
241 m_SaveDefaultDlg = NULL;
245 Connect(wxEVT_ACTIVATE, wxActivateEventHandler(MarkInfoDlg::OnActivate), NULL,
250void MarkInfoDlg::OnActivate(wxActivateEvent& event) {
251 auto pWin =
dynamic_cast<DIALOG_PARENT*
>(
event.GetEventObject());
252 long int style = pWin->GetWindowStyle();
253 if (event.GetActive())
254 pWin->SetWindowStyle(style | wxSTAY_ON_TOP);
256 pWin->SetWindowStyle(style ^ wxSTAY_ON_TOP);
259void MarkInfoDlg::initialize_images(
void) {
260 wxString iconDir = g_Platform->GetSharedDataDir() + _T(
"uidata/MUI_flat/");
261 _img_MUI_settings_svg = LoadSVG(iconDir + _T(
"MUI_settings.svg"),
262 2 * GetCharHeight(), 2 * GetCharHeight());
265 wxBitmap tide = style->GetIcon(_T(
"tidesml"));
266 wxImage tide1 = tide.ConvertToImage();
267 wxImage tide1s = tide1.Scale(m_sizeMetric * 3 / 2, m_sizeMetric * 3 / 2,
268 wxIMAGE_QUALITY_HIGH);
269 m_bmTide = wxBitmap(tide1s);
274void MarkInfoDlg::Create() {
277 m_sizeMetric = GetCharHeight();
282 wxString wqs = getFontQtStylesheet(qFont);
283 wxCharBuffer sbuf = wqs.ToUTF8();
284 QString qsb = QString(sbuf.data());
286 QString qsbq = getAdjustedDialogStyleSheet();
288 this->GetHandle()->setStyleSheet(qsb + qsbq);
292 sdc.GetTextExtent(_T(
"W"), NULL, &m_sizeMetric, NULL, NULL, qFont);
299 bSizer1 =
new wxBoxSizer(wxVERTICAL);
301 bSizer1->SetSizeHints(
this);
304 m_notebookProperties =
new wxNotebook(
this, wxID_ANY, wxDefaultPosition,
305 wxDefaultSize, wxNB_FIXEDWIDTH);
307 m_panelBasicProperties =
new wxScrolledWindow(
308 m_notebookProperties, wxID_ANY, wxDefaultPosition, wxDefaultSize,
309 wxHSCROLL | wxVSCROLL | wxTAB_TRAVERSAL);
311 m_panelBasicProperties->GetHandle()->setStyleSheet(
312 getAdjustedDialogStyleSheet());
316 m_panelBasicProperties->SetScrollRate(0, 2);
317 m_notebookProperties->AddPage(m_panelBasicProperties, _(
"Basic"),
true);
318 bSizerBasicProperties =
new wxBoxSizer(wxVERTICAL);
319 m_panelBasicProperties->SetSizer(bSizerBasicProperties);
322 m_staticTextLayer =
new wxStaticText(
323 m_panelBasicProperties, wxID_ANY,
324 _(
"This waypoint is part of a layer and can't be edited"),
325 wxDefaultPosition, wxDefaultSize, 0);
326 m_staticTextLayer->Enable(
false);
327 bSizerBasicProperties->Add(m_staticTextLayer, 0, wxALL, 5);
330 wxPanel* props_panel =
new wxPanel(m_panelBasicProperties);
332 props_panel->SetSizer(props_sizer);
333 bSizerBasicProperties->Add(props_panel, 0, wxALL | wxEXPAND, 16);
334 int label_size = m_sizeMetric * 4;
337 m_textName =
new TextField(props_panel, _(
"Name"));
340 wxStaticText* name_cb_label =
341 new wxStaticText(props_panel, wxID_ANY, _(
"Show waypoint name"));
343 new wxCheckBox(props_panel, wxID_ANY, wxEmptyString, wxDefaultPosition,
344 wxDefaultSize, wxALIGN_CENTER_VERTICAL);
345 m_checkBoxShowName->Bind(wxEVT_CHECKBOX,
346 &MarkInfoDlg::OnShowWaypointNameSelectBasic,
this);
347 props_sizer->Add(name_cb_label, 0, wxALIGN_TOP);
348 props_sizer->Add(m_checkBoxShowName, 0, wxEXPAND);
351 int icon_size = m_sizeMetric * 2;
352 icon_size = wxMax(icon_size, (32 * g_MarkScaleFactorExp) + 4);
354 new OCPNIconCombo(props_panel, wxID_ANY, _(
"Combo!"), wxDefaultPosition,
355 wxDefaultSize, 0, NULL, wxCB_READONLY);
356 m_bcomboBoxIcon->SetPopupMaxHeight(::wxGetDisplaySize().y / 2);
357 m_bcomboBoxIcon->SetMinSize(wxSize(-1, icon_size));
359 wxStaticText* icon_label =
new wxStaticText(props_panel, wxID_ANY, _(
"Icon"));
360 icon_label->SetMinSize(wxSize(label_size, -1));
361 props_sizer->Add(icon_label, 0, wxALIGN_CENTER_VERTICAL);
362 props_sizer->Add(m_bcomboBoxIcon, 0, wxEXPAND);
365 m_textLatitude =
new TextField(props_panel, _(
"Latitude"));
366 m_textLongitude =
new TextField(props_panel, _(
"Longitude"));
367 props_sizer->Fit(props_panel);
370 wxStaticBox* desc_box =
371 new wxStaticBox(m_panelBasicProperties, wxID_ANY, _(
"Description"));
372 wxStaticBoxSizer* desc_sizer =
new wxStaticBoxSizer(desc_box, wxHORIZONTAL);
373 bSizerBasicProperties->Add(desc_sizer, 1, wxALL | wxEXPAND, 8);
374 m_textDescription =
new wxTextCtrl(
375 m_panelBasicProperties, ID_DESCR_CTR_BASIC, wxEmptyString,
376 wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxTE_READONLY);
377 m_textDescription->SetMinSize(wxSize(-1, 80));
378 desc_sizer->Add(m_textDescription, 1, wxEXPAND);
381 m_buttonExtDescription =
382 new wxButton(m_panelBasicProperties, ID_BTN_DESC_BASIC, _T(
"..."),
383 wxDefaultPosition, wxSize(GetCharHeight() * 15 / 10, -1), 0);
384 desc_sizer->Add(m_buttonExtDescription, 0, wxEXPAND);
387 wxStaticBox* links_box =
388 new wxStaticBox(m_panelBasicProperties, wxID_ANY, _(
"Links"));
389 wxStaticBoxSizer* links_sizer =
new wxStaticBoxSizer(links_box, wxHORIZONTAL);
390 bSizerBasicProperties->Add(links_sizer, 1, wxALL | wxEXPAND, 8);
393 m_htmlList =
new wxSimpleHtmlListBox(m_panelBasicProperties, wxID_ANY,
394 wxDefaultPosition, wxDefaultSize, 0);
395 links_sizer->Add(m_htmlList, 1, wxEXPAND);
398 m_scrolledWindowLinks =
399 new wxScrolledWindow(m_panelBasicProperties, wxID_ANY, wxDefaultPosition,
400 wxSize(-1, 100), wxHSCROLL | wxVSCROLL);
401 m_scrolledWindowLinks->SetMinSize(wxSize(-1, 80));
402 m_scrolledWindowLinks->SetScrollRate(2, 2);
403 links_sizer->Add(m_scrolledWindowLinks, 1, wxEXPAND);
405 bSizerLinks =
new wxBoxSizer(wxVERTICAL);
406 m_scrolledWindowLinks->SetSizer(bSizerLinks);
408 m_menuLink =
new wxMenu();
409 wxMenuItem* m_menuItemDelete;
410 m_menuItemDelete =
new wxMenuItem(m_menuLink, wxID_ANY, wxString(_(
"Delete")),
411 wxEmptyString, wxITEM_NORMAL);
412 m_menuLink->Append(m_menuItemDelete);
414 wxMenuItem* m_menuItemEdit;
415 m_menuItemEdit =
new wxMenuItem(m_menuLink, wxID_ANY, wxString(_(
"Edit")),
416 wxEmptyString, wxITEM_NORMAL);
417 m_menuLink->Append(m_menuItemEdit);
419 wxMenuItem* m_menuItemAdd;
420 m_menuItemAdd =
new wxMenuItem(m_menuLink, wxID_ANY, wxString(_(
"Add new")),
421 wxEmptyString, wxITEM_NORMAL);
422 m_menuLink->Append(m_menuItemAdd);
424 wxBoxSizer* bSizer9 =
new wxBoxSizer(wxHORIZONTAL);
427 new wxButton(m_panelBasicProperties, wxID_ANY, _(
"Add new"),
428 wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT);
429 bSizer9->Add(m_buttonAddLink, 0, wxALL, 5);
431 m_buttonAddLink->Connect(wxEVT_COMMAND_BUTTON_CLICKED,
432 wxCommandEventHandler(MarkInfoDlg::OnAddLink), NULL,
435 links_sizer->Add(bSizer9, 0, wxEXPAND, 5);
440 new wxPanel(m_notebookProperties, wxID_ANY, wxDefaultPosition,
441 wxDefaultSize, wxTAB_TRAVERSAL);
442 wxBoxSizer* bSizer15;
443 bSizer15 =
new wxBoxSizer(wxVERTICAL);
445 m_textCtrlExtDescription =
446 new wxTextCtrl(m_panelDescription, ID_DESCR_CTR_DESC, wxEmptyString,
447 wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE);
448 bSizer15->Add(m_textCtrlExtDescription, 1, wxALL | wxEXPAND, 5);
450 m_panelDescription->SetSizer(bSizer15);
451 m_notebookProperties->AddPage(m_panelDescription, _(
"Description"),
false);
456 m_panelExtendedProperties =
new wxScrolledWindow(
457 m_notebookProperties, wxID_ANY, wxDefaultPosition, wxDefaultSize,
458 wxHSCROLL | wxVSCROLL | wxTAB_TRAVERSAL);
460 m_panelExtendedProperties->GetHandle()->setStyleSheet(
461 getAdjustedDialogStyleSheet());
464 m_panelExtendedProperties->SetScrollRate(0, 2);
466 wxBoxSizer* fSizerExtProperties =
new wxBoxSizer(wxVERTICAL);
467 m_panelExtendedProperties->SetSizer(fSizerExtProperties);
468 m_notebookProperties->AddPage(m_panelExtendedProperties, _(
"Extended"),
471 sbSizerExtProperties =
new wxStaticBoxSizer(
472 wxVERTICAL, m_panelExtendedProperties, _(
"Extended Properties"));
473 wxFlexGridSizer* gbSizerInnerExtProperties =
new wxFlexGridSizer(3, 0, 0);
474 gbSizerInnerExtProperties->AddGrowableCol(2);
475 gbSizerInnerExtProperties->SetFlexibleDirection(wxBOTH);
476 gbSizerInnerExtProperties->SetNonFlexibleGrowMode(wxFLEX_GROWMODE_SPECIFIED);
478 m_checkBoxVisible =
new wxCheckBox(sbSizerExtProperties->GetStaticBox(),
479 ID_CHECKBOX_VIS_EXT, wxEmptyString);
480 gbSizerInnerExtProperties->Add(m_checkBoxVisible);
481 wxStaticText* m_staticTextVisible =
new wxStaticText(
482 sbSizerExtProperties->GetStaticBox(), wxID_ANY, _(
"Show on chart"));
483 gbSizerInnerExtProperties->Add(m_staticTextVisible);
484 gbSizerInnerExtProperties->Add(0, 0, 1, wxEXPAND, 0);
486 m_checkBoxScaMin =
new wxCheckBox(sbSizerExtProperties->GetStaticBox(),
487 ID_CHECKBOX_SCAMIN_VIS, wxEmptyString);
488 gbSizerInnerExtProperties->Add(m_checkBoxScaMin, 0, wxALIGN_CENTRE_VERTICAL,
490 m_staticTextScaMin =
new wxStaticText(sbSizerExtProperties->GetStaticBox(),
491 wxID_ANY, _(
"Show at scale > 1 :"));
492 gbSizerInnerExtProperties->Add(m_staticTextScaMin, 0, wxALIGN_CENTRE_VERTICAL,
494 m_textScaMin =
new wxTextCtrl(sbSizerExtProperties->GetStaticBox(), wxID_ANY);
495 gbSizerInnerExtProperties->Add(m_textScaMin, 0, wxALL | wxEXPAND, 5);
497 m_checkBoxShowNameExt =
new wxCheckBox(sbSizerExtProperties->GetStaticBox(),
498 wxID_ANY, wxEmptyString);
499 m_checkBoxShowNameExt->Bind(wxEVT_CHECKBOX,
500 &MarkInfoDlg::OnShowWaypointNameSelectExt,
this);
501 gbSizerInnerExtProperties->Add(m_checkBoxShowNameExt);
502 m_staticTextShowNameExt =
new wxStaticText(
503 sbSizerExtProperties->GetStaticBox(), wxID_ANY, _(
"Show waypoint name"));
505 gbSizerInnerExtProperties->Add(m_staticTextShowNameExt);
506 gbSizerInnerExtProperties->Add(0, 0, 1, wxEXPAND, 0);
508 sbRangeRingsExtProperties =
new wxStaticBoxSizer(
509 wxVERTICAL, sbSizerExtProperties->GetStaticBox(), _(
"Range rings"));
510 wxFlexGridSizer* gbRRExtProperties =
new wxFlexGridSizer(4, 0, 0);
511 gbRRExtProperties->AddGrowableCol(0);
512 gbRRExtProperties->AddGrowableCol(1);
513 gbRRExtProperties->AddGrowableCol(3);
514 m_staticTextRR1 =
new wxStaticText(sbSizerExtProperties->GetStaticBox(),
515 wxID_ANY, _(
"Number"));
516 gbRRExtProperties->Add(m_staticTextRR1, 0, wxLEFT, 5);
517 m_staticTextRR2 =
new wxStaticText(sbSizerExtProperties->GetStaticBox(),
518 wxID_ANY, _(
"Distance"));
519 gbRRExtProperties->Add(m_staticTextRR2, 0, wxLEFT, 5);
520 gbRRExtProperties->Add(0, 0, 1, wxEXPAND, 5);
521 m_staticTextRR4 =
new wxStaticText(sbSizerExtProperties->GetStaticBox(),
522 wxID_ANY, _(
"Color"));
523 gbRRExtProperties->Add(m_staticTextRR4, 0, wxLEFT, 5);
525 wxString rrAlt[] = {_(
"None"), _T(
"1" ), _T(
"2" ), _T(
"3" ),
526 _T(
"4" ), _T(
"5" ), _T(
"6" ), _T(
"7" ),
527 _T(
"8" ), _T(
"9" ), _T(
"10" )};
528 m_ChoiceWaypointRangeRingsNumber =
529 new wxChoice(sbSizerExtProperties->GetStaticBox(), ID_WPT_RANGERINGS_NO,
530 wxDefaultPosition, wxDefaultSize, 11, rrAlt);
532 gbRRExtProperties->Add(m_ChoiceWaypointRangeRingsNumber, 0, wxALL | wxEXPAND,
534 m_textWaypointRangeRingsStep =
535 new wxTextCtrl(sbSizerExtProperties->GetStaticBox(), wxID_ANY, _(
"0.05"),
536 wxDefaultPosition, wxDefaultSize, 0);
537 gbRRExtProperties->Add(m_textWaypointRangeRingsStep, 0, wxALL | wxEXPAND, 5);
539 wxString pDistUnitsStrings[] = {_(
"NMi"), _(
"km")};
541 new wxChoice(sbSizerExtProperties->GetStaticBox(), wxID_ANY,
542 wxDefaultPosition, wxDefaultSize, 2, pDistUnitsStrings);
543 gbRRExtProperties->Add(m_RangeRingUnits, 0, wxALIGN_CENTRE_VERTICAL, 0);
545 m_PickColor =
new wxColourPickerCtrl(sbSizerExtProperties->GetStaticBox(),
546 wxID_ANY, wxColour(0, 0, 0),
547 wxDefaultPosition, wxDefaultSize, 0);
548 gbRRExtProperties->Add(m_PickColor, 0, wxALL | wxEXPAND, 5);
549 sbRangeRingsExtProperties->Add(
550 gbRRExtProperties, 1,
551 wxLEFT | wxTOP | wxEXPAND | wxALIGN_LEFT | wxALIGN_TOP, 5);
553 sbSizerExtProperties->GetStaticBox()->Layout();
555 wxFlexGridSizer* gbSizerInnerExtProperties2 =
new wxFlexGridSizer(2, 0, 0);
556 gbSizerInnerExtProperties2->AddGrowableCol(1);
559 new wxStaticText(sbSizerExtProperties->GetStaticBox(), wxID_ANY,
560 _(
"GUID"), wxDefaultPosition, wxDefaultSize, 0);
561 gbSizerInnerExtProperties2->Add(m_staticTextGuid, 0, wxALIGN_CENTRE_VERTICAL,
563 m_textCtrlGuid =
new wxTextCtrl(sbSizerExtProperties->GetStaticBox(),
564 wxID_ANY, wxEmptyString, wxDefaultPosition,
565 wxDefaultSize, wxTE_READONLY);
566 m_textCtrlGuid->SetEditable(
false);
567 gbSizerInnerExtProperties2->Add(m_textCtrlGuid, 0, wxALL | wxEXPAND, 5);
569 wxFlexGridSizer* gbSizerInnerExtProperties1 =
new wxFlexGridSizer(3, 0, 0);
570 gbSizerInnerExtProperties1->AddGrowableCol(1);
572 m_staticTextTideStation =
573 new wxStaticText(sbSizerExtProperties->GetStaticBox(), wxID_ANY,
574 _(
"Tide Station"), wxDefaultPosition, wxDefaultSize, 0);
575 gbSizerInnerExtProperties1->Add(m_staticTextTideStation, 0,
576 wxALIGN_CENTRE_VERTICAL, 5);
579 m_choiceTideChoices.Add(_T(
" "));
580 m_comboBoxTideStation =
581 new wxChoice(sbSizerExtProperties->GetStaticBox(), wxID_ANY,
582 wxDefaultPosition, wxDefaultSize, m_choiceTideChoices);
584 gbSizerInnerExtProperties1->Add(
585 m_comboBoxTideStation, 0, wxALL | wxEXPAND | wxALIGN_CENTRE_VERTICAL, 5);
588 m_comboBoxTideStation =
new wxComboBox(
589 sbSizerExtProperties->GetStaticBox(), wxID_ANY, wxEmptyString,
590 wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY);
591 gbSizerInnerExtProperties1->Add(
592 m_comboBoxTideStation, 0, wxALL | wxEXPAND | wxALIGN_CENTRE_VERTICAL, 5);
594 m_comboBoxTideStation->SetToolTip(
595 _(
"Associate this waypoint with a tide station to quickly access tide "
596 "predictions. Select from nearby stations or leave empty for no "
599 m_buttonShowTides =
new wxBitmapButton(
600 sbSizerExtProperties->GetStaticBox(), ID_BTN_SHOW_TIDES, m_bmTide,
601 wxDefaultPosition, m_bmTide.GetSize(), 0);
602 gbSizerInnerExtProperties1->Add(m_buttonShowTides, 0,
603 wxALL | wxALIGN_CENTRE_VERTICAL, 5);
605 m_staticTextArrivalRadius =
new wxStaticText(
606 sbSizerExtProperties->GetStaticBox(), wxID_ANY, _(
"Arrival Radius"));
607 gbSizerInnerExtProperties1->Add(m_staticTextArrivalRadius, 0,
608 wxALIGN_CENTRE_VERTICAL, 0);
609 m_textArrivalRadius =
610 new wxTextCtrl(sbSizerExtProperties->GetStaticBox(), wxID_ANY,
611 wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
612 m_textArrivalRadius->SetToolTip(
613 _(
"Distance from the waypoint at which OpenCPN will consider the "
614 "waypoint reached. Used for automatic waypoint advancement during "
615 "active navigation."));
616 gbSizerInnerExtProperties1->Add(m_textArrivalRadius, 0, wxALL | wxEXPAND, 5);
617 m_staticTextArrivalUnits =
618 new wxStaticText(sbSizerExtProperties->GetStaticBox(), wxID_ANY,
619 wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
620 gbSizerInnerExtProperties1->Add(m_staticTextArrivalUnits, 0,
621 wxALIGN_CENTRE_VERTICAL, 0);
623 m_staticTextPlSpeed =
624 new wxStaticText(sbSizerExtProperties->GetStaticBox(), wxID_ANY,
625 _(
"Planned Speed"), wxDefaultPosition, wxDefaultSize, 0);
626 gbSizerInnerExtProperties1->Add(m_staticTextPlSpeed, 0,
627 wxALIGN_CENTRE_VERTICAL, 0);
629 new wxTextCtrl(sbSizerExtProperties->GetStaticBox(), wxID_ANY,
630 wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
632 "Enter the planned vessel speed for the leg FOLLOWING this waypoint. "
633 "This speed is used when traveling FROM this waypoint TO the next "
634 "waypoint in the route. The value is used to calculate estimated time "
635 "of arrival at the next waypoint based on the ETD from this waypoint.\n\n"
636 "If left blank, the route's default speed will be used for this leg. "
637 "Individual waypoint speeds override the route-level speed setting."));
639 m_staticTextPlSpeedUnits =
640 new wxStaticText(sbSizerExtProperties->GetStaticBox(), wxID_ANY,
641 getUsrSpeedUnit(), wxDefaultPosition, wxDefaultSize, 0);
642 gbSizerInnerExtProperties1->Add(m_staticTextPlSpeedUnits, 0,
643 wxALIGN_CENTRE_VERTICAL, 0);
647 m_staticTextEtd =
new wxStaticText(sbSizerExtProperties->GetStaticBox(),
649 gbSizerInnerExtProperties1->Add(
m_staticTextEtd, 0, wxALIGN_CENTRE_VERTICAL,
651 wxBoxSizer* bsTimestamp =
new wxBoxSizer(wxHORIZONTAL);
652 m_cbEtdPresent =
new wxCheckBox(sbSizerExtProperties->GetStaticBox(),
653 wxID_ANY, wxEmptyString);
655 _(
"Enable to manually set a planned departure time (ETD) for this "
657 "When checked, the specified date and time will be used instead of the "
658 "automatically calculated ETD. This affects ETA calculations for "
659 "subsequent waypoints in the route."));
662 sbSizerExtProperties->GetStaticBox(), ID_ETA_DATEPICKERCTRL,
663 wxDefaultDateTime, wxDefaultPosition, wxDefaultSize, wxDP_DEFAULT,
666 "Select the planned departure date (ETD) for this waypoint.\nUsed "
667 "together with the time control to calculate arrival times at subsequent "
668 "waypoints.\nETD information is only used for route planning "
669 "and does not affect navigation."));
674 new TimeCtrl(sbSizerExtProperties->GetStaticBox(), ID_ETA_TIMEPICKERCTRL,
675 wxDefaultDateTime, wxDefaultPosition, wxDefaultSize);
678 sbSizerExtProperties->GetStaticBox(), ID_ETA_TIMEPICKERCTRL,
679 wxDefaultDateTime, wxDefaultPosition, wxDefaultSize, wxDP_DEFAULT,
684 gbSizerInnerExtProperties1->Add(bsTimestamp, 0, wxEXPAND, 0);
685 sbSizerExtProperties->Add(gbSizerInnerExtProperties, 0, wxALL | wxEXPAND, 5);
686 sbSizerExtProperties->Add(sbRangeRingsExtProperties, 0, wxALL | wxEXPAND, 5);
687 sbSizerExtProperties->Add(gbSizerInnerExtProperties2, 0, wxALL | wxEXPAND, 5);
688 sbSizerExtProperties->Add(gbSizerInnerExtProperties1, 0, wxALL | wxEXPAND, 5);
690 fSizerExtProperties->Add(sbSizerExtProperties, 1, wxALL | wxEXPAND);
693 bSizer1->Add(m_notebookProperties, 1, wxEXPAND);
695 wxBoxSizer* btnSizer =
new wxBoxSizer(wxHORIZONTAL);
696 bSizer1->Add(btnSizer, 0, wxEXPAND, 0);
699 new wxBitmapButton(
this, ID_DEFAULT, _img_MUI_settings_svg,
700 wxDefaultPosition, _img_MUI_settings_svg.GetSize(), 0);
701 btnSizer->Add(DefaultsBtn, 0, wxALL | wxALIGN_LEFT | wxALIGN_BOTTOM, 5);
702 btnSizer->Add(0, 0, 1, wxEXPAND);
704 m_sdbSizerButtons =
new wxStdDialogButtonSizer();
705 m_buttonOkay =
new wxButton(
this, wxID_OK);
706 m_sdbSizerButtons->AddButton(m_buttonOkay);
707 m_sdbSizerButtons->AddButton(
new wxButton(
this, wxID_CANCEL, _(
"Cancel")));
708 m_sdbSizerButtons->Realize();
709 btnSizer->Add(m_sdbSizerButtons, 0, wxALL, 5);
714 m_textLatitude->Connect(
716 wxCommandEventHandler(MarkInfoDlg::OnRightClickLatLon), NULL,
this);
717 m_textLongitude->Connect(
719 wxCommandEventHandler(MarkInfoDlg::OnRightClickLatLon), NULL,
this);
721 m_htmlList->Connect(wxEVT_RIGHT_DOWN,
722 wxMouseEventHandler(MarkInfoDlg::m_htmlListContextMenu),
726 m_notebookProperties->Connect(
727 wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED,
728 wxNotebookEventHandler(MarkInfoDlg::OnNotebookPageChanged), NULL,
this);
733 m_comboBoxTideStation->Connect(
734 wxEVT_COMMAND_COMBOBOX_SELECTED,
735 wxCommandEventHandler(MarkInfoDlg::OnTideStationCombobox), NULL,
this);
738void MarkInfoDlg::OnClose(wxCloseEvent& event) {
741 if (m_pRoutePoint) m_pRoutePoint->m_bRPIsBeingEdited =
false;
744#define TIDESTATION_BATCH_SIZE 10
746void MarkInfoDlg::OnTideStationCombobox(wxCommandEvent& event) {
747 int count = m_comboBoxTideStation->GetCount();
748 int sel = m_comboBoxTideStation->GetSelection();
749 if (sel == count - 1) {
752 for (
auto ts : m_tss) {
753 if (i == count + TIDESTATION_BATCH_SIZE) {
757 n = wxString::FromUTF8(ts.second->IDX_station_name);
758 m_comboBoxTideStation->Append(n);
765void MarkInfoDlg::OnNotebookPageChanged(wxNotebookEvent& event) {
766 if (event.GetSelection() == EXTENDED_PROP_PAGE) {
767 if (m_lasttspos.IsSameAs(m_textLatitude->GetValue() +
768 m_textLongitude->GetValue())) {
771 m_lasttspos = m_textLatitude->GetValue() + m_textLongitude->GetValue();
772 double lat = fromDMM(m_textLatitude->GetValue());
773 double lon = fromDMM(m_textLongitude->GetValue());
774 m_tss = ptcmgr->GetStationsForLL(lat, lon);
775 wxString s = m_comboBoxTideStation->GetStringSelection();
778 m_comboBoxTideStation->Clear();
779 m_comboBoxTideStation->Append(wxEmptyString);
780 for (
auto ts : m_tss) {
781 if (i == TIDESTATION_BATCH_SIZE) {
785 n = wxString::FromUTF8(ts.second->IDX_station_name);
786 m_comboBoxTideStation->Append(n);
788 m_comboBoxTideStation->SetSelection(i);
791 if (m_comboBoxTideStation->GetStringSelection() != s) {
792 m_comboBoxTideStation->Insert(s, 1);
793 m_comboBoxTideStation->SetSelection(1);
798void MarkInfoDlg::RecalculateSize(
void) {
803 wxSize dsize = GetParent()->GetClientSize();
807 esize.x = GetCharHeight() * 20;
808 esize.y = GetCharHeight() * 40;
811 esize.y = wxMin(esize.y, dsize.y - (2 * GetCharHeight()));
812 esize.x = wxMin(esize.x, dsize.x - (1 * GetCharHeight()));
813 SetSize(wxSize(esize.x, esize.y));
816 wxSize fsize = GetSize();
817 fsize.y = wxMin(fsize.y, dsize.y - (2 * GetCharHeight()));
818 fsize.x = wxMin(fsize.x, dsize.x - (1 * GetCharHeight()));
822 fsize.y = wxMin(fsize.y, (25 * GetCharHeight()));
824 SetSize(wxSize(-1, fsize.y));
826 m_defaultClientSize = GetClientSize();
829 wxSize dsize = GetParent()->GetClientSize();
830 SetSize(-1, wxMax(GetSize().y, dsize.y / 1.5));
834MarkInfoDlg::~MarkInfoDlg() {
836 m_textLatitude->Disconnect(
838 wxCommandEventHandler(MarkInfoDlg::OnRightClickLatLon), NULL,
this);
839 m_textLongitude->Disconnect(
841 wxCommandEventHandler(MarkInfoDlg::OnRightClickLatLon), NULL,
this);
843 m_htmlList->Disconnect(
844 wxEVT_RIGHT_DOWN, wxMouseEventHandler(MarkInfoDlg::m_htmlListContextMenu),
849 m_notebookProperties->Disconnect(
850 wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED,
851 wxNotebookEventHandler(MarkInfoDlg::OnNotebookPageChanged), NULL,
this);
853 wxEVT_TIME_CHANGED, wxDateEventHandler(MarkInfoDlg::OnTimeChanged), NULL,
856 wxEVT_DATE_CHANGED, wxDateEventHandler(MarkInfoDlg::OnTimeChanged), NULL,
860 androidEnableBackButton(
true);
864void MarkInfoDlg::InitialFocus(
void) {
865 m_textName->SetFocus();
866 m_textName->SetInsertionPointEnd();
869void MarkInfoDlg::SetColorScheme(ColorScheme cs) { DimeControl(
this); }
871void MarkInfoDlg::ClearData() {
872 m_pRoutePoint = NULL;
876void MarkInfoDlg::SetRoutePoint(
RoutePoint* pRP) {
879 m_lat_save = m_pRoutePoint->m_lat;
880 m_lon_save = m_pRoutePoint->m_lon;
881 m_IconName_save = m_pRoutePoint->GetIconName();
882 m_bShowName_save = m_pRoutePoint->m_bShowName;
883 m_bIsVisible_save = m_pRoutePoint->m_bIsVisible;
884 m_Name_save = m_pRoutePoint->GetName();
885 m_Description_save = m_pRoutePoint->m_MarkDescription;
886 m_bUseScaMin_save = m_pRoutePoint->GetUseSca();
887 m_iScaminVal_save = m_pRoutePoint->GetScaMin();
889 if (m_pMyLinkList)
delete m_pMyLinkList;
890 m_pMyLinkList =
new HyperlinkList();
891 int NbrOfLinks = m_pRoutePoint->m_HyperlinkList->GetCount();
892 if (NbrOfLinks > 0) {
893 wxHyperlinkListNode* linknode =
894 m_pRoutePoint->m_HyperlinkList->GetFirst();
899 h->DescrText = link->DescrText;
900 h->Link = link->Link;
901 h->LType = link->LType;
903 m_pMyLinkList->Append(h);
905 linknode = linknode->GetNext();
911void MarkInfoDlg::UpdateHtmlList() {
913 GetSimpleBox()->Clear();
914 int NbrOfLinks = m_pRoutePoint->m_HyperlinkList->GetCount();
916 if (NbrOfLinks > 0) {
917 wxHyperlinkListNode* linknode = m_pRoutePoint->m_HyperlinkList->GetFirst();
920 wxString s = wxString::Format(wxT(
"<a href='%s'>%s</a>"), link->Link,
922 GetSimpleBox()->AppendString(s);
923 linknode = linknode->GetNext();
928 wxWindowList kids = m_scrolledWindowLinks->GetChildren();
929 for (
unsigned int i = 0; i < kids.GetCount(); i++) {
930 wxWindowListNode* node = kids.Item(i);
931 wxWindow* win = node->GetData();
933 auto link_win =
dynamic_cast<wxHyperlinkCtrl*
>(win);
935 link_win->Disconnect(
936 wxEVT_COMMAND_HYPERLINK,
937 wxHyperlinkEventHandler(MarkInfoDlg::OnHyperLinkClick));
938 link_win->Disconnect(
940 wxMouseEventHandler(MarkInfoDlg::m_htmlListContextMenu));
945 int NbrOfLinks = m_pRoutePoint->m_HyperlinkList->GetCount();
946 HyperlinkList* hyperlinklist = m_pRoutePoint->m_HyperlinkList;
947 if (NbrOfLinks > 0) {
948 wxHyperlinkListNode* linknode = hyperlinklist->GetFirst();
951 wxString Link = link->Link;
952 wxString Descr = link->DescrText;
954 wxHyperlinkCtrl* ctrl =
new wxHyperlinkCtrl(
955 m_scrolledWindowLinks, wxID_ANY, Descr, Link, wxDefaultPosition,
956 wxDefaultSize, wxNO_BORDER | wxHL_CONTEXTMENU | wxHL_ALIGN_LEFT);
957 ctrl->Connect(wxEVT_COMMAND_HYPERLINK,
958 wxHyperlinkEventHandler(MarkInfoDlg::OnHyperLinkClick),
960 if (!m_pRoutePoint->m_bIsInLayer)
961 ctrl->Connect(wxEVT_RIGHT_DOWN,
962 wxMouseEventHandler(MarkInfoDlg::m_htmlListContextMenu),
965 bSizerLinks->Add(ctrl, 1, wxALL | wxEXPAND, 5);
967 linknode = linknode->GetNext();
972 m_scrolledWindowLinks->Layout();
976void MarkInfoDlg::OnHyperLinkClick(wxHyperlinkEvent& event) {
977 wxString url =
event.GetURL();
978 url.Replace(_T(
" "), _T(
"%20"));
979 if (g_Platform) g_Platform->platformLaunchDefaultBrowser(url);
982void MarkInfoDlg::OnHtmlLinkClicked(wxHtmlLinkEvent& event) {
992 wxString cc =
event.GetLinkInfo().GetHref().c_str();
993 if (cc.Find(_T(
"#")) != wxNOT_FOUND) {
995 wxString(_T(
"HKEY_CLASSES_ROOT\\HTTP\\shell\\open\\command")));
996 if (RegKey.Exists()) {
997 wxString command_line;
998 RegKey.QueryValue(wxString(_T(
"")), command_line);
1001 command_line.Replace(wxString(_T(
"\"")), wxString(_T(
"")));
1004 int l = command_line.Find(_T(
".exe"));
1005 if (wxNOT_FOUND == l) l = command_line.Find(_T(
".EXE"));
1007 if (wxNOT_FOUND != l) {
1008 wxString cl = command_line.Mid(0, l + 4);
1010 cc.Prepend(_T(
"\""));
1011 cc.Append(_T(
"\""));
1017 wxString url =
event.GetLinkInfo().GetHref().c_str();
1018 url.Replace(_T(
" "), _T(
"%20"));
1019 ::wxLaunchDefaultBrowser(url);
1023 wxString url =
event.GetLinkInfo().GetHref().c_str();
1024 url.Replace(_T(
" "), _T(
"%20"));
1025 if (g_Platform) g_Platform->platformLaunchDefaultBrowser(url);
1031void MarkInfoDlg::OnLayoutResize(wxCommandEvent& event) {
1032 m_panelBasicProperties->Layout();
1036void MarkInfoDlg::OnDescChangedExt(wxCommandEvent& event) {
1037 if (m_panelDescription->IsShownOnScreen()) {
1038 m_textDescription->ChangeValue(m_textCtrlExtDescription->GetValue());
1042void MarkInfoDlg::OnDescChangedBasic(wxCommandEvent& event) {
1043 if (m_panelBasicProperties->IsShownOnScreen()) {
1044 m_textCtrlExtDescription->ChangeValue(m_textDescription->GetValue());
1049void MarkInfoDlg::OnExtDescriptionClick(wxCommandEvent& event) {
1050 long pos = m_textDescription->GetInsertionPoint();
1051 m_notebookProperties->SetSelection(1);
1052 m_textCtrlExtDescription->SetInsertionPoint(pos);
1056void MarkInfoDlg::OnShowWaypointNameSelectBasic(wxCommandEvent& event) {
1057 m_checkBoxShowNameExt->SetValue(m_checkBoxShowName->GetValue());
1060void MarkInfoDlg::OnShowWaypointNameSelectExt(wxCommandEvent& event) {
1061 m_checkBoxShowName->SetValue(m_checkBoxShowNameExt->GetValue());
1065void MarkInfoDlg::OnWptRangeRingsNoChange(wxCommandEvent& event) {
1066 if (!m_pRoutePoint->m_bIsInLayer) {
1067 m_textWaypointRangeRingsStep->Enable(
1068 (
bool)(m_ChoiceWaypointRangeRingsNumber->GetSelection() != 0));
1069 m_PickColor->Enable(
1070 (
bool)(m_ChoiceWaypointRangeRingsNumber->GetSelection() != 0));
1074void MarkInfoDlg::OnSelectScaMinExt(wxCommandEvent& event) {
1075 if (!m_pRoutePoint->m_bIsInLayer) {
1076 m_textScaMin->Enable(m_checkBoxScaMin->GetValue());
1080void MarkInfoDlg::OnPositionCtlUpdated(wxCommandEvent& event) {
1082 double lat = fromDMM(m_textLatitude->GetValue());
1083 double lon = fromDMM(m_textLongitude->GetValue());
1084 if (!m_pRoutePoint->m_bIsInLayer) {
1085 m_pRoutePoint->SetPosition(lat, lon);
1086 pSelect->ModifySelectablePoint(lat, lon, (
void*)m_pRoutePoint,
1087 SELTYPE_ROUTEPOINT);
1090 gFrame->RefreshAllCanvas();
1093void MarkInfoDlg::m_htmlListContextMenu(wxMouseEvent& event) {
1097 wxPoint pos =
event.GetPosition();
1098 i_htmlList_item = -1;
1099 for (
int i = 0; i < (int)GetSimpleBox()->GetCount(); i++) {
1100 wxRect rect = GetSimpleBox()->GetItemRect(i);
1101 if (rect.Contains(pos)) {
1102 i_htmlList_item = i;
1107 wxMenu* popup =
new wxMenu();
1108 if ((GetSimpleBox()->GetCount()) > 0 && (i_htmlList_item > -1) &&
1109 (i_htmlList_item < (
int)GetSimpleBox()->GetCount())) {
1110 popup->Append(ID_RCLK_MENU_DELETE_LINK, _(
"Delete"));
1111 popup->Append(ID_RCLK_MENU_EDIT_LINK, _(
"Edit"));
1113 popup->Append(ID_RCLK_MENU_ADD_LINK, _(
"Add New"));
1115 m_contextObject =
event.GetEventObject();
1117 wxEVT_COMMAND_MENU_SELECTED,
1118 wxCommandEventHandler(MarkInfoDlg::On_html_link_popupmenu_Click), NULL,
1124 m_pEditedLink =
dynamic_cast<wxHyperlinkCtrl*
>(
event.GetEventObject());
1126 if (m_pEditedLink) {
1127 wxString url = m_pEditedLink->GetURL();
1128 wxString label = m_pEditedLink->GetLabel();
1129 i_htmlList_item = -1;
1130 HyperlinkList* hyperlinklist = m_pRoutePoint->m_HyperlinkList;
1131 if (hyperlinklist->GetCount() > 0) {
1133 wxHyperlinkListNode* linknode = hyperlinklist->GetFirst();
1136 if (link->DescrText == label) {
1137 i_htmlList_item = i;
1141 linknode = linknode->GetNext();
1148 wxMenu* popup =
new wxMenu();
1150 wxMenuItem* menuItemDelete =
1151 new wxMenuItem(popup, ID_RCLK_MENU_DELETE_LINK, wxString(_(
"Delete")),
1152 wxEmptyString, wxITEM_NORMAL);
1154 menuItemDelete->SetFont(sFont);
1156 popup->Append(menuItemDelete);
1158 wxMenuItem* menuItemEdit =
1159 new wxMenuItem(popup, ID_RCLK_MENU_EDIT_LINK, wxString(_(
"Edit")),
1160 wxEmptyString, wxITEM_NORMAL);
1162 menuItemEdit->SetFont(sFont);
1164 popup->Append(menuItemEdit);
1167 wxMenuItem* menuItemAdd =
1168 new wxMenuItem(popup, ID_RCLK_MENU_ADD_LINK, wxString(_(
"Add New")),
1169 wxEmptyString, wxITEM_NORMAL);
1171 menuItemAdd->SetFont(sFont);
1173 popup->Append(menuItemAdd);
1175 m_contextObject =
event.GetEventObject();
1177 wxEVT_COMMAND_MENU_SELECTED,
1178 wxCommandEventHandler(MarkInfoDlg::On_html_link_popupmenu_Click), NULL,
1180 wxPoint p = m_scrolledWindowLinks->GetPosition();
1181 p.x += m_scrolledWindowLinks->GetSize().x / 2;
1182 PopupMenu(popup, p);
1205void MarkInfoDlg::OnAddLink(wxCommandEvent& event) {
1206 wxCommandEvent evt(wxEVT_COMMAND_MENU_SELECTED);
1207 evt.SetId(ID_RCLK_MENU_ADD_LINK);
1209 On_html_link_popupmenu_Click(evt);
1212void MarkInfoDlg::On_html_link_popupmenu_Click(wxCommandEvent& event) {
1213 switch (event.GetId()) {
1214 case ID_RCLK_MENU_DELETE_LINK: {
1215 wxHyperlinkListNode* node =
1216 m_pRoutePoint->m_HyperlinkList->Item(i_htmlList_item);
1217 m_pRoutePoint->m_HyperlinkList->DeleteNode(node);
1221 case ID_RCLK_MENU_EDIT_LINK: {
1223 m_pRoutePoint->m_HyperlinkList->Item(i_htmlList_item)->GetData();
1225 LinkPropDlg->m_textCtrlLinkDescription->SetValue(link->DescrText);
1226 LinkPropDlg->m_textCtrlLinkUrl->SetValue(link->Link);
1227 DimeControl(LinkPropDlg);
1228 LinkPropDlg->ShowWindowModalThenDo([
this, LinkPropDlg,
1229 link](
int retcode) {
1230 if (retcode == wxID_OK) {
1231 link->DescrText = LinkPropDlg->m_textCtrlLinkDescription->GetValue();
1232 link->Link = LinkPropDlg->m_textCtrlLinkUrl->GetValue();
1233 m_pRoutePoint->m_HyperlinkList->Item(i_htmlList_item)->SetData(link);
1239 case ID_RCLK_MENU_ADD_LINK: {
1241 LinkPropDlg->m_textCtrlLinkDescription->SetValue(wxEmptyString);
1242 LinkPropDlg->m_textCtrlLinkUrl->SetValue(wxEmptyString);
1243 DimeControl(LinkPropDlg);
1244 LinkPropDlg->ShowWindowModalThenDo([
this, LinkPropDlg](
int retcode) {
1245 if (retcode == wxID_OK) {
1247 link->DescrText = LinkPropDlg->m_textCtrlLinkDescription->GetValue();
1248 link->Link = LinkPropDlg->m_textCtrlLinkUrl->GetValue();
1250 if (link->DescrText == wxEmptyString) {
1251 link->DescrText = link->Link;
1253 if (link->Link == wxEmptyString) {
1256 m_pRoutePoint->m_HyperlinkList->Append(link);
1267void MarkInfoDlg::OnRightClickLatLon(wxCommandEvent& event) {
1268 wxMenu* popup =
new wxMenu();
1269 popup->Append(ID_RCLK_MENU_COPY, _(
"Copy"));
1270 popup->Append(ID_RCLK_MENU_COPY_LL, _(
"Copy lat/long"));
1271 popup->Append(ID_RCLK_MENU_PASTE, _(
"Paste"));
1272 popup->Append(ID_RCLK_MENU_PASTE_LL, _(
"Paste lat/long"));
1273 m_contextObject =
event.GetEventObject();
1274 popup->Connect(wxEVT_COMMAND_MENU_SELECTED,
1275 wxCommandEventHandler(MarkInfoDlg::OnCopyPasteLatLon), NULL,
1282void MarkInfoDlg::OnCopyPasteLatLon(wxCommandEvent& event) {
1284 double lat = fromDMM(m_textLatitude->GetValue());
1285 double lon = fromDMM(m_textLongitude->GetValue());
1289 switch (event.GetId()) {
1290 case ID_RCLK_MENU_PASTE: {
1291 if (wxTheClipboard->Open()) {
1292 wxTextDataObject data;
1293 wxTheClipboard->GetData(data);
1294 result = data.GetText();
1295 ((wxTextCtrl*)m_contextObject)->SetValue(result);
1296 wxTheClipboard->Close();
1300 case ID_RCLK_MENU_PASTE_LL: {
1301 if (wxTheClipboard->Open()) {
1302 wxTextDataObject data;
1303 wxTheClipboard->GetData(data);
1304 result = data.GetText();
1308 if (pparse.IsOk()) {
1309 m_textLatitude->SetValue(pparse.GetLatitudeString());
1310 m_textLongitude->SetValue(pparse.GetLongitudeString());
1312 wxTheClipboard->Close();
1316 case ID_RCLK_MENU_COPY: {
1317 result = ((wxTextCtrl*)m_contextObject)->GetValue();
1320 case ID_RCLK_MENU_COPY_LL: {
1321 result << toSDMM(1, lat,
true) << _T(
'\t');
1322 result << toSDMM(2, lon,
true);
1327 if (wxTheClipboard->Open()) {
1328 wxTextDataObject* data =
new wxTextDataObject;
1329 data->SetText(result);
1330 wxTheClipboard->SetData(data);
1331 wxTheClipboard->Close();
1335void MarkInfoDlg::DefautlBtnClicked(wxCommandEvent& event) {
1337 m_SaveDefaultDlg->Center();
1338 DimeControl(m_SaveDefaultDlg);
1339 int retcode = m_SaveDefaultDlg->ShowModal();
1342 if (retcode == wxID_OK) {
1344 if (m_SaveDefaultDlg->IconCB->GetValue()) {
1346 *pWayPointMan->GetIconKey(m_bcomboBoxIcon->GetSelection());
1348 if (m_SaveDefaultDlg->RangRingsCB->GetValue()) {
1349 g_iWaypointRangeRingsNumber =
1350 m_ChoiceWaypointRangeRingsNumber->GetSelection();
1351 if (m_textWaypointRangeRingsStep->GetValue().ToDouble(&value))
1352 g_fWaypointRangeRingsStep = fromUsrDistance(value, -1);
1353 g_colourWaypointRangeRingsColour = m_PickColor->GetColour();
1355 if (m_SaveDefaultDlg->ArrivalRCB->GetValue())
1356 if (m_textArrivalRadius->GetValue().ToDouble(&value))
1357 g_n_arrival_circle_radius = fromUsrDistance(value, -1);
1358 if (m_SaveDefaultDlg->ScaleCB->GetValue()) {
1359 g_iWpt_ScaMin = wxAtoi(m_textScaMin->GetValue());
1360 g_bUseWptScaMin = m_checkBoxScaMin->GetValue();
1362 if (m_SaveDefaultDlg->NameCB->GetValue()) {
1363 g_bShowWptName = m_checkBoxShowName->GetValue();
1366 m_SaveDefaultDlg = NULL;
1370void MarkInfoDlg::OnMarkInfoCancelClick(wxCommandEvent& event) {
1371 if (m_pRoutePoint) {
1372 m_pRoutePoint->SetVisible(m_bIsVisible_save);
1373 m_pRoutePoint->SetNameShown(m_bShowName_save);
1374 m_pRoutePoint->SetPosition(m_lat_save, m_lon_save);
1375 m_pRoutePoint->SetIconName(m_IconName_save);
1376 m_pRoutePoint->ReLoadIcon();
1377 m_pRoutePoint->SetName(m_Name_save);
1378 m_pRoutePoint->m_MarkDescription = m_Description_save;
1379 m_pRoutePoint->SetUseSca(m_bUseScaMin_save);
1380 m_pRoutePoint->SetScaMin(m_iScaminVal_save);
1382 m_pRoutePoint->m_HyperlinkList->Clear();
1384 int NbrOfLinks = m_pMyLinkList->GetCount();
1385 if (NbrOfLinks > 0) {
1386 wxHyperlinkListNode* linknode = m_pMyLinkList->GetFirst();
1390 h->DescrText = link->DescrText;
1391 h->Link = link->Link;
1392 h->LType = link->LType;
1394 m_pRoutePoint->m_HyperlinkList->Append(h);
1396 linknode = linknode->GetNext();
1401 m_lasttspos.Clear();
1408 delete m_pMyLinkList;
1409 m_pMyLinkList = NULL;
1410 SetClientSize(m_defaultClientSize);
1413 androidEnableBackButton(
true);
1419void MarkInfoDlg::OnMarkInfoOKClick(wxCommandEvent& event) {
1420 if (m_pRoutePoint) {
1421 m_pRoutePoint->m_wxcWaypointRangeRingsColour = m_PickColor->GetColour();
1423 OnPositionCtlUpdated(event);
1433 if (pRouteManagerDialog && pRouteManagerDialog->IsShown())
1434 pRouteManagerDialog->UpdateWptListCtrl();
1436 if (pRoutePropDialog && pRoutePropDialog->IsShown())
1437 pRoutePropDialog->UpdatePoints();
1439 SetClientSize(m_defaultClientSize);
1442 androidEnableBackButton(
true);
1448bool MarkInfoDlg::UpdateProperties(
bool positionOnly) {
1449 if (m_pRoutePoint) {
1450 m_textLatitude->SetValue(::toSDMM(1, m_pRoutePoint->m_lat));
1451 m_textLongitude->SetValue(::toSDMM(2, m_pRoutePoint->m_lon));
1452 m_lat_save = m_pRoutePoint->m_lat;
1453 m_lon_save = m_pRoutePoint->m_lon;
1454 m_textName->SetValue(m_pRoutePoint->GetName());
1455 m_textDescription->ChangeValue(m_pRoutePoint->m_MarkDescription);
1456 m_textCtrlExtDescription->ChangeValue(m_pRoutePoint->m_MarkDescription);
1457 m_checkBoxShowName->SetValue(m_pRoutePoint->m_bShowName);
1458 m_checkBoxShowNameExt->SetValue(m_pRoutePoint->m_bShowName);
1459 m_checkBoxVisible->SetValue(m_pRoutePoint->m_bIsVisible);
1460 m_checkBoxScaMin->SetValue(m_pRoutePoint->GetUseSca());
1461 m_textScaMin->SetValue(
1462 wxString::Format(wxT(
"%i"), (
int)m_pRoutePoint->GetScaMin()));
1463 m_textCtrlGuid->SetValue(m_pRoutePoint->m_GUID);
1464 m_ChoiceWaypointRangeRingsNumber->SetSelection(
1465 m_pRoutePoint->GetWaypointRangeRingsNumber());
1467 buf.Printf(_T(
"%.3f"),
1468 toUsrDistance(m_pRoutePoint->GetWaypointRangeRingsStep(), -1));
1469 m_textWaypointRangeRingsStep->SetValue(buf);
1470 m_staticTextArrivalUnits->SetLabel(getUsrDistanceUnit());
1471 buf.Printf(_T(
"%.3f"),
1472 toUsrDistance(m_pRoutePoint->GetWaypointArrivalRadius(), -1));
1473 m_textArrivalRadius->SetValue(buf);
1475 int nUnits = m_pRoutePoint->GetWaypointRangeRingsStepUnits();
1476 m_RangeRingUnits->SetSelection(nUnits);
1478 wxColour col = m_pRoutePoint->m_wxcWaypointRangeRingsColour;
1479 m_PickColor->SetColour(col);
1481 if (m_pRoutePoint->m_bIsInRoute) {
1482 if (m_name_validator) m_name_validator.reset();
1484 std::make_unique<RoutePointNameValidator>(m_pRoutePoint);
1485 m_textName->SetValidator(*m_name_validator);
1487 m_textName->Bind(wxEVT_KILL_FOCUS, &MarkInfoDlg::OnFocusEvent,
this);
1489 m_textName->SetValidator();
1491 m_textName->Unbind(wxEVT_KILL_FOCUS, &MarkInfoDlg::OnFocusEvent,
this);
1494 if (m_comboBoxTideStation->GetStringSelection() !=
1495 m_pRoutePoint->m_TideStation) {
1496 m_comboBoxTideStation->Clear();
1497 m_comboBoxTideStation->Append(wxEmptyString);
1498 if (!m_pRoutePoint->m_TideStation.IsEmpty()) {
1499 m_comboBoxTideStation->Append(m_pRoutePoint->m_TideStation);
1500 m_comboBoxTideStation->SetSelection(1);
1504 m_staticTextPlSpeedUnits->SetLabel(getUsrSpeedUnit());
1505 if (m_pRoutePoint->GetPlannedSpeed() > .01) {
1507 "%.1f", toUsrSpeed(m_pRoutePoint->GetPlannedSpeed())));
1512 bool isLastWaypoint =
false;
1513 if (m_pRoutePoint && m_pRoutePoint->m_bIsInRoute) {
1515 wxArrayPtrVoid* pRouteArray =
1518 isLastWaypoint =
true;
1520 for (
unsigned int i = 0; i < pRouteArray->GetCount(); i++) {
1522 if (route->GetLastPoint()->m_GUID != m_pRoutePoint->m_GUID) {
1523 isLastWaypoint =
false;
1532 if (isLastWaypoint) {
1537 if (etd.IsValid()) {
1540 if (dtFormat ==
"Local Time") {
1544 }
else if (dtFormat ==
"UTC") {
1551 "MarkInfoDlg::UpdateProperties. Unexpected date/time format: %s",
1553 etd = wxInvalidDateTime;
1564 m_staticTextPlSpeed->Show(m_pRoutePoint->m_bIsInRoute);
1570 m_staticTextPlSpeedUnits->Show(m_pRoutePoint->m_bIsInRoute);
1571 m_staticTextArrivalRadius->Show(m_pRoutePoint->m_bIsInRoute);
1572 m_staticTextArrivalUnits->Show(m_pRoutePoint->m_bIsInRoute);
1573 m_textArrivalRadius->Show(m_pRoutePoint->m_bIsInRoute);
1575 if (positionOnly)
return true;
1578 if (m_pRoutePoint->m_bIsInLayer) {
1579 m_staticTextLayer->Enable();
1580 m_staticTextLayer->Show(
true);
1581 m_textName->SetEditable(
false);
1582 m_textDescription->SetEditable(
false);
1583 m_textCtrlExtDescription->SetEditable(
false);
1584 m_textLatitude->SetEditable(
false);
1585 m_textLongitude->SetEditable(
false);
1586 m_bcomboBoxIcon->Enable(
false);
1587 m_checkBoxShowName->Enable(
false);
1588 m_checkBoxVisible->Enable(
false);
1589 m_textArrivalRadius->SetEditable(
false);
1590 m_checkBoxScaMin->Enable(
false);
1591 m_textScaMin->SetEditable(
false);
1592 m_checkBoxShowNameExt->Enable(
false);
1593 m_ChoiceWaypointRangeRingsNumber->Enable(
false);
1594 m_textWaypointRangeRingsStep->SetEditable(
false);
1595 m_PickColor->Enable(
false);
1596 DefaultsBtn->Enable(
false);
1600 m_notebookProperties->SetSelection(0);
1601 m_comboBoxTideStation->Enable(
false);
1603 m_staticTextLayer->Enable(
false);
1604 m_staticTextLayer->Show(
false);
1605 m_textName->SetEditable(
true);
1606 m_textDescription->SetEditable(
true);
1607 m_textCtrlExtDescription->SetEditable(
true);
1608 m_textLatitude->SetEditable(
true);
1609 m_textLongitude->SetEditable(
true);
1610 m_bcomboBoxIcon->Enable(
true);
1611 m_checkBoxShowName->Enable(
true);
1612 m_checkBoxVisible->Enable(
true);
1613 m_textArrivalRadius->SetEditable(
true);
1614 m_checkBoxScaMin->Enable(
true);
1615 m_textScaMin->SetEditable(
true);
1616 m_checkBoxShowNameExt->Enable(
true);
1617 m_ChoiceWaypointRangeRingsNumber->Enable(
true);
1618 m_textWaypointRangeRingsStep->SetEditable(
true);
1619 m_PickColor->Enable(
true);
1620 DefaultsBtn->Enable(
true);
1621 m_notebookProperties->SetSelection(0);
1622 m_comboBoxTideStation->Enable(
true);
1632 m_bcomboBoxIcon->Clear();
1634 bool fillCombo = m_bcomboBoxIcon->GetCount() == 0;
1637 for (
int i = 0; i < pWayPointMan->GetNumIcons(); i++) {
1638 wxString* ps = pWayPointMan->GetIconDescription(i);
1640 pWayPointMan->GetIconBitmapForList(i, 2 * GetCharHeight());
1642 m_bcomboBoxIcon->Append(*ps, bmp);
1646 int iconToSelect = -1;
1647 for (
int i = 0; i < pWayPointMan->GetNumIcons(); i++) {
1648 if (*pWayPointMan->GetIconKey(i) == m_pRoutePoint->GetIconName()) {
1650 m_bcomboBoxIcon->Select(iconToSelect);
1655 OnShowWaypointNameSelectBasic(ev);
1656 OnWptRangeRingsNoChange(ev);
1657 OnSelectScaMinExt(ev);
1662 androidEnableBackButton(
false);
1673void MarkInfoDlg::OnFocusEvent(wxFocusEvent& event) {
1674 bool is_valid = Validate();
1675 m_buttonOkay->Enable(is_valid);
1679void MarkInfoDlg::OnBitmapCombClick(wxCommandEvent& event) {
1680 wxString* icon_name =
1681 pWayPointMan->GetIconKey(m_bcomboBoxIcon->GetSelection());
1682 if (icon_name && icon_name->Length()) m_pRoutePoint->SetIconName(*icon_name);
1683 m_pRoutePoint->ReLoadIcon();
1688void MarkInfoDlg::ValidateMark(
void) {
1691 wxRoutePointListNode* node = pWayPointMan->GetWaypointList()->GetFirst();
1693 bool b_found =
false;
1696 if (m_pRoutePoint == rp) {
1700 node = node->GetNext();
1702 if (!b_found) m_pRoutePoint = NULL;
1705bool MarkInfoDlg::SaveChanges() {
1706 if (m_pRoutePoint) {
1707 if (m_pRoutePoint->m_bIsInLayer)
return true;
1708 if (!this->Validate())
return false;
1711 m_pRoutePoint->SetName(m_textName->GetValue());
1712 m_pRoutePoint->SetWaypointArrivalRadius(m_textArrivalRadius->GetValue());
1713 m_pRoutePoint->SetScaMin(m_textScaMin->GetValue());
1714 m_pRoutePoint->SetUseSca(m_checkBoxScaMin->GetValue());
1715 m_pRoutePoint->m_MarkDescription = m_textDescription->GetValue();
1716 m_pRoutePoint->SetVisible(m_checkBoxVisible->GetValue());
1717 m_pRoutePoint->m_bShowName = m_checkBoxShowName->GetValue();
1718 m_pRoutePoint->SetPosition(fromDMM(m_textLatitude->GetValue()),
1719 fromDMM(m_textLongitude->GetValue()));
1720 wxString* icon_name =
1721 pWayPointMan->GetIconKey(m_bcomboBoxIcon->GetSelection());
1722 if (icon_name && icon_name->Length())
1723 m_pRoutePoint->SetIconName(*icon_name);
1724 m_pRoutePoint->ReLoadIcon();
1725 m_pRoutePoint->SetShowWaypointRangeRings(
1726 (
bool)(m_ChoiceWaypointRangeRingsNumber->GetSelection() != 0));
1727 m_pRoutePoint->SetWaypointRangeRingsNumber(
1728 m_ChoiceWaypointRangeRingsNumber->GetSelection());
1730 if (m_textWaypointRangeRingsStep->GetValue().ToDouble(&value))
1731 m_pRoutePoint->SetWaypointRangeRingsStep(fromUsrDistance(value, -1));
1732 if (m_textArrivalRadius->GetValue().ToDouble(&value))
1733 m_pRoutePoint->SetWaypointArrivalRadius(fromUsrDistance(value, -1));
1735 if (m_RangeRingUnits->GetSelection() != wxNOT_FOUND)
1736 m_pRoutePoint->SetWaypointRangeRingsStepUnits(
1737 m_RangeRingUnits->GetSelection());
1739 m_pRoutePoint->m_TideStation = m_comboBoxTideStation->GetStringSelection();
1741 m_pRoutePoint->SetPlannedSpeed(0.0);
1745 m_pRoutePoint->SetPlannedSpeed(fromUsrSpeed(spd));
1752 int hour = t.GetHour();
1762 if (dtFormat ==
"Local Time") {
1763 m_pRoutePoint->
SetETD(dt.MakeUTC());
1764 }
else if (dtFormat ==
"UTC") {
1765 m_pRoutePoint->
SetETD(dt);
1774 "Failed to configured ETD. Unsupported date/time format: %s",
1776 m_pRoutePoint->
SetETD(wxInvalidDateTime);
1780 m_pRoutePoint->
SetETD(wxInvalidDateTime);
1783 if (m_pRoutePoint->m_bIsInRoute) {
1785 pSelect->UpdateSelectableRouteSegments(m_pRoutePoint);
1788 wxArrayPtrVoid* pEditRouteArray =
1791 if (pEditRouteArray) {
1792 for (
unsigned int ir = 0; ir < pEditRouteArray->GetCount(); ir++) {
1793 Route* pr = (
Route*)pEditRouteArray->Item(ir);
1794 pr->FinalizeForRendering();
1795 pr->UpdateSegmentDistances();
1797 pConfig->UpdateRoute(pr);
1799 delete pEditRouteArray;
1802 pConfig->UpdateWayPoint(m_pRoutePoint);
1808SaveDefaultsDialog::SaveDefaultsDialog(
MarkInfoDlg* parent)
1809 : wxDialog(parent, wxID_ANY, _(
"Save some defaults")) {
1811 this->SetSizeHints(wxDefaultSize, wxDefaultSize);
1813 wxBoxSizer* bSizer1 =
new wxBoxSizer(wxVERTICAL);
1814 wxStdDialogButtonSizer* StdDialogButtonSizer1;
1817 new wxStaticText(
this, wxID_ANY,
1818 _(
"Check which properties of current waypoint\n should "
1819 "be set as default for NEW waypoints."));
1820 bSizer1->Add(StaticText1, 0, wxALL | wxALIGN_CENTER_HORIZONTAL, 5);
1822 wxFlexGridSizer* fgSizer1 =
new wxFlexGridSizer(2);
1825 (g_pMarkInfoDialog->m_checkBoxShowName->GetValue() ? _(
"Do use")
1828 new wxCheckBox(
this, wxID_ANY, _(
"Show Waypoint Name"), wxDefaultPosition,
1829 wxDefaultSize, 0, wxDefaultValidator);
1830 fgSizer1->Add(NameCB, 0, wxALL, 5);
1831 stName =
new wxStaticText(
this, wxID_ANY, _T(
"[") + s + _T(
"]"),
1832 wxDefaultPosition, wxDefaultSize, 0);
1834 fgSizer1->Add(stName, 0, wxALL | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL, 5);
1836 s = g_pMarkInfoDialog->m_pRoutePoint->GetIconName();
1837 IconCB =
new wxCheckBox(
this, wxID_ANY, _(
"Icon"));
1838 fgSizer1->Add(IconCB, 0, wxALL, 5);
1839 stIcon =
new wxStaticText(
this, wxID_ANY, _T(
"[") + s + _T(
"]"),
1840 wxDefaultPosition, wxDefaultSize, 0);
1842 fgSizer1->Add(stIcon, 0, wxALL | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL, 5);
1844 s = (g_pMarkInfoDialog->m_ChoiceWaypointRangeRingsNumber->GetSelection()
1848 g_pMarkInfoDialog->m_ChoiceWaypointRangeRingsNumber
1851 RangRingsCB =
new wxCheckBox(
this, wxID_ANY, _(
"Range rings"));
1852 fgSizer1->Add(RangRingsCB, 0, wxALL, 5);
1853 stRR =
new wxStaticText(
this, wxID_ANY, _T(
"[") + s + _T(
"]"),
1854 wxDefaultPosition, wxDefaultSize, 0);
1856 fgSizer1->Add(stRR, 0, wxALL | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL, 5);
1858 s = (g_pMarkInfoDialog->m_textArrivalRadius->GetValue());
1859 ArrivalRCB =
new wxCheckBox(
this, wxID_ANY, _(
"Arrival radius"));
1860 fgSizer1->Add(ArrivalRCB, 0, wxALL, 5);
1861 stArrivalR =
new wxStaticText(
1863 wxString::Format(_T(
"[%s %s]"), s.c_str(), getUsrDistanceUnit().c_str()),
1864 wxDefaultPosition, wxDefaultSize, 0);
1865 stArrivalR->Wrap(-1);
1866 fgSizer1->Add(stArrivalR, 0, wxALL | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL,
1869 s = (g_pMarkInfoDialog->m_checkBoxScaMin->GetValue()
1870 ? _(
"Show only if") + _T(
" < ") +
1871 g_pMarkInfoDialog->m_textScaMin->GetValue()
1872 : _(
"Show always"));
1873 ScaleCB =
new wxCheckBox(
this, wxID_ANY, _(
"Show only at scale"));
1874 fgSizer1->Add(ScaleCB, 0, wxALL, 5);
1875 stScale =
new wxStaticText(
this, wxID_ANY, _T(
"[") + s + _T(
"]"),
1876 wxDefaultPosition, wxDefaultSize, 0);
1878 fgSizer1->Add(stScale, 0, wxALL | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL, 5);
1880 bSizer1->Add(fgSizer1, 0, wxALL | wxEXPAND, 5);
1882 StdDialogButtonSizer1 =
new wxStdDialogButtonSizer();
1883 StdDialogButtonSizer1->AddButton(
new wxButton(
this, wxID_OK));
1884 StdDialogButtonSizer1->AddButton(
1885 new wxButton(
this, wxID_CANCEL, _(
"Cancel")));
1886 StdDialogButtonSizer1->Realize();
1887 bSizer1->Add(StdDialogButtonSizer1, 0, wxALL | wxEXPAND, 5);
1894 SetSize(parent->GetSize());
1900void MarkInfoDlg::ShowTidesBtnClicked(wxCommandEvent& event) {
1901 if (m_comboBoxTideStation->GetSelection() < 1) {
1905 ptcmgr->GetStationIDXbyName(m_comboBoxTideStation->GetStringSelection(),
1906 fromDMM(m_textLatitude->GetValue()),
1907 fromDMM(m_textLongitude->GetValue())));
1909 TCWin* pCwin =
new TCWin(gFrame->GetPrimaryCanvas(), 0, 0, pIDX);
1912 wxString msg(_(
"Tide Station not found"));
1914 msg += m_comboBoxTideStation->GetStringSelection();
1915 OCPNMessageBox(NULL, msg, _(
"OpenCPN Info"), wxOK | wxCENTER, 10);
Represents an index entry for tidal and current data.
Dialog for displaying and editing waypoint properties.
wxDatePickerCtrl * m_EtdDatePickerCtrl
Date picker control for setting the Estimated Time of Departure (ETD).
wxStaticText * m_staticTextEtd
Label for the Estimated Time of Departure field.
wxCheckBox * m_cbEtdPresent
Checkbox control that enables/disables manual ETD setting for a waypoint.
wxTextCtrl * m_textCtrlPlSpeed
Text control for waypoint planned speed.
wxTimePickerCtrl * m_EtdTimePickerCtrl
Time picker control for setting the Estimated Time of Departure (ETD).
Custom combobox for selecting waypoint icons.
Represents a waypoint or mark within the navigation system.
wxDateTime GetManualETD()
Retrieves the manually set Estimated Time of Departure for this waypoint, in UTC.
void SetETD(const wxDateTime &etd)
Sets the Estimated Time of Departure for this waypoint, in UTC.
Represents a navigational route in the navigation system.
wxArrayPtrVoid * GetRouteArrayContaining(RoutePoint *pWP)
Find all routes that contain the given waypoint.
Dialog for saving default waypoint properties.
Text field with validator and error handler.
void OnTextChanged(wxCommandEvent &event)
Text changed event handler.
wxFont * GetOCPNScaledFont(wxString item, int default_size)
Retrieves a font from FontMgr, optionally scaled for physical readability.
wxFont GetOCPNGUIScaledFont(wxString item)
Retrieves a font optimized for touch and high-resolution interfaces.
General purpose GUI support.
wxString getUsrDateTimeFormat()
Return the date/time format to use when formatting date/time strings.
GUI library utils and events.