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 "routeprintout.h"
58#include "RoutePropDlgImpl.h"
65#include "androidUTIL.h"
66#include <QtWidgets/QScroller>
78extern wxString g_default_wp_icon;
84extern float g_MarkScaleFactorExp;
88WX_DECLARE_LIST(wxBitmap, BitmapList);
89#include <wx/listimpl.cpp>
90WX_DEFINE_LIST(BitmapList);
92#include <wx/arrimpl.cpp>
93WX_DEFINE_OBJARRAY(ArrayOfBitmaps);
95#define EXTENDED_PROP_PAGE 2
97OCPNIconCombo::OCPNIconCombo(wxWindow* parent, wxWindowID
id,
98 const wxString& value,
const wxPoint& pos,
99 const wxSize& size,
int n,
100 const wxString choices[],
long style,
101 const wxValidator& validator,
const wxString& name)
102 : wxOwnerDrawnComboBox(parent, id, value, pos, size, n, choices, style,
105 GetFont().GetPointSize() / g_Platform->getFontPointsperPixel();
106 itemHeight = (int)wxRound(fontHeight);
109OCPNIconCombo::~OCPNIconCombo() {}
111void OCPNIconCombo::OnDrawItem(wxDC& dc,
const wxRect& rect,
int item,
113 int offset_x = bmpArray[item].GetWidth();
114 int bmpHeight = bmpArray[item].GetHeight();
115 dc.DrawBitmap(bmpArray[item], rect.x, rect.y + (rect.height - bmpHeight) / 2,
118 if (flags & wxODCB_PAINTING_CONTROL) {
119 wxString text = GetValue();
122#if wxCHECK_VERSION(2, 9, 0)
123 if (ShouldUseHintText()) {
125 wxColour col = wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT);
126 dc.SetTextForeground(col);
129 margin_x = GetMargins().x;
132 dc.DrawText(text, rect.x + margin_x + offset_x,
133 (rect.height - dc.GetCharHeight()) / 2 + rect.y);
135 dc.DrawText(GetVListBoxComboPopup()->GetString(item), rect.x + 2 + offset_x,
136 (rect.height - dc.GetCharHeight()) / 2 + rect.y);
140wxCoord OCPNIconCombo::OnMeasureItem(
size_t item)
const {
141 int bmpHeight = bmpArray[item].GetHeight();
143 return wxMax(itemHeight, bmpHeight);
146wxCoord OCPNIconCombo::OnMeasureItemWidth(
size_t item)
const {
return -1; }
148int OCPNIconCombo::Append(
const wxString& item, wxBitmap bmp) {
150 int idx = wxOwnerDrawnComboBox::Append(item);
155void OCPNIconCombo::Clear(
void) {
156 wxOwnerDrawnComboBox::Clear();
170const wxEventType EVT_LLCHANGE = wxNewEventType();
179 const wxString& value, const wxPoint& pos,
180 const wxSize& size,
long style,
181 const wxValidator& validator,
182 const wxString& name)
183 : wxTextCtrl(parent,
id, value, pos, size, style, validator, name) {
184 m_pParentEventHandler = parent->GetEventHandler();
187void LatLonTextCtrl::OnKillFocus(wxFocusEvent& event) {
189 wxCommandEvent up_event(EVT_LLCHANGE, GetId());
190 up_event.SetEventObject((wxObject*)
this);
191 m_pParentEventHandler->AddPendingEvent(up_event);
200EVT_BUTTON(wxID_OK, MarkInfoDlg::OnMarkInfoOKClick)
201EVT_BUTTON(wxID_CANCEL, MarkInfoDlg::OnMarkInfoCancelClick)
202EVT_BUTTON(ID_BTN_DESC_BASIC, MarkInfoDlg::OnExtDescriptionClick)
203EVT_BUTTON(ID_DEFAULT, MarkInfoDlg::DefautlBtnClicked)
204EVT_BUTTON(ID_BTN_SHOW_TIDES, MarkInfoDlg::ShowTidesBtnClicked)
205EVT_COMBOBOX(ID_BITMAPCOMBOCTRL, MarkInfoDlg::OnBitmapCombClick)
206EVT_CHECKBOX(ID_CHECKBOX_SCAMIN_VIS, MarkInfoDlg::OnSelectScaMinExt)
207EVT_TEXT(ID_DESCR_CTR_DESC, MarkInfoDlg::OnDescChangedExt)
208EVT_TEXT(ID_DESCR_CTR_BASIC, MarkInfoDlg::OnDescChangedBasic)
209EVT_TEXT(ID_LATCTRL, MarkInfoDlg::OnPositionCtlUpdated)
210EVT_TEXT(ID_LONCTRL, MarkInfoDlg::OnPositionCtlUpdated)
211EVT_CHOICE(ID_WPT_RANGERINGS_NO, MarkInfoDlg::OnWptRangeRingsNoChange)
213EVT_HTML_LINK_CLICKED(wxID_ANY, MarkInfoDlg::OnHtmlLinkClicked)
214EVT_COMMAND(wxID_ANY, EVT_LAYOUT_RESIZE, MarkInfoDlg::OnLayoutResize)
215EVT_CLOSE(MarkInfoDlg::OnClose)
221 const wxPoint& pos, const wxSize& size,
long style) {
222 DIALOG_PARENT::Create(parent,
id, title, pos, size, style);
226 int metric = GetCharHeight();
230 wxString wqs = getFontQtStylesheet(qFont);
231 wxCharBuffer sbuf = wqs.ToUTF8();
232 QString qsb = QString(sbuf.data());
233 QString qsbq = getQtStyleSheet();
234 this->GetHandle()->setStyleSheet(qsb + qsbq);
236 if (sdc.IsOk()) sdc.GetTextExtent(_T(
"W"), NULL, &metric, NULL, NULL, qFont);
239 m_pMyLinkList = NULL;
240 SetColorScheme((ColorScheme)0);
241 m_pRoutePoint = NULL;
242 m_SaveDefaultDlg = NULL;
246 Connect(wxEVT_ACTIVATE, wxActivateEventHandler(MarkInfoDlg::OnActivate), NULL,
251void MarkInfoDlg::OnActivate(wxActivateEvent& event) {
252 auto pWin =
dynamic_cast<DIALOG_PARENT*
>(
event.GetEventObject());
253 long int style = pWin->GetWindowStyle();
254 if (event.GetActive())
255 pWin->SetWindowStyle(style | wxSTAY_ON_TOP);
257 pWin->SetWindowStyle(style ^ wxSTAY_ON_TOP);
260void MarkInfoDlg::initialize_images(
void) {
261 wxString iconDir = g_Platform->GetSharedDataDir() + _T(
"uidata/MUI_flat/");
262 _img_MUI_settings_svg = LoadSVG(iconDir + _T(
"MUI_settings.svg"),
263 2 * GetCharHeight(), 2 * GetCharHeight());
266 wxBitmap tide = style->GetIcon(_T(
"tidesml"));
267 wxImage tide1 = tide.ConvertToImage();
268 wxImage tide1s = tide1.Scale(m_sizeMetric * 3 / 2, m_sizeMetric * 3 / 2,
269 wxIMAGE_QUALITY_HIGH);
270 m_bmTide = wxBitmap(tide1s);
275void MarkInfoDlg::Create() {
278 m_sizeMetric = GetCharHeight();
283 wxString wqs = getFontQtStylesheet(qFont);
284 wxCharBuffer sbuf = wqs.ToUTF8();
285 QString qsb = QString(sbuf.data());
287 QString qsbq = getAdjustedDialogStyleSheet();
289 this->GetHandle()->setStyleSheet(qsb + qsbq);
293 sdc.GetTextExtent(_T(
"W"), NULL, &m_sizeMetric, NULL, NULL, qFont);
300 bSizer1 =
new wxBoxSizer(wxVERTICAL);
302 bSizer1->SetSizeHints(
this);
305 m_notebookProperties =
new wxNotebook(
this, wxID_ANY, wxDefaultPosition,
306 wxDefaultSize, wxNB_FIXEDWIDTH);
308 m_panelBasicProperties =
new wxScrolledWindow(
309 m_notebookProperties, wxID_ANY, wxDefaultPosition, wxDefaultSize,
310 wxHSCROLL | wxVSCROLL | wxTAB_TRAVERSAL);
312 m_panelBasicProperties->GetHandle()->setStyleSheet(
313 getAdjustedDialogStyleSheet());
317 m_panelBasicProperties->SetScrollRate(0, 2);
318 m_notebookProperties->AddPage(m_panelBasicProperties, _(
"Basic"),
true);
319 bSizerBasicProperties =
new wxBoxSizer(wxVERTICAL);
320 m_panelBasicProperties->SetSizer(bSizerBasicProperties);
323 m_staticTextLayer =
new wxStaticText(
324 m_panelBasicProperties, wxID_ANY,
325 _(
"This waypoint is part of a layer and can't be edited"),
326 wxDefaultPosition, wxDefaultSize, 0);
327 m_staticTextLayer->Enable(
false);
328 bSizerBasicProperties->Add(m_staticTextLayer, 0, wxALL, 5);
331 wxPanel* props_panel =
new wxPanel(m_panelBasicProperties);
333 props_panel->SetSizer(props_sizer);
334 bSizerBasicProperties->Add(props_panel, 0, wxALL | wxEXPAND, 16);
335 int label_size = m_sizeMetric * 4;
338 m_textName =
new TextField(props_panel, _(
"Name"));
341 wxStaticText* name_cb_label =
342 new wxStaticText(props_panel, wxID_ANY, _(
"Show waypoint name"));
344 new wxCheckBox(props_panel, wxID_ANY, wxEmptyString, wxDefaultPosition,
345 wxDefaultSize, wxALIGN_CENTER_VERTICAL);
346 m_checkBoxShowName->Bind(wxEVT_CHECKBOX,
347 &MarkInfoDlg::OnShowWaypointNameSelectBasic,
this);
348 props_sizer->Add(name_cb_label, 0, wxALIGN_TOP);
349 props_sizer->Add(m_checkBoxShowName, 0, wxEXPAND);
352 int icon_size = m_sizeMetric * 2;
353 icon_size = wxMax(icon_size, (32 * g_MarkScaleFactorExp) + 4);
355 new OCPNIconCombo(props_panel, wxID_ANY, _(
"Combo!"), wxDefaultPosition,
356 wxDefaultSize, 0, NULL, wxCB_READONLY);
357 m_bcomboBoxIcon->SetPopupMaxHeight(::wxGetDisplaySize().y / 2);
358 m_bcomboBoxIcon->SetMinSize(wxSize(-1, icon_size));
360 wxStaticText* icon_label =
new wxStaticText(props_panel, wxID_ANY, _(
"Icon"));
361 icon_label->SetMinSize(wxSize(label_size, -1));
362 props_sizer->Add(icon_label, 0, wxALIGN_CENTER_VERTICAL);
363 props_sizer->Add(m_bcomboBoxIcon, 0, wxEXPAND);
366 m_textLatitude =
new TextField(props_panel, _(
"Latitude"));
367 m_textLongitude =
new TextField(props_panel, _(
"Longitude"));
368 props_sizer->Fit(props_panel);
371 wxStaticBox* desc_box =
372 new wxStaticBox(m_panelBasicProperties, wxID_ANY, _(
"Description"));
373 wxStaticBoxSizer* desc_sizer =
new wxStaticBoxSizer(desc_box, wxHORIZONTAL);
374 bSizerBasicProperties->Add(desc_sizer, 1, wxALL | wxEXPAND, 8);
375 m_textDescription =
new wxTextCtrl(
376 m_panelBasicProperties, ID_DESCR_CTR_BASIC, wxEmptyString,
377 wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxTE_READONLY);
378 m_textDescription->SetMinSize(wxSize(-1, 80));
379 desc_sizer->Add(m_textDescription, 1, wxEXPAND);
382 m_buttonExtDescription =
383 new wxButton(m_panelBasicProperties, ID_BTN_DESC_BASIC, _T(
"..."),
384 wxDefaultPosition, wxSize(GetCharHeight() * 15 / 10, -1), 0);
385 desc_sizer->Add(m_buttonExtDescription, 0, wxEXPAND);
388 wxStaticBox* links_box =
389 new wxStaticBox(m_panelBasicProperties, wxID_ANY, _(
"Links"));
390 wxStaticBoxSizer* links_sizer =
new wxStaticBoxSizer(links_box, wxHORIZONTAL);
391 bSizerBasicProperties->Add(links_sizer, 1, wxALL | wxEXPAND, 8);
394 m_htmlList =
new wxSimpleHtmlListBox(m_panelBasicProperties, wxID_ANY,
395 wxDefaultPosition, wxDefaultSize, 0);
396 links_sizer->Add(m_htmlList, 1, wxEXPAND);
399 m_scrolledWindowLinks =
400 new wxScrolledWindow(m_panelBasicProperties, wxID_ANY, wxDefaultPosition,
401 wxSize(-1, 100), wxHSCROLL | wxVSCROLL);
402 m_scrolledWindowLinks->SetMinSize(wxSize(-1, 80));
403 m_scrolledWindowLinks->SetScrollRate(2, 2);
404 links_sizer->Add(m_scrolledWindowLinks, 1, wxEXPAND);
406 bSizerLinks =
new wxBoxSizer(wxVERTICAL);
407 m_scrolledWindowLinks->SetSizer(bSizerLinks);
409 m_menuLink =
new wxMenu();
410 wxMenuItem* m_menuItemDelete;
411 m_menuItemDelete =
new wxMenuItem(m_menuLink, wxID_ANY, wxString(_(
"Delete")),
412 wxEmptyString, wxITEM_NORMAL);
413 m_menuLink->Append(m_menuItemDelete);
415 wxMenuItem* m_menuItemEdit;
416 m_menuItemEdit =
new wxMenuItem(m_menuLink, wxID_ANY, wxString(_(
"Edit")),
417 wxEmptyString, wxITEM_NORMAL);
418 m_menuLink->Append(m_menuItemEdit);
420 wxMenuItem* m_menuItemAdd;
421 m_menuItemAdd =
new wxMenuItem(m_menuLink, wxID_ANY, wxString(_(
"Add new")),
422 wxEmptyString, wxITEM_NORMAL);
423 m_menuLink->Append(m_menuItemAdd);
425 wxBoxSizer* bSizer9 =
new wxBoxSizer(wxHORIZONTAL);
428 new wxButton(m_panelBasicProperties, wxID_ANY, _(
"Add new"),
429 wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT);
430 bSizer9->Add(m_buttonAddLink, 0, wxALL, 5);
432 m_buttonAddLink->Connect(wxEVT_COMMAND_BUTTON_CLICKED,
433 wxCommandEventHandler(MarkInfoDlg::OnAddLink), NULL,
436 links_sizer->Add(bSizer9, 0, wxEXPAND, 5);
441 new wxPanel(m_notebookProperties, wxID_ANY, wxDefaultPosition,
442 wxDefaultSize, wxTAB_TRAVERSAL);
443 wxBoxSizer* bSizer15;
444 bSizer15 =
new wxBoxSizer(wxVERTICAL);
446 m_textCtrlExtDescription =
447 new wxTextCtrl(m_panelDescription, ID_DESCR_CTR_DESC, wxEmptyString,
448 wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE);
449 bSizer15->Add(m_textCtrlExtDescription, 1, wxALL | wxEXPAND, 5);
451 m_panelDescription->SetSizer(bSizer15);
452 m_notebookProperties->AddPage(m_panelDescription, _(
"Description"),
false);
457 m_panelExtendedProperties =
new wxScrolledWindow(
458 m_notebookProperties, wxID_ANY, wxDefaultPosition, wxDefaultSize,
459 wxHSCROLL | wxVSCROLL | wxTAB_TRAVERSAL);
461 m_panelExtendedProperties->GetHandle()->setStyleSheet(
462 getAdjustedDialogStyleSheet());
465 m_panelExtendedProperties->SetScrollRate(0, 2);
467 wxBoxSizer* fSizerExtProperties =
new wxBoxSizer(wxVERTICAL);
468 m_panelExtendedProperties->SetSizer(fSizerExtProperties);
469 m_notebookProperties->AddPage(m_panelExtendedProperties, _(
"Extended"),
472 sbSizerExtProperties =
new wxStaticBoxSizer(
473 wxVERTICAL, m_panelExtendedProperties, _(
"Extended Properties"));
474 wxFlexGridSizer* gbSizerInnerExtProperties =
new wxFlexGridSizer(3, 0, 0);
475 gbSizerInnerExtProperties->AddGrowableCol(2);
476 gbSizerInnerExtProperties->SetFlexibleDirection(wxBOTH);
477 gbSizerInnerExtProperties->SetNonFlexibleGrowMode(wxFLEX_GROWMODE_SPECIFIED);
479 m_checkBoxVisible =
new wxCheckBox(sbSizerExtProperties->GetStaticBox(),
480 ID_CHECKBOX_VIS_EXT, wxEmptyString);
481 gbSizerInnerExtProperties->Add(m_checkBoxVisible);
482 wxStaticText* m_staticTextVisible =
new wxStaticText(
483 sbSizerExtProperties->GetStaticBox(), wxID_ANY, _(
"Show on chart"));
484 gbSizerInnerExtProperties->Add(m_staticTextVisible);
485 gbSizerInnerExtProperties->Add(0, 0, 1, wxEXPAND, 0);
487 m_checkBoxScaMin =
new wxCheckBox(sbSizerExtProperties->GetStaticBox(),
488 ID_CHECKBOX_SCAMIN_VIS, wxEmptyString);
489 gbSizerInnerExtProperties->Add(m_checkBoxScaMin, 0, wxALIGN_CENTRE_VERTICAL,
491 m_staticTextScaMin =
new wxStaticText(sbSizerExtProperties->GetStaticBox(),
492 wxID_ANY, _(
"Show at scale > 1 :"));
493 gbSizerInnerExtProperties->Add(m_staticTextScaMin, 0, wxALIGN_CENTRE_VERTICAL,
495 m_textScaMin =
new wxTextCtrl(sbSizerExtProperties->GetStaticBox(), wxID_ANY);
496 gbSizerInnerExtProperties->Add(m_textScaMin, 0, wxALL | wxEXPAND, 5);
498 m_checkBoxShowNameExt =
new wxCheckBox(sbSizerExtProperties->GetStaticBox(),
499 wxID_ANY, wxEmptyString);
500 m_checkBoxShowNameExt->Bind(wxEVT_CHECKBOX,
501 &MarkInfoDlg::OnShowWaypointNameSelectExt,
this);
502 gbSizerInnerExtProperties->Add(m_checkBoxShowNameExt);
503 m_staticTextShowNameExt =
new wxStaticText(
504 sbSizerExtProperties->GetStaticBox(), wxID_ANY, _(
"Show waypoint name"));
506 gbSizerInnerExtProperties->Add(m_staticTextShowNameExt);
507 gbSizerInnerExtProperties->Add(0, 0, 1, wxEXPAND, 0);
509 sbRangeRingsExtProperties =
new wxStaticBoxSizer(
510 wxVERTICAL, sbSizerExtProperties->GetStaticBox(), _(
"Range rings"));
511 wxFlexGridSizer* gbRRExtProperties =
new wxFlexGridSizer(4, 0, 0);
512 gbRRExtProperties->AddGrowableCol(0);
513 gbRRExtProperties->AddGrowableCol(1);
514 gbRRExtProperties->AddGrowableCol(3);
515 m_staticTextRR1 =
new wxStaticText(sbSizerExtProperties->GetStaticBox(),
516 wxID_ANY, _(
"Number"));
517 gbRRExtProperties->Add(m_staticTextRR1, 0, wxLEFT, 5);
518 m_staticTextRR2 =
new wxStaticText(sbSizerExtProperties->GetStaticBox(),
519 wxID_ANY, _(
"Distance"));
520 gbRRExtProperties->Add(m_staticTextRR2, 0, wxLEFT, 5);
521 gbRRExtProperties->Add(0, 0, 1, wxEXPAND, 5);
522 m_staticTextRR4 =
new wxStaticText(sbSizerExtProperties->GetStaticBox(),
523 wxID_ANY, _(
"Color"));
524 gbRRExtProperties->Add(m_staticTextRR4, 0, wxLEFT, 5);
526 wxString rrAlt[] = {_(
"None"), _T(
"1" ), _T(
"2" ), _T(
"3" ),
527 _T(
"4" ), _T(
"5" ), _T(
"6" ), _T(
"7" ),
528 _T(
"8" ), _T(
"9" ), _T(
"10" )};
529 m_ChoiceWaypointRangeRingsNumber =
530 new wxChoice(sbSizerExtProperties->GetStaticBox(), ID_WPT_RANGERINGS_NO,
531 wxDefaultPosition, wxDefaultSize, 11, rrAlt);
533 gbRRExtProperties->Add(m_ChoiceWaypointRangeRingsNumber, 0, wxALL | wxEXPAND,
535 m_textWaypointRangeRingsStep =
536 new wxTextCtrl(sbSizerExtProperties->GetStaticBox(), wxID_ANY, _(
"0.05"),
537 wxDefaultPosition, wxDefaultSize, 0);
538 gbRRExtProperties->Add(m_textWaypointRangeRingsStep, 0, wxALL | wxEXPAND, 5);
540 wxString pDistUnitsStrings[] = {_(
"NMi"), _(
"km")};
542 new wxChoice(sbSizerExtProperties->GetStaticBox(), wxID_ANY,
543 wxDefaultPosition, wxDefaultSize, 2, pDistUnitsStrings);
544 gbRRExtProperties->Add(m_RangeRingUnits, 0, wxALIGN_CENTRE_VERTICAL, 0);
546 m_PickColor =
new wxColourPickerCtrl(sbSizerExtProperties->GetStaticBox(),
547 wxID_ANY, wxColour(0, 0, 0),
548 wxDefaultPosition, wxDefaultSize, 0);
549 gbRRExtProperties->Add(m_PickColor, 0, wxALL | wxEXPAND, 5);
550 sbRangeRingsExtProperties->Add(
551 gbRRExtProperties, 1,
552 wxLEFT | wxTOP | wxEXPAND | wxALIGN_LEFT | wxALIGN_TOP, 5);
554 sbSizerExtProperties->GetStaticBox()->Layout();
556 wxFlexGridSizer* gbSizerInnerExtProperties2 =
new wxFlexGridSizer(2, 0, 0);
557 gbSizerInnerExtProperties2->AddGrowableCol(1);
560 new wxStaticText(sbSizerExtProperties->GetStaticBox(), wxID_ANY,
561 _(
"GUID"), wxDefaultPosition, wxDefaultSize, 0);
562 gbSizerInnerExtProperties2->Add(m_staticTextGuid, 0, wxALIGN_CENTRE_VERTICAL,
564 m_textCtrlGuid =
new wxTextCtrl(sbSizerExtProperties->GetStaticBox(),
565 wxID_ANY, wxEmptyString, wxDefaultPosition,
566 wxDefaultSize, wxTE_READONLY);
567 m_textCtrlGuid->SetEditable(
false);
568 gbSizerInnerExtProperties2->Add(m_textCtrlGuid, 0, wxALL | wxEXPAND, 5);
570 wxFlexGridSizer* gbSizerInnerExtProperties1 =
new wxFlexGridSizer(3, 0, 0);
571 gbSizerInnerExtProperties1->AddGrowableCol(1);
573 m_staticTextTideStation =
574 new wxStaticText(sbSizerExtProperties->GetStaticBox(), wxID_ANY,
575 _(
"Tide Station"), wxDefaultPosition, wxDefaultSize, 0);
576 gbSizerInnerExtProperties1->Add(m_staticTextTideStation, 0,
577 wxALIGN_CENTRE_VERTICAL, 5);
580 m_choiceTideChoices.Add(_T(
" "));
581 m_comboBoxTideStation =
582 new wxChoice(sbSizerExtProperties->GetStaticBox(), wxID_ANY,
583 wxDefaultPosition, wxDefaultSize, m_choiceTideChoices);
585 gbSizerInnerExtProperties1->Add(
586 m_comboBoxTideStation, 0, wxALL | wxEXPAND | wxALIGN_CENTRE_VERTICAL, 5);
589 m_comboBoxTideStation =
new wxComboBox(
590 sbSizerExtProperties->GetStaticBox(), wxID_ANY, wxEmptyString,
591 wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY);
592 gbSizerInnerExtProperties1->Add(
593 m_comboBoxTideStation, 0, wxALL | wxEXPAND | wxALIGN_CENTRE_VERTICAL, 5);
596 m_buttonShowTides =
new wxBitmapButton(
597 sbSizerExtProperties->GetStaticBox(), ID_BTN_SHOW_TIDES, m_bmTide,
598 wxDefaultPosition, m_bmTide.GetSize(), 0);
599 gbSizerInnerExtProperties1->Add(m_buttonShowTides, 0,
600 wxALL | wxALIGN_CENTRE_VERTICAL, 5);
602 m_staticTextArrivalRadius =
new wxStaticText(
603 sbSizerExtProperties->GetStaticBox(), wxID_ANY, _(
"Arrival Radius"));
604 gbSizerInnerExtProperties1->Add(m_staticTextArrivalRadius, 0,
605 wxALIGN_CENTRE_VERTICAL, 0);
606 m_textArrivalRadius =
607 new wxTextCtrl(sbSizerExtProperties->GetStaticBox(), wxID_ANY,
608 wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
609 gbSizerInnerExtProperties1->Add(m_textArrivalRadius, 0, wxALL | wxEXPAND, 5);
610 m_staticTextArrivalUnits =
611 new wxStaticText(sbSizerExtProperties->GetStaticBox(), wxID_ANY,
612 wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
613 gbSizerInnerExtProperties1->Add(m_staticTextArrivalUnits, 0,
614 wxALIGN_CENTRE_VERTICAL, 0);
616 m_staticTextPlSpeed =
617 new wxStaticText(sbSizerExtProperties->GetStaticBox(), wxID_ANY,
618 _(
"Planned Speed"), wxDefaultPosition, wxDefaultSize, 0);
619 gbSizerInnerExtProperties1->Add(m_staticTextPlSpeed, 0,
620 wxALIGN_CENTRE_VERTICAL, 0);
622 new wxTextCtrl(sbSizerExtProperties->GetStaticBox(), wxID_ANY,
623 wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
624 gbSizerInnerExtProperties1->Add(m_textCtrlPlSpeed, 0, wxALL | wxEXPAND, 5);
625 m_staticTextPlSpeedUnits =
626 new wxStaticText(sbSizerExtProperties->GetStaticBox(), wxID_ANY,
627 getUsrSpeedUnit(), wxDefaultPosition, wxDefaultSize, 0);
628 gbSizerInnerExtProperties1->Add(m_staticTextPlSpeedUnits, 0,
629 wxALIGN_CENTRE_VERTICAL, 0);
631 m_staticTextEta =
new wxStaticText(sbSizerExtProperties->GetStaticBox(),
632 wxID_ANY, _(
"ETD (UTC)"));
633 gbSizerInnerExtProperties1->Add(m_staticTextEta, 0, wxALIGN_CENTRE_VERTICAL,
635 wxBoxSizer* bsTimestamp =
new wxBoxSizer(wxHORIZONTAL);
636 m_cbEtaPresent =
new wxCheckBox(sbSizerExtProperties->GetStaticBox(),
637 wxID_ANY, wxEmptyString);
638 bsTimestamp->Add(m_cbEtaPresent, 0, wxALL | wxEXPAND, 5);
639 m_EtaDatePickerCtrl =
new wxDatePickerCtrl(
640 sbSizerExtProperties->GetStaticBox(), ID_ETA_DATEPICKERCTRL,
641 wxDefaultDateTime, wxDefaultPosition, wxDefaultSize, wxDP_DEFAULT,
643 bsTimestamp->Add(m_EtaDatePickerCtrl, 0, wxALL | wxEXPAND, 5);
646 m_EtaTimePickerCtrl =
647 new TimeCtrl(sbSizerExtProperties->GetStaticBox(), ID_ETA_TIMEPICKERCTRL,
648 wxDefaultDateTime, wxDefaultPosition, wxDefaultSize);
650 m_EtaTimePickerCtrl =
new wxTimePickerCtrl(
651 sbSizerExtProperties->GetStaticBox(), ID_ETA_TIMEPICKERCTRL,
652 wxDefaultDateTime, wxDefaultPosition, wxDefaultSize, wxDP_DEFAULT,
656 bsTimestamp->Add(m_EtaTimePickerCtrl, 0, wxALL | wxEXPAND, 5);
657 gbSizerInnerExtProperties1->Add(bsTimestamp, 0, wxEXPAND, 0);
658 sbSizerExtProperties->Add(gbSizerInnerExtProperties, 0, wxALL | wxEXPAND, 5);
659 sbSizerExtProperties->Add(sbRangeRingsExtProperties, 0, wxALL | wxEXPAND, 5);
660 sbSizerExtProperties->Add(gbSizerInnerExtProperties2, 0, wxALL | wxEXPAND, 5);
661 sbSizerExtProperties->Add(gbSizerInnerExtProperties1, 0, wxALL | wxEXPAND, 5);
663 fSizerExtProperties->Add(sbSizerExtProperties, 1, wxALL | wxEXPAND);
666 bSizer1->Add(m_notebookProperties, 1, wxEXPAND);
668 wxBoxSizer* btnSizer =
new wxBoxSizer(wxHORIZONTAL);
669 bSizer1->Add(btnSizer, 0, wxEXPAND, 0);
672 new wxBitmapButton(
this, ID_DEFAULT, _img_MUI_settings_svg,
673 wxDefaultPosition, _img_MUI_settings_svg.GetSize(), 0);
674 btnSizer->Add(DefaultsBtn, 0, wxALL | wxALIGN_LEFT | wxALIGN_BOTTOM, 5);
675 btnSizer->Add(0, 0, 1, wxEXPAND);
677 m_sdbSizerButtons =
new wxStdDialogButtonSizer();
678 m_buttonOkay =
new wxButton(
this, wxID_OK);
679 m_sdbSizerButtons->AddButton(m_buttonOkay);
680 m_sdbSizerButtons->AddButton(
new wxButton(
this, wxID_CANCEL, _(
"Cancel")));
681 m_sdbSizerButtons->Realize();
682 btnSizer->Add(m_sdbSizerButtons, 0, wxALL, 5);
687 m_textLatitude->Connect(
689 wxCommandEventHandler(MarkInfoDlg::OnRightClickLatLon), NULL,
this);
690 m_textLongitude->Connect(
692 wxCommandEventHandler(MarkInfoDlg::OnRightClickLatLon), NULL,
this);
694 m_htmlList->Connect(wxEVT_RIGHT_DOWN,
695 wxMouseEventHandler(MarkInfoDlg::m_htmlListContextMenu),
699 m_notebookProperties->Connect(
700 wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED,
701 wxNotebookEventHandler(MarkInfoDlg::OnNotebookPageChanged), NULL,
this);
706 m_comboBoxTideStation->Connect(
707 wxEVT_COMMAND_COMBOBOX_SELECTED,
708 wxCommandEventHandler(MarkInfoDlg::OnTideStationCombobox), NULL,
this);
711void MarkInfoDlg::OnClose(wxCloseEvent& event) {
714 if (m_pRoutePoint) m_pRoutePoint->m_bRPIsBeingEdited =
false;
717#define TIDESTATION_BATCH_SIZE 10
719void MarkInfoDlg::OnTideStationCombobox(wxCommandEvent& event) {
720 int count = m_comboBoxTideStation->GetCount();
721 int sel = m_comboBoxTideStation->GetSelection();
722 if (sel == count - 1) {
725 for (
auto ts : m_tss) {
726 if (i == count + TIDESTATION_BATCH_SIZE) {
730 n = wxString::FromUTF8(ts.second->IDX_station_name);
731 m_comboBoxTideStation->Append(n);
738void MarkInfoDlg::OnNotebookPageChanged(wxNotebookEvent& event) {
739 if (event.GetSelection() == EXTENDED_PROP_PAGE) {
740 if (m_lasttspos.IsSameAs(m_textLatitude->GetValue() +
741 m_textLongitude->GetValue())) {
744 m_lasttspos = m_textLatitude->GetValue() + m_textLongitude->GetValue();
745 double lat = fromDMM(m_textLatitude->GetValue());
746 double lon = fromDMM(m_textLongitude->GetValue());
747 m_tss = ptcmgr->GetStationsForLL(lat, lon);
748 wxString s = m_comboBoxTideStation->GetStringSelection();
751 m_comboBoxTideStation->Clear();
752 m_comboBoxTideStation->Append(wxEmptyString);
753 for (
auto ts : m_tss) {
754 if (i == TIDESTATION_BATCH_SIZE) {
758 n = wxString::FromUTF8(ts.second->IDX_station_name);
759 m_comboBoxTideStation->Append(n);
761 m_comboBoxTideStation->SetSelection(i);
764 if (m_comboBoxTideStation->GetStringSelection() != s) {
765 m_comboBoxTideStation->Insert(s, 1);
766 m_comboBoxTideStation->SetSelection(1);
771void MarkInfoDlg::RecalculateSize(
void) {
776 wxSize dsize = GetParent()->GetClientSize();
780 esize.x = GetCharHeight() * 20;
781 esize.y = GetCharHeight() * 40;
784 esize.y = wxMin(esize.y, dsize.y - (2 * GetCharHeight()));
785 esize.x = wxMin(esize.x, dsize.x - (1 * GetCharHeight()));
786 SetSize(wxSize(esize.x, esize.y));
789 wxSize fsize = GetSize();
790 fsize.y = wxMin(fsize.y, dsize.y - (2 * GetCharHeight()));
791 fsize.x = wxMin(fsize.x, dsize.x - (1 * GetCharHeight()));
795 fsize.y = wxMin(fsize.y, (25 * GetCharHeight()));
797 SetSize(wxSize(-1, fsize.y));
799 m_defaultClientSize = GetClientSize();
802 wxSize dsize = GetParent()->GetClientSize();
803 SetSize(-1, wxMax(GetSize().y, dsize.y / 1.5));
807MarkInfoDlg::~MarkInfoDlg() {
809 m_textLatitude->Disconnect(
811 wxCommandEventHandler(MarkInfoDlg::OnRightClickLatLon), NULL,
this);
812 m_textLongitude->Disconnect(
814 wxCommandEventHandler(MarkInfoDlg::OnRightClickLatLon), NULL,
this);
816 m_htmlList->Disconnect(
817 wxEVT_RIGHT_DOWN, wxMouseEventHandler(MarkInfoDlg::m_htmlListContextMenu),
822 m_notebookProperties->Disconnect(
823 wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED,
824 wxNotebookEventHandler(MarkInfoDlg::OnNotebookPageChanged), NULL,
this);
825 m_EtaTimePickerCtrl->Disconnect(
826 wxEVT_TIME_CHANGED, wxDateEventHandler(MarkInfoDlg::OnTimeChanged), NULL,
828 m_EtaDatePickerCtrl->Disconnect(
829 wxEVT_DATE_CHANGED, wxDateEventHandler(MarkInfoDlg::OnTimeChanged), NULL,
833 androidEnableBackButton(
true);
837void MarkInfoDlg::InitialFocus(
void) {
838 m_textName->SetFocus();
839 m_textName->SetInsertionPointEnd();
842void MarkInfoDlg::SetColorScheme(ColorScheme cs) { DimeControl(
this); }
844void MarkInfoDlg::ClearData() {
845 m_pRoutePoint = NULL;
849void MarkInfoDlg::SetRoutePoint(
RoutePoint* pRP) {
852 m_lat_save = m_pRoutePoint->m_lat;
853 m_lon_save = m_pRoutePoint->m_lon;
854 m_IconName_save = m_pRoutePoint->GetIconName();
855 m_bShowName_save = m_pRoutePoint->m_bShowName;
856 m_bIsVisible_save = m_pRoutePoint->m_bIsVisible;
857 m_Name_save = m_pRoutePoint->GetName();
858 m_Description_save = m_pRoutePoint->m_MarkDescription;
859 m_bUseScaMin_save = m_pRoutePoint->GetUseSca();
860 m_iScaminVal_save = m_pRoutePoint->GetScaMin();
862 if (m_pMyLinkList)
delete m_pMyLinkList;
863 m_pMyLinkList =
new HyperlinkList();
864 int NbrOfLinks = m_pRoutePoint->m_HyperlinkList->GetCount();
865 if (NbrOfLinks > 0) {
866 wxHyperlinkListNode* linknode =
867 m_pRoutePoint->m_HyperlinkList->GetFirst();
872 h->DescrText = link->DescrText;
873 h->Link = link->Link;
874 h->LType = link->LType;
876 m_pMyLinkList->Append(h);
878 linknode = linknode->GetNext();
884void MarkInfoDlg::UpdateHtmlList() {
886 GetSimpleBox()->Clear();
887 int NbrOfLinks = m_pRoutePoint->m_HyperlinkList->GetCount();
889 if (NbrOfLinks > 0) {
890 wxHyperlinkListNode* linknode = m_pRoutePoint->m_HyperlinkList->GetFirst();
893 wxString s = wxString::Format(wxT(
"<a href='%s'>%s</a>"), link->Link,
895 GetSimpleBox()->AppendString(s);
896 linknode = linknode->GetNext();
901 wxWindowList kids = m_scrolledWindowLinks->GetChildren();
902 for (
unsigned int i = 0; i < kids.GetCount(); i++) {
903 wxWindowListNode* node = kids.Item(i);
904 wxWindow* win = node->GetData();
906 auto link_win =
dynamic_cast<wxHyperlinkCtrl*
>(win);
908 link_win->Disconnect(
909 wxEVT_COMMAND_HYPERLINK,
910 wxHyperlinkEventHandler(MarkInfoDlg::OnHyperLinkClick));
911 link_win->Disconnect(
913 wxMouseEventHandler(MarkInfoDlg::m_htmlListContextMenu));
918 int NbrOfLinks = m_pRoutePoint->m_HyperlinkList->GetCount();
919 HyperlinkList* hyperlinklist = m_pRoutePoint->m_HyperlinkList;
920 if (NbrOfLinks > 0) {
921 wxHyperlinkListNode* linknode = hyperlinklist->GetFirst();
924 wxString Link = link->Link;
925 wxString Descr = link->DescrText;
927 wxHyperlinkCtrl* ctrl =
new wxHyperlinkCtrl(
928 m_scrolledWindowLinks, wxID_ANY, Descr, Link, wxDefaultPosition,
929 wxDefaultSize, wxNO_BORDER | wxHL_CONTEXTMENU | wxHL_ALIGN_LEFT);
930 ctrl->Connect(wxEVT_COMMAND_HYPERLINK,
931 wxHyperlinkEventHandler(MarkInfoDlg::OnHyperLinkClick),
933 if (!m_pRoutePoint->m_bIsInLayer)
934 ctrl->Connect(wxEVT_RIGHT_DOWN,
935 wxMouseEventHandler(MarkInfoDlg::m_htmlListContextMenu),
938 bSizerLinks->Add(ctrl, 1, wxALL | wxEXPAND, 5);
940 linknode = linknode->GetNext();
945 m_scrolledWindowLinks->Layout();
949void MarkInfoDlg::OnHyperLinkClick(wxHyperlinkEvent& event) {
950 wxString url =
event.GetURL();
951 url.Replace(_T(
" "), _T(
"%20"));
952 if (g_Platform) g_Platform->platformLaunchDefaultBrowser(url);
955void MarkInfoDlg::OnHtmlLinkClicked(wxHtmlLinkEvent& event) {
965 wxString cc =
event.GetLinkInfo().GetHref().c_str();
966 if (cc.Find(_T(
"#")) != wxNOT_FOUND) {
968 wxString(_T(
"HKEY_CLASSES_ROOT\\HTTP\\shell\\open\\command")));
969 if (RegKey.Exists()) {
970 wxString command_line;
971 RegKey.QueryValue(wxString(_T(
"")), command_line);
974 command_line.Replace(wxString(_T(
"\"")), wxString(_T(
"")));
977 int l = command_line.Find(_T(
".exe"));
978 if (wxNOT_FOUND == l) l = command_line.Find(_T(
".EXE"));
980 if (wxNOT_FOUND != l) {
981 wxString cl = command_line.Mid(0, l + 4);
983 cc.Prepend(_T(
"\""));
990 wxString url =
event.GetLinkInfo().GetHref().c_str();
991 url.Replace(_T(
" "), _T(
"%20"));
992 ::wxLaunchDefaultBrowser(url);
996 wxString url =
event.GetLinkInfo().GetHref().c_str();
997 url.Replace(_T(
" "), _T(
"%20"));
998 if (g_Platform) g_Platform->platformLaunchDefaultBrowser(url);
1004void MarkInfoDlg::OnLayoutResize(wxCommandEvent& event) {
1005 m_panelBasicProperties->Layout();
1009void MarkInfoDlg::OnDescChangedExt(wxCommandEvent& event) {
1010 if (m_panelDescription->IsShownOnScreen()) {
1011 m_textDescription->ChangeValue(m_textCtrlExtDescription->GetValue());
1015void MarkInfoDlg::OnDescChangedBasic(wxCommandEvent& event) {
1016 if (m_panelBasicProperties->IsShownOnScreen()) {
1017 m_textCtrlExtDescription->ChangeValue(m_textDescription->GetValue());
1022void MarkInfoDlg::OnExtDescriptionClick(wxCommandEvent& event) {
1023 long pos = m_textDescription->GetInsertionPoint();
1024 m_notebookProperties->SetSelection(1);
1025 m_textCtrlExtDescription->SetInsertionPoint(pos);
1029void MarkInfoDlg::OnShowWaypointNameSelectBasic(wxCommandEvent& event) {
1030 m_checkBoxShowNameExt->SetValue(m_checkBoxShowName->GetValue());
1033void MarkInfoDlg::OnShowWaypointNameSelectExt(wxCommandEvent& event) {
1034 m_checkBoxShowName->SetValue(m_checkBoxShowNameExt->GetValue());
1038void MarkInfoDlg::OnWptRangeRingsNoChange(wxCommandEvent& event) {
1039 if (!m_pRoutePoint->m_bIsInLayer) {
1040 m_textWaypointRangeRingsStep->Enable(
1041 (
bool)(m_ChoiceWaypointRangeRingsNumber->GetSelection() != 0));
1042 m_PickColor->Enable(
1043 (
bool)(m_ChoiceWaypointRangeRingsNumber->GetSelection() != 0));
1047void MarkInfoDlg::OnSelectScaMinExt(wxCommandEvent& event) {
1048 if (!m_pRoutePoint->m_bIsInLayer) {
1049 m_textScaMin->Enable(m_checkBoxScaMin->GetValue());
1053void MarkInfoDlg::OnPositionCtlUpdated(wxCommandEvent& event) {
1055 double lat = fromDMM(m_textLatitude->GetValue());
1056 double lon = fromDMM(m_textLongitude->GetValue());
1057 if (!m_pRoutePoint->m_bIsInLayer) {
1058 m_pRoutePoint->SetPosition(lat, lon);
1059 pSelect->ModifySelectablePoint(lat, lon, (
void*)m_pRoutePoint,
1060 SELTYPE_ROUTEPOINT);
1063 gFrame->RefreshAllCanvas();
1066void MarkInfoDlg::m_htmlListContextMenu(wxMouseEvent& event) {
1070 wxPoint pos =
event.GetPosition();
1071 i_htmlList_item = -1;
1072 for (
int i = 0; i < (int)GetSimpleBox()->GetCount(); i++) {
1073 wxRect rect = GetSimpleBox()->GetItemRect(i);
1074 if (rect.Contains(pos)) {
1075 i_htmlList_item = i;
1080 wxMenu* popup =
new wxMenu();
1081 if ((GetSimpleBox()->GetCount()) > 0 && (i_htmlList_item > -1) &&
1082 (i_htmlList_item < (
int)GetSimpleBox()->GetCount())) {
1083 popup->Append(ID_RCLK_MENU_DELETE_LINK, _(
"Delete"));
1084 popup->Append(ID_RCLK_MENU_EDIT_LINK, _(
"Edit"));
1086 popup->Append(ID_RCLK_MENU_ADD_LINK, _(
"Add New"));
1088 m_contextObject =
event.GetEventObject();
1090 wxEVT_COMMAND_MENU_SELECTED,
1091 wxCommandEventHandler(MarkInfoDlg::On_html_link_popupmenu_Click), NULL,
1097 m_pEditedLink =
dynamic_cast<wxHyperlinkCtrl*
>(
event.GetEventObject());
1099 if (m_pEditedLink) {
1100 wxString url = m_pEditedLink->GetURL();
1101 wxString label = m_pEditedLink->GetLabel();
1102 i_htmlList_item = -1;
1103 HyperlinkList* hyperlinklist = m_pRoutePoint->m_HyperlinkList;
1104 if (hyperlinklist->GetCount() > 0) {
1106 wxHyperlinkListNode* linknode = hyperlinklist->GetFirst();
1109 if (link->DescrText == label) {
1110 i_htmlList_item = i;
1114 linknode = linknode->GetNext();
1121 wxMenu* popup =
new wxMenu();
1123 wxMenuItem* menuItemDelete =
1124 new wxMenuItem(popup, ID_RCLK_MENU_DELETE_LINK, wxString(_(
"Delete")),
1125 wxEmptyString, wxITEM_NORMAL);
1127 menuItemDelete->SetFont(sFont);
1129 popup->Append(menuItemDelete);
1131 wxMenuItem* menuItemEdit =
1132 new wxMenuItem(popup, ID_RCLK_MENU_EDIT_LINK, wxString(_(
"Edit")),
1133 wxEmptyString, wxITEM_NORMAL);
1135 menuItemEdit->SetFont(sFont);
1137 popup->Append(menuItemEdit);
1140 wxMenuItem* menuItemAdd =
1141 new wxMenuItem(popup, ID_RCLK_MENU_ADD_LINK, wxString(_(
"Add New")),
1142 wxEmptyString, wxITEM_NORMAL);
1144 menuItemAdd->SetFont(sFont);
1146 popup->Append(menuItemAdd);
1148 m_contextObject =
event.GetEventObject();
1150 wxEVT_COMMAND_MENU_SELECTED,
1151 wxCommandEventHandler(MarkInfoDlg::On_html_link_popupmenu_Click), NULL,
1153 wxPoint p = m_scrolledWindowLinks->GetPosition();
1154 p.x += m_scrolledWindowLinks->GetSize().x / 2;
1155 PopupMenu(popup, p);
1178void MarkInfoDlg::OnAddLink(wxCommandEvent& event) {
1179 wxCommandEvent evt(wxEVT_COMMAND_MENU_SELECTED);
1180 evt.SetId(ID_RCLK_MENU_ADD_LINK);
1182 On_html_link_popupmenu_Click(evt);
1185void MarkInfoDlg::On_html_link_popupmenu_Click(wxCommandEvent& event) {
1186 switch (event.GetId()) {
1187 case ID_RCLK_MENU_DELETE_LINK: {
1188 wxHyperlinkListNode* node =
1189 m_pRoutePoint->m_HyperlinkList->Item(i_htmlList_item);
1190 m_pRoutePoint->m_HyperlinkList->DeleteNode(node);
1194 case ID_RCLK_MENU_EDIT_LINK: {
1196 m_pRoutePoint->m_HyperlinkList->Item(i_htmlList_item)->GetData();
1198 LinkPropDlg->m_textCtrlLinkDescription->SetValue(link->DescrText);
1199 LinkPropDlg->m_textCtrlLinkUrl->SetValue(link->Link);
1200 DimeControl(LinkPropDlg);
1201 LinkPropDlg->ShowWindowModalThenDo([
this, LinkPropDlg,
1202 link](
int retcode) {
1203 if (retcode == wxID_OK) {
1204 link->DescrText = LinkPropDlg->m_textCtrlLinkDescription->GetValue();
1205 link->Link = LinkPropDlg->m_textCtrlLinkUrl->GetValue();
1206 m_pRoutePoint->m_HyperlinkList->Item(i_htmlList_item)->SetData(link);
1212 case ID_RCLK_MENU_ADD_LINK: {
1214 LinkPropDlg->m_textCtrlLinkDescription->SetValue(wxEmptyString);
1215 LinkPropDlg->m_textCtrlLinkUrl->SetValue(wxEmptyString);
1216 DimeControl(LinkPropDlg);
1217 LinkPropDlg->ShowWindowModalThenDo([
this, LinkPropDlg](
int retcode) {
1218 if (retcode == wxID_OK) {
1220 link->DescrText = LinkPropDlg->m_textCtrlLinkDescription->GetValue();
1221 link->Link = LinkPropDlg->m_textCtrlLinkUrl->GetValue();
1223 if (link->DescrText == wxEmptyString) {
1224 link->DescrText = link->Link;
1226 if (link->Link == wxEmptyString) {
1229 m_pRoutePoint->m_HyperlinkList->Append(link);
1240void MarkInfoDlg::OnRightClickLatLon(wxCommandEvent& event) {
1241 wxMenu* popup =
new wxMenu();
1242 popup->Append(ID_RCLK_MENU_COPY, _(
"Copy"));
1243 popup->Append(ID_RCLK_MENU_COPY_LL, _(
"Copy lat/long"));
1244 popup->Append(ID_RCLK_MENU_PASTE, _(
"Paste"));
1245 popup->Append(ID_RCLK_MENU_PASTE_LL, _(
"Paste lat/long"));
1246 m_contextObject =
event.GetEventObject();
1247 popup->Connect(wxEVT_COMMAND_MENU_SELECTED,
1248 wxCommandEventHandler(MarkInfoDlg::OnCopyPasteLatLon), NULL,
1255void MarkInfoDlg::OnCopyPasteLatLon(wxCommandEvent& event) {
1257 double lat = fromDMM(m_textLatitude->GetValue());
1258 double lon = fromDMM(m_textLongitude->GetValue());
1262 switch (event.GetId()) {
1263 case ID_RCLK_MENU_PASTE: {
1264 if (wxTheClipboard->Open()) {
1265 wxTextDataObject data;
1266 wxTheClipboard->GetData(data);
1267 result = data.GetText();
1268 ((wxTextCtrl*)m_contextObject)->SetValue(result);
1269 wxTheClipboard->Close();
1273 case ID_RCLK_MENU_PASTE_LL: {
1274 if (wxTheClipboard->Open()) {
1275 wxTextDataObject data;
1276 wxTheClipboard->GetData(data);
1277 result = data.GetText();
1281 if (pparse.IsOk()) {
1282 m_textLatitude->SetValue(pparse.GetLatitudeString());
1283 m_textLongitude->SetValue(pparse.GetLongitudeString());
1285 wxTheClipboard->Close();
1289 case ID_RCLK_MENU_COPY: {
1290 result = ((wxTextCtrl*)m_contextObject)->GetValue();
1293 case ID_RCLK_MENU_COPY_LL: {
1294 result << toSDMM(1, lat,
true) << _T(
'\t');
1295 result << toSDMM(2, lon,
true);
1300 if (wxTheClipboard->Open()) {
1301 wxTextDataObject* data =
new wxTextDataObject;
1302 data->SetText(result);
1303 wxTheClipboard->SetData(data);
1304 wxTheClipboard->Close();
1308void MarkInfoDlg::DefautlBtnClicked(wxCommandEvent& event) {
1310 m_SaveDefaultDlg->Center();
1311 DimeControl(m_SaveDefaultDlg);
1312 int retcode = m_SaveDefaultDlg->ShowModal();
1315 if (retcode == wxID_OK) {
1317 if (m_SaveDefaultDlg->IconCB->GetValue()) {
1319 *pWayPointMan->GetIconKey(m_bcomboBoxIcon->GetSelection());
1321 if (m_SaveDefaultDlg->RangRingsCB->GetValue()) {
1322 g_iWaypointRangeRingsNumber =
1323 m_ChoiceWaypointRangeRingsNumber->GetSelection();
1324 if (m_textWaypointRangeRingsStep->GetValue().ToDouble(&value))
1325 g_fWaypointRangeRingsStep = fromUsrDistance(value, -1);
1326 g_colourWaypointRangeRingsColour = m_PickColor->GetColour();
1328 if (m_SaveDefaultDlg->ArrivalRCB->GetValue())
1329 if (m_textArrivalRadius->GetValue().ToDouble(&value))
1330 g_n_arrival_circle_radius = fromUsrDistance(value, -1);
1331 if (m_SaveDefaultDlg->ScaleCB->GetValue()) {
1332 g_iWpt_ScaMin = wxAtoi(m_textScaMin->GetValue());
1333 g_bUseWptScaMin = m_checkBoxScaMin->GetValue();
1335 if (m_SaveDefaultDlg->NameCB->GetValue()) {
1336 g_bShowWptName = m_checkBoxShowName->GetValue();
1339 m_SaveDefaultDlg = NULL;
1343void MarkInfoDlg::OnMarkInfoCancelClick(wxCommandEvent& event) {
1344 if (m_pRoutePoint) {
1345 m_pRoutePoint->SetVisible(m_bIsVisible_save);
1346 m_pRoutePoint->SetNameShown(m_bShowName_save);
1347 m_pRoutePoint->SetPosition(m_lat_save, m_lon_save);
1348 m_pRoutePoint->SetIconName(m_IconName_save);
1349 m_pRoutePoint->ReLoadIcon();
1350 m_pRoutePoint->SetName(m_Name_save);
1351 m_pRoutePoint->m_MarkDescription = m_Description_save;
1352 m_pRoutePoint->SetUseSca(m_bUseScaMin_save);
1353 m_pRoutePoint->SetScaMin(m_iScaminVal_save);
1355 m_pRoutePoint->m_HyperlinkList->Clear();
1357 int NbrOfLinks = m_pMyLinkList->GetCount();
1358 if (NbrOfLinks > 0) {
1359 wxHyperlinkListNode* linknode = m_pMyLinkList->GetFirst();
1363 h->DescrText = link->DescrText;
1364 h->Link = link->Link;
1365 h->LType = link->LType;
1367 m_pRoutePoint->m_HyperlinkList->Append(h);
1369 linknode = linknode->GetNext();
1374 m_lasttspos.Clear();
1381 delete m_pMyLinkList;
1382 m_pMyLinkList = NULL;
1383 SetClientSize(m_defaultClientSize);
1386 androidEnableBackButton(
true);
1392void MarkInfoDlg::OnMarkInfoOKClick(wxCommandEvent& event) {
1393 if (m_pRoutePoint) {
1394 m_pRoutePoint->m_wxcWaypointRangeRingsColour = m_PickColor->GetColour();
1396 OnPositionCtlUpdated(event);
1406 if (pRouteManagerDialog && pRouteManagerDialog->IsShown())
1407 pRouteManagerDialog->UpdateWptListCtrl();
1409 if (pRoutePropDialog && pRoutePropDialog->IsShown())
1410 pRoutePropDialog->UpdatePoints();
1412 SetClientSize(m_defaultClientSize);
1415 androidEnableBackButton(
true);
1421bool MarkInfoDlg::UpdateProperties(
bool positionOnly) {
1422 if (m_pRoutePoint) {
1423 m_textLatitude->SetValue(::toSDMM(1, m_pRoutePoint->m_lat));
1424 m_textLongitude->SetValue(::toSDMM(2, m_pRoutePoint->m_lon));
1425 m_lat_save = m_pRoutePoint->m_lat;
1426 m_lon_save = m_pRoutePoint->m_lon;
1427 m_textName->SetValue(m_pRoutePoint->GetName());
1428 m_textDescription->ChangeValue(m_pRoutePoint->m_MarkDescription);
1429 m_textCtrlExtDescription->ChangeValue(m_pRoutePoint->m_MarkDescription);
1430 m_checkBoxShowName->SetValue(m_pRoutePoint->m_bShowName);
1431 m_checkBoxShowNameExt->SetValue(m_pRoutePoint->m_bShowName);
1432 m_checkBoxVisible->SetValue(m_pRoutePoint->m_bIsVisible);
1433 m_checkBoxScaMin->SetValue(m_pRoutePoint->GetUseSca());
1434 m_textScaMin->SetValue(
1435 wxString::Format(wxT(
"%i"), (
int)m_pRoutePoint->GetScaMin()));
1436 m_textCtrlGuid->SetValue(m_pRoutePoint->m_GUID);
1437 m_ChoiceWaypointRangeRingsNumber->SetSelection(
1438 m_pRoutePoint->GetWaypointRangeRingsNumber());
1440 buf.Printf(_T(
"%.3f"),
1441 toUsrDistance(m_pRoutePoint->GetWaypointRangeRingsStep(), -1));
1442 m_textWaypointRangeRingsStep->SetValue(buf);
1443 m_staticTextArrivalUnits->SetLabel(getUsrDistanceUnit());
1444 buf.Printf(_T(
"%.3f"),
1445 toUsrDistance(m_pRoutePoint->GetWaypointArrivalRadius(), -1));
1446 m_textArrivalRadius->SetValue(buf);
1448 int nUnits = m_pRoutePoint->GetWaypointRangeRingsStepUnits();
1449 m_RangeRingUnits->SetSelection(nUnits);
1451 wxColour col = m_pRoutePoint->m_wxcWaypointRangeRingsColour;
1452 m_PickColor->SetColour(col);
1454 if (m_pRoutePoint->m_bIsInRoute) {
1455 if (m_name_validator) m_name_validator.reset();
1457 std::make_unique<RoutePointNameValidator>(m_pRoutePoint);
1458 m_textName->SetValidator(*m_name_validator);
1460 m_textName->Bind(wxEVT_KILL_FOCUS, &MarkInfoDlg::OnFocusEvent,
this);
1462 m_textName->SetValidator();
1464 m_textName->Unbind(wxEVT_KILL_FOCUS, &MarkInfoDlg::OnFocusEvent,
this);
1467 if (m_comboBoxTideStation->GetStringSelection() !=
1468 m_pRoutePoint->m_TideStation) {
1469 m_comboBoxTideStation->Clear();
1470 m_comboBoxTideStation->Append(wxEmptyString);
1471 if (!m_pRoutePoint->m_TideStation.IsEmpty()) {
1472 m_comboBoxTideStation->Append(m_pRoutePoint->m_TideStation);
1473 m_comboBoxTideStation->SetSelection(1);
1477 if (m_pRoutePoint->GetPlannedSpeed() > .01) {
1478 m_textCtrlPlSpeed->SetValue(wxString::Format(
1479 "%.1f", toUsrSpeed(m_pRoutePoint->GetPlannedSpeed())));
1481 m_textCtrlPlSpeed->SetValue(wxEmptyString);
1485 etd = m_pRoutePoint->GetManualETD();
1486 if (etd.IsValid()) {
1487 m_cbEtaPresent->SetValue(
true);
1488 m_EtaDatePickerCtrl->SetValue(etd.GetDateOnly());
1489 m_EtaTimePickerCtrl->SetValue(etd);
1491 m_cbEtaPresent->SetValue(
false);
1494 m_staticTextPlSpeed->Show(m_pRoutePoint->m_bIsInRoute);
1495 m_textCtrlPlSpeed->Show(m_pRoutePoint->m_bIsInRoute);
1496 m_staticTextEta->Show(m_pRoutePoint->m_bIsInRoute);
1497 m_EtaDatePickerCtrl->Show(m_pRoutePoint->m_bIsInRoute);
1498 m_EtaTimePickerCtrl->Show(m_pRoutePoint->m_bIsInRoute);
1499 m_cbEtaPresent->Show(m_pRoutePoint->m_bIsInRoute);
1500 m_staticTextPlSpeedUnits->Show(m_pRoutePoint->m_bIsInRoute);
1501 m_staticTextArrivalRadius->Show(m_pRoutePoint->m_bIsInRoute);
1502 m_staticTextArrivalUnits->Show(m_pRoutePoint->m_bIsInRoute);
1503 m_textArrivalRadius->Show(m_pRoutePoint->m_bIsInRoute);
1505 if (positionOnly)
return true;
1508 if (m_pRoutePoint->m_bIsInLayer) {
1509 m_staticTextLayer->Enable();
1510 m_staticTextLayer->Show(
true);
1511 m_textName->SetEditable(
false);
1512 m_textDescription->SetEditable(
false);
1513 m_textCtrlExtDescription->SetEditable(
false);
1514 m_textLatitude->SetEditable(
false);
1515 m_textLongitude->SetEditable(
false);
1516 m_bcomboBoxIcon->Enable(
false);
1517 m_checkBoxShowName->Enable(
false);
1518 m_checkBoxVisible->Enable(
false);
1519 m_textArrivalRadius->SetEditable(
false);
1520 m_checkBoxScaMin->Enable(
false);
1521 m_textScaMin->SetEditable(
false);
1522 m_checkBoxShowNameExt->Enable(
false);
1523 m_ChoiceWaypointRangeRingsNumber->Enable(
false);
1524 m_textWaypointRangeRingsStep->SetEditable(
false);
1525 m_PickColor->Enable(
false);
1526 DefaultsBtn->Enable(
false);
1527 m_EtaDatePickerCtrl->Enable(
false);
1528 m_EtaTimePickerCtrl->Enable(
false);
1529 m_cbEtaPresent->Enable(
false);
1530 m_notebookProperties->SetSelection(0);
1531 m_comboBoxTideStation->Enable(
false);
1533 m_staticTextLayer->Enable(
false);
1534 m_staticTextLayer->Show(
false);
1535 m_textName->SetEditable(
true);
1536 m_textDescription->SetEditable(
true);
1537 m_textCtrlExtDescription->SetEditable(
true);
1538 m_textLatitude->SetEditable(
true);
1539 m_textLongitude->SetEditable(
true);
1540 m_bcomboBoxIcon->Enable(
true);
1541 m_checkBoxShowName->Enable(
true);
1542 m_checkBoxVisible->Enable(
true);
1543 m_textArrivalRadius->SetEditable(
true);
1544 m_checkBoxScaMin->Enable(
true);
1545 m_textScaMin->SetEditable(
true);
1546 m_checkBoxShowNameExt->Enable(
true);
1547 m_ChoiceWaypointRangeRingsNumber->Enable(
true);
1548 m_textWaypointRangeRingsStep->SetEditable(
true);
1549 m_PickColor->Enable(
true);
1550 DefaultsBtn->Enable(
true);
1551 m_EtaDatePickerCtrl->Enable(
true);
1552 m_EtaTimePickerCtrl->Enable(
true);
1553 m_cbEtaPresent->Enable(
true);
1554 m_notebookProperties->SetSelection(0);
1555 m_comboBoxTideStation->Enable(
true);
1559 m_bcomboBoxIcon->Clear();
1561 bool fillCombo = m_bcomboBoxIcon->GetCount() == 0;
1564 for (
int i = 0; i < pWayPointMan->GetNumIcons(); i++) {
1565 wxString* ps = pWayPointMan->GetIconDescription(i);
1567 pWayPointMan->GetIconBitmapForList(i, 2 * GetCharHeight());
1569 m_bcomboBoxIcon->Append(*ps, bmp);
1573 int iconToSelect = -1;
1574 for (
int i = 0; i < pWayPointMan->GetNumIcons(); i++) {
1575 if (*pWayPointMan->GetIconKey(i) == m_pRoutePoint->GetIconName()) {
1577 m_bcomboBoxIcon->Select(iconToSelect);
1582 OnShowWaypointNameSelectBasic(ev);
1583 OnWptRangeRingsNoChange(ev);
1584 OnSelectScaMinExt(ev);
1589 androidEnableBackButton(
false);
1600void MarkInfoDlg::OnFocusEvent(wxFocusEvent& event) {
1601 bool is_valid = Validate();
1602 m_buttonOkay->Enable(is_valid);
1606void MarkInfoDlg::OnBitmapCombClick(wxCommandEvent& event) {
1607 wxString* icon_name =
1608 pWayPointMan->GetIconKey(m_bcomboBoxIcon->GetSelection());
1609 if (icon_name && icon_name->Length()) m_pRoutePoint->SetIconName(*icon_name);
1610 m_pRoutePoint->ReLoadIcon();
1615void MarkInfoDlg::ValidateMark(
void) {
1618 wxRoutePointListNode* node = pWayPointMan->GetWaypointList()->GetFirst();
1620 bool b_found =
false;
1623 if (m_pRoutePoint == rp) {
1627 node = node->GetNext();
1629 if (!b_found) m_pRoutePoint = NULL;
1632bool MarkInfoDlg::SaveChanges() {
1633 if (m_pRoutePoint) {
1634 if (m_pRoutePoint->m_bIsInLayer)
return true;
1635 if (!this->Validate())
return false;
1638 m_pRoutePoint->SetName(m_textName->GetValue());
1639 m_pRoutePoint->SetWaypointArrivalRadius(m_textArrivalRadius->GetValue());
1640 m_pRoutePoint->SetScaMin(m_textScaMin->GetValue());
1641 m_pRoutePoint->SetUseSca(m_checkBoxScaMin->GetValue());
1642 m_pRoutePoint->m_MarkDescription = m_textDescription->GetValue();
1643 m_pRoutePoint->SetVisible(m_checkBoxVisible->GetValue());
1644 m_pRoutePoint->m_bShowName = m_checkBoxShowName->GetValue();
1645 m_pRoutePoint->SetPosition(fromDMM(m_textLatitude->GetValue()),
1646 fromDMM(m_textLongitude->GetValue()));
1647 wxString* icon_name =
1648 pWayPointMan->GetIconKey(m_bcomboBoxIcon->GetSelection());
1649 if (icon_name && icon_name->Length())
1650 m_pRoutePoint->SetIconName(*icon_name);
1651 m_pRoutePoint->ReLoadIcon();
1652 m_pRoutePoint->SetShowWaypointRangeRings(
1653 (
bool)(m_ChoiceWaypointRangeRingsNumber->GetSelection() != 0));
1654 m_pRoutePoint->SetWaypointRangeRingsNumber(
1655 m_ChoiceWaypointRangeRingsNumber->GetSelection());
1657 if (m_textWaypointRangeRingsStep->GetValue().ToDouble(&value))
1658 m_pRoutePoint->SetWaypointRangeRingsStep(fromUsrDistance(value, -1));
1659 if (m_textArrivalRadius->GetValue().ToDouble(&value))
1660 m_pRoutePoint->SetWaypointArrivalRadius(fromUsrDistance(value, -1));
1662 if (m_RangeRingUnits->GetSelection() != wxNOT_FOUND)
1663 m_pRoutePoint->SetWaypointRangeRingsStepUnits(
1664 m_RangeRingUnits->GetSelection());
1666 m_pRoutePoint->m_TideStation = m_comboBoxTideStation->GetStringSelection();
1667 if (m_textCtrlPlSpeed->GetValue() == wxEmptyString) {
1668 m_pRoutePoint->SetPlannedSpeed(0.0);
1671 if (m_textCtrlPlSpeed->GetValue().ToDouble(&spd)) {
1672 m_pRoutePoint->SetPlannedSpeed(fromUsrSpeed(spd));
1676 if (m_cbEtaPresent->GetValue()) {
1677 wxDateTime dt = m_EtaDatePickerCtrl->GetValue();
1678 dt.SetHour(m_EtaTimePickerCtrl->GetValue().GetHour());
1679 dt.SetMinute(m_EtaTimePickerCtrl->GetValue().GetMinute());
1680 dt.SetSecond(m_EtaTimePickerCtrl->GetValue().GetSecond());
1682 m_pRoutePoint->SetETD(dt.FormatISOCombined());
1685 m_pRoutePoint->SetETD(wxEmptyString);
1688 if (m_pRoutePoint->m_bIsInRoute) {
1690 pSelect->UpdateSelectableRouteSegments(m_pRoutePoint);
1693 wxArrayPtrVoid* pEditRouteArray =
1694 g_pRouteMan->GetRouteArrayContaining(m_pRoutePoint);
1696 if (pEditRouteArray) {
1697 for (
unsigned int ir = 0; ir < pEditRouteArray->GetCount(); ir++) {
1698 Route* pr = (
Route*)pEditRouteArray->Item(ir);
1699 pr->FinalizeForRendering();
1700 pr->UpdateSegmentDistances();
1702 pConfig->UpdateRoute(pr);
1704 delete pEditRouteArray;
1707 pConfig->UpdateWayPoint(m_pRoutePoint);
1713SaveDefaultsDialog::SaveDefaultsDialog(
MarkInfoDlg* parent)
1714 : wxDialog(parent, wxID_ANY, _(
"Save some defaults")) {
1716 this->SetSizeHints(wxDefaultSize, wxDefaultSize);
1718 wxBoxSizer* bSizer1 =
new wxBoxSizer(wxVERTICAL);
1719 wxStdDialogButtonSizer* StdDialogButtonSizer1;
1722 new wxStaticText(
this, wxID_ANY,
1723 _(
"Check which properties of current waypoint\n should "
1724 "be set as default for NEW waypoints."));
1725 bSizer1->Add(StaticText1, 0, wxALL | wxALIGN_CENTER_HORIZONTAL, 5);
1727 wxFlexGridSizer* fgSizer1 =
new wxFlexGridSizer(2);
1730 (g_pMarkInfoDialog->m_checkBoxShowName->GetValue() ? _(
"Do use")
1733 new wxCheckBox(
this, wxID_ANY, _(
"Show Waypoint Name"), wxDefaultPosition,
1734 wxDefaultSize, 0, wxDefaultValidator);
1735 fgSizer1->Add(NameCB, 0, wxALL, 5);
1736 stName =
new wxStaticText(
this, wxID_ANY, _T(
"[") + s + _T(
"]"),
1737 wxDefaultPosition, wxDefaultSize, 0);
1739 fgSizer1->Add(stName, 0, wxALL | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL, 5);
1741 s = g_pMarkInfoDialog->m_pRoutePoint->GetIconName();
1742 IconCB =
new wxCheckBox(
this, wxID_ANY, _(
"Icon"));
1743 fgSizer1->Add(IconCB, 0, wxALL, 5);
1744 stIcon =
new wxStaticText(
this, wxID_ANY, _T(
"[") + s + _T(
"]"),
1745 wxDefaultPosition, wxDefaultSize, 0);
1747 fgSizer1->Add(stIcon, 0, wxALL | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL, 5);
1749 s = (g_pMarkInfoDialog->m_ChoiceWaypointRangeRingsNumber->GetSelection()
1753 g_pMarkInfoDialog->m_ChoiceWaypointRangeRingsNumber
1756 RangRingsCB =
new wxCheckBox(
this, wxID_ANY, _(
"Range rings"));
1757 fgSizer1->Add(RangRingsCB, 0, wxALL, 5);
1758 stRR =
new wxStaticText(
this, wxID_ANY, _T(
"[") + s + _T(
"]"),
1759 wxDefaultPosition, wxDefaultSize, 0);
1761 fgSizer1->Add(stRR, 0, wxALL | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL, 5);
1763 s = (g_pMarkInfoDialog->m_textArrivalRadius->GetValue());
1764 ArrivalRCB =
new wxCheckBox(
this, wxID_ANY, _(
"Arrival radius"));
1765 fgSizer1->Add(ArrivalRCB, 0, wxALL, 5);
1766 stArrivalR =
new wxStaticText(
1768 wxString::Format(_T(
"[%s %s]"), s.c_str(), getUsrDistanceUnit().c_str()),
1769 wxDefaultPosition, wxDefaultSize, 0);
1770 stArrivalR->Wrap(-1);
1771 fgSizer1->Add(stArrivalR, 0, wxALL | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL,
1774 s = (g_pMarkInfoDialog->m_checkBoxScaMin->GetValue()
1775 ? _(
"Show only if") + _T(
" < ") +
1776 g_pMarkInfoDialog->m_textScaMin->GetValue()
1777 : _(
"Show always"));
1778 ScaleCB =
new wxCheckBox(
this, wxID_ANY, _(
"Show only at scale"));
1779 fgSizer1->Add(ScaleCB, 0, wxALL, 5);
1780 stScale =
new wxStaticText(
this, wxID_ANY, _T(
"[") + s + _T(
"]"),
1781 wxDefaultPosition, wxDefaultSize, 0);
1783 fgSizer1->Add(stScale, 0, wxALL | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL, 5);
1785 bSizer1->Add(fgSizer1, 0, wxALL | wxEXPAND, 5);
1787 StdDialogButtonSizer1 =
new wxStdDialogButtonSizer();
1788 StdDialogButtonSizer1->AddButton(
new wxButton(
this, wxID_OK));
1789 StdDialogButtonSizer1->AddButton(
1790 new wxButton(
this, wxID_CANCEL, _(
"Cancel")));
1791 StdDialogButtonSizer1->Realize();
1792 bSizer1->Add(StdDialogButtonSizer1, 0, wxALL | wxEXPAND, 5);
1799 SetSize(parent->GetSize());
1805void MarkInfoDlg::ShowTidesBtnClicked(wxCommandEvent& event) {
1806 if (m_comboBoxTideStation->GetSelection() < 1) {
1810 ptcmgr->GetStationIDXbyName(m_comboBoxTideStation->GetStringSelection(),
1811 fromDMM(m_textLatitude->GetValue()),
1812 fromDMM(m_textLongitude->GetValue())));
1814 TCWin* pCwin =
new TCWin(gFrame->GetPrimaryCanvas(), 0, 0, pIDX);
1817 wxString msg(_(
"Tide Station not found"));
1819 msg += m_comboBoxTideStation->GetStringSelection();
1820 OCPNMessageBox(NULL, msg, _(
"OpenCPN Info"), wxOK | wxCENTER, 10);
Represents an index entry for tidal and current data.
Dialog for displaying and editing waypoint properties.
Custom combobox for selecting waypoint icons.
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.
GUI library utils and events.