OpenCPN Partial API docs
Loading...
Searching...
No Matches
options.h
Go to the documentation of this file.
1/**************************************************************************
2 * Copyright (C) 2010 by David S. Register *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, see <https://www.gnu.org/licenses/>. *
16 **************************************************************************/
17
24#ifndef _OPTIONS_H_
25#define _OPTIONS_H_
26
27#ifdef __MINGW32__
28#undef IPV6STRICT // mingw FTBS fix: missing struct ip_mreq
29#include <windows.h>
30#endif
31
32#include <memory>
33#include <vector>
34
35#include <wx/arrimpl.cpp>
36#include <wx/choice.h>
37#include <wx/clrpicker.h>
38#include <wx/collpane.h>
39#include <wx/colourdata.h>
40#include <wx/dialog.h>
41#include <wx/dirctrl.h>
42#include <wx/frame.h>
43#include <wx/listbook.h>
44#include <wx/listctrl.h>
45#include <wx/scrolwin.h>
46#include <wx/spinctrl.h>
47#include <wx/timectrl.h>
48
49#ifdef __WXGTK__
50// wxTimePickerCtrl is completely broken in Gnome based desktop environments as
51// of wxGTK 3.0
52#include "time_textbox.h"
53#endif
54
55#include "model/ais_decoder.h"
56
57#include "chartdbs.h"
58#include "connections_dlg.h"
59#include "mark_info.h"
60#include "navutil.h"
61#include "ocpn_platform.h"
62#include "pluginmanager.h" // FIXME: Refactor
63
64#ifndef __ANDROID__
65#define OCPN_OPTIONS_USE_LISTBOOK
66#endif
67
68#define ID_DIALOG 10001
69#ifdef __WXOSX__
70#define SYMBOL_OPTIONS_STYLE \
71 wxCAPTION | wxRESIZE_BORDER | wxSYSTEM_MENU | wxCLOSE_BOX | wxSTAY_ON_TOP
72#else
73#define SYMBOL_OPTIONS_STYLE \
74 wxCAPTION | wxRESIZE_BORDER | wxSYSTEM_MENU | wxCLOSE_BOX
75#endif
76#define SYMBOL_OPTIONS_TITLE _("Options")
77#define SYMBOL_OPTIONS_IDNAME ID_DIALOG
78#define SYMBOL_OPTIONS_SIZE wxSize(500, 500)
79#define SYMBOL_OPTIONS_POSITION wxDefaultPosition
80
81/* Define an int bit field for dialog return value
82 * to indicate which types of settings have changed */
83#define GENERIC_CHANGED 1
84#define S52_CHANGED 1 << 1
85#define FONT_CHANGED 1 << 2
86#define FORCE_UPDATE 1 << 3
87#define VISIT_CHARTS 1 << 4
88#define LOCALE_CHANGED 1 << 5
89#define TOOLBAR_CHANGED 1 << 6
90#define CHANGE_CHARTS 1 << 7
91#define SCAN_UPDATE 1 << 8
92#define GROUPS_CHANGED 1 << 9
93#define STYLE_CHANGED 1 << 10
94#define TIDES_CHANGED 1 << 11
95#define GL_CHANGED 1 << 12
96#define REBUILD_RASTER_CACHE 1 << 13
97#define NEED_NEW_OPTIONS 1 << 14
98#define PARSE_ENC 1 << 15
99#define CONFIG_CHANGED 1 << 16
100#define FONT_CHANGED_SAFE 1 << 17
101#define FORCE_RELOAD 1 << 18
102
103#ifndef wxCLOSE_BOX
104#define wxCLOSE_BOX 0x1000
105#endif
106#ifndef wxFIXED_MINSIZE
107#define wxFIXED_MINSIZE 0
108#endif
109
110enum {
111 ID_APPLY = 10000,
112 ID_ATONTEXTCHECKBOX,
113 ID_AUTOANCHORMARKBOX1,
114 ID_BELLSCHECKBOX,
115 ID_BUTTONADD,
116 ID_BUTTONDELETE,
117 ID_BUTTONCOMPRESS,
118 ID_BUTTONFONTCHOOSE,
119 ID_BUTTONFONT_RESET,
120 ID_BUTTONECDISHELP,
121 ID_BUTTONFONTCOLOR,
122 ID_BUTTONGROUP,
123 ID_BUTTONREBUILD,
124 ID_BUTTONTCDATA,
125 ID_CHECKLISTBOX,
126 ID_CHECK_DISPLAYGRID,
127 ID_CHECK_LOOKAHEAD,
128 ID_CHOICE_AIS,
129 ID_CHOICE_AP,
130 ID_CHOICE_FONTELEMENT,
131 ID_CHOICE_LANG,
132 ID_CHOICE_NMEA_BAUD,
133 ID_CLEARLIST,
134 ID_CM93CHECKBOX1,
135 ID_CM93ZOOM,
136 ID_COURSEUPCHECKBOX,
137 ID_DAILYCHECKBOX,
138 ID_DEBUGCHECKBOX1,
139 ID_DECLTEXTCHECKBOX,
140 ID_DIRCTRL,
141 ID_DRAGGINGCHECKBOX,
142 ID_FILTERNMEA,
143 ID_FSTOOLBARCHECKBOX,
144 ID_FULLSCREENQUILT,
145 ID_GARMINHOST,
146 ID_RADARRINGS,
147 ID_GRIBCHECKBOX,
148 ID_GROUPAVAILABLE,
149 ID_GROUPDELETEGROUP,
150 ID_GROUPINSERTDIR,
151 ID_GROUPNEWGROUP,
152 ID_GROUPNOTEBOOK,
153 ID_GROUPREMOVEDIR,
154 ID_IMPTEXTCHECKBOX,
155 ID_LDISTEXTCHECKBOX,
156 ID_LISTBOX,
157 ID_METACHECKBOX,
158 ID_NOTEBOOK,
159 ID_OPENGLBOX,
160 ID_OPENGLOPTIONS,
161 ID_SHIPICONTYPE,
162 ID_OUTLINECHECKBOX1,
163 ID_PANEL,
164 ID_PANEL2,
165 ID_PANEL3,
166 ID_PANELADVANCED,
167 ID_PANELAIS,
168 ID_PANELMMSI,
169 ID_PANELFONT,
170 ID_PANELPIM,
171 ID_PRESERVECHECKBOX,
172 ID_PRINTCHECKBOX1,
173 ID_QUILTCHECKBOX1,
174 ID_RADARDISTUNIT,
175 ID_RASTERCHECKBOX1,
176 ID_SCAMINCHECKBOX,
177 ID_SUPERSCAMINCHECKBOX,
178 ID_SCANCHECKBOX,
179 ID_SDMMFORMATCHOICE,
180 ID_DISTANCEUNITSCHOICE,
181 ID_SPEEDUNITSCHOICE,
182 ID_WINDSPEEDUNITCHOICE,
183 ID_DEPTHUNITSCHOICE,
184 ID_HEIGHTUNITSCHOICE,
185 ID_SELECTLIST,
186 ID_SHOWDEPTHUNITSBOX1,
187 ID_SHOWGPSWINDOW,
188 ID_SKEWCOMPBOX,
189 ID_SMOOTHPANZOOMBOX,
190 ID_SOUNDGCHECKBOX,
191 ID_STYLESCOMBOBOX,
192 ID_TCDATAADD,
193 ID_TCDATADEL,
194 ID_TEXTCHECKBOX,
195 ID_OPTEXTCTRL,
196 ID_TIDESELECTED,
197 ID_TRACKCHECKBOX,
198 ID_TRACKHILITE,
199 ID_TRANSTOOLBARCHECKBOX,
200 ID_UPDCHECKBOX,
201 ID_PARSEENCBUTTON,
202 ID_VECTORCHECKBOX1,
203 ID_ZTCCHECKBOX,
204 ID_DELETECHECKBOX,
205 ID_NATIONALTEXTCHECKBOX,
206 ID_TRUESHOWCHECKBOX,
207 ID_MAGSHOWCHECKBOX,
208 ID_MAGAPBCHECKBOX,
209 ID_MOBILEBOX,
210 ID_REPONSIVEBOX,
211 ID_SIZEMANUALRADIOBUTTON,
212 ID_OPWAYPOINTRANGERINGS,
213 xID_OK,
214 ID_BT_SCANTIMER,
215 ID_TRACKROTATETIME,
216 ID_TRACKROTATEUTC,
217 ID_TRACKROTATELMT,
218 ID_TRACKROTATECOMPUTER,
219 ID_SETSTDLIST,
220 ID_VECZOOM,
221 ID_INLANDECDISBOX,
222 ID_ROLLOVERBOX,
223 ID_SOGCOGFROMLLCHECKBOX,
224 ID_SOGCOGDAMPINTTEXTCTRL,
225 // LIVE ETA OPTION
226 ID_CHECK_LIVEETA,
227 ID_DEFAULT_BOAT_SPEED,
228 ID_SCREENCONFIG1,
229 ID_SCREENCONFIG2,
230 ID_CONFIGEDIT_OK,
231 ID_CONFIGEDIT_CANCEL,
232 ID_ZOOMBUTTONS,
233 ID_RASTERZOOM,
234 ID_ANCHORALERTAUDIO,
235 ID_AISALERTAUDIO,
236 ID_AISALERTDIALOG,
237 ID_TEMPUNITSCHOICE,
238 ID_BUTTONMIGRATE,
239 ID_TIMEZONE_UTC,
240 ID_TIMEZONE_LOCAL_TIME,
241 ID_TENHZCHECKBOX
242};
243
244WX_DEFINE_ARRAY_PTR(wxGenericDirCtrl *, ArrayOfDirCtrls);
245
246class options; // forward
247extern options *g_options;
248
249class MyConfig; // circular
250class OCPNColourPickerCtrl; // circular
251class canvasConfig; // circular
252
253class ChartGroupsUI; // forward
254class MMSI_Props_Panel; // forward
255class CanvasConfigSelect; // forward
256class OCPNCheckedListCtrl; // forward in .cpp file
257class OCPNChartDirPanel; // forward in .cpp file
258class OCPNSoundPanel; // forward in .cpp file
259
261protected:
262 Uncopyable(void) {}
263 ~Uncopyable(void) {}
264
265private:
266 Uncopyable(const Uncopyable &);
267 Uncopyable &operator=(const Uncopyable &);
268};
269
270class options : public wxDialog {
271public:
272 explicit options(wxWindow *parent, wxWindowID id = SYMBOL_OPTIONS_IDNAME,
273 const wxString &caption = SYMBOL_OPTIONS_TITLE,
274 const wxPoint &pos = SYMBOL_OPTIONS_POSITION,
275 const wxSize &size = SYMBOL_OPTIONS_SIZE,
276 long style = SYMBOL_OPTIONS_STYLE);
277 options(const options &) = delete;
278 options &operator=(const options &) = delete;
279
280 ~options(void);
281 bool SendIdleEvents(wxIdleEvent &event);
282 void SetInitialPage(int page_sel, int sub_page = -1);
283 void Finish(void);
284
285 void OnClose(wxCloseEvent &event);
286
287 void ShowOKButtons(bool _show) { m_OK_Cancel_Apply_buttons->Show(_show); }
288
289 void CreateListbookIcons();
290 void CreateControls(void);
291 size_t CreatePanel(const wxString &title);
292 wxScrolledWindow *AddPage(size_t parent, const wxString &title);
293 bool DeletePluginPage(wxScrolledWindow *page);
294 void SetColorScheme(ColorScheme cs);
295 void RecalculateSize(int hint_x, int hint_y);
296
297 void SetInitChartDir(const wxString &dir) { m_init_chart_dir = dir; }
298 void SetInitialSettings(void);
299 void SetInitialVectorSettings(void);
300
301 void SetCurrentDirList(ArrayOfCDI p) { m_CurrentDirList = p; }
302 void SetWorkDirListPtr(ArrayOfCDI *p) { m_pWorkDirList = p; }
303 ArrayOfCDI *GetWorkDirListPtr(void) { return m_pWorkDirList; }
304
305 void AddChartDir(const wxString &dir);
306
307 void UpdateDisplayedChartDirList(ArrayOfCDI p);
308 void UpdateOptionsUnits(void);
309
310 void SetConfigPtr(MyConfig *p) { m_pConfig = p; }
311 void OnDebugcheckbox1Click(wxCommandEvent &event);
312 void OnDirctrlSelChanged(wxTreeEvent &event);
313 void OnButtonaddClick(wxCommandEvent &event);
314 void OnButtondeleteClick(wxCommandEvent &event);
315 void OnButtonParseENC(wxCommandEvent &event);
316 void OnButtoncompressClick(wxCommandEvent &event);
317 void OnButtonmigrateClick(wxCommandEvent &event);
318 void OnButtonEcdisHelp(wxCommandEvent &event);
319 void OnRadioboxSelected(wxCommandEvent &event);
320 void OnApplyClick(wxCommandEvent &event);
321 void OnXidOkClick(wxCommandEvent &event);
322 void OnCancelClick(wxCommandEvent &event);
323 void OnChooseFont(wxCommandEvent &event);
324 void OnFontChoice(wxCommandEvent &event);
325 void OnCPAWarnClick(wxCommandEvent &event);
326 void OnSyncCogPredClick(wxCommandEvent &event);
327 void OnSizeAutoButton(wxCommandEvent &event);
328 void OnSizeManualButton(wxCommandEvent &event);
329
330#if defined(__WXGTK__) || defined(__WXQT__)
331 void OnChooseFontColor(wxCommandEvent &event);
332#endif
333 void OnGLClicked(wxCommandEvent &event);
334 void OnOpenGLOptions(wxCommandEvent &event);
335 void OnDisplayCategoryRadioButton(wxCommandEvent &event);
336 void OnButtonClearClick(wxCommandEvent &event);
337 void OnButtonSelectClick(wxCommandEvent &event);
338 void OnButtonSetStd(wxCommandEvent &event);
339
340 void OnPageChange(wxListbookEvent &event);
341 void OnTopNBPageChange(wxNotebookEvent &event);
342 void OnSubNBPageChange(wxNotebookEvent &event);
343 void DoOnPageChange(size_t page);
344
345 wxString SelectSoundFile();
346 void OnButtonSelectSound(wxCommandEvent &event);
347 void OnButtonTestSound(wxCommandEvent &event);
348
349 void OnShowGpsWindowCheckboxClick(wxCommandEvent &event);
350 void OnZTCCheckboxClick(wxCommandEvent &event);
351 void OnRadarringSelect(wxCommandEvent &event);
352 void OnWaypointRangeRingSelect(wxCommandEvent &event);
353 void OnShipTypeSelect(wxCommandEvent &event);
354 void OnButtonGroups(wxCommandEvent &event);
355 void OnInsertTideDataLocation(wxCommandEvent &event);
356 void OnRemoveTideDataLocation(wxCommandEvent &event);
357 void OnCharHook(wxKeyEvent &event);
358 void OnChartsPageChange(wxListbookEvent &event);
359 void OnChartDirListSelect(wxCommandEvent &event);
360 void OnUnitsChoice(wxCommandEvent &event);
361
362 void UpdateWorkArrayFromDisplayPanel(void);
363 ArrayOfCDI GetSelectedChartDirs();
364 ArrayOfCDI GetUnSelectedChartDirs();
365 void SetDirActionButtons();
366
367 void OnCreateConfig(wxCommandEvent &event);
368 void OnEditConfig(wxCommandEvent &event);
369 void OnDeleteConfig(wxCommandEvent &event);
370 void OnApplyConfig(wxCommandEvent &event);
371 void SetConfigButtonState();
372 void ClearConfigList();
373 void BuildConfigList();
374 void OnConfigMouseSelected(wxMouseEvent &event);
375 void OnDialogInit(wxInitDialogEvent &event);
376
377 bool GetNeedNew() { return m_bneedNew; }
378 void SetNeedNew(bool bnew) { m_bneedNew = bnew; }
379 int GetScrollRate() { return m_scrollRate; }
380 void SetForceNewToolbarOnCancel(bool val) {
381 m_bForceNewToolbaronCancel = val;
382 }
383
384 wxArrayString *GetSerialArray() { return m_pSerialArray; }
385
386 // Should we show tooltips?
387 static bool ShowToolTips(void);
388
389#ifdef OCPN_OPTIONS_USE_LISTBOOK
390 wxListbook *m_pListbook;
391#else
392 wxNotebook *m_pListbook;
393#endif
394
395 wxBoxSizer *m_OK_Cancel_Apply_buttons;
396
397 size_t m_pageDisplay, m_pageConnections, m_pageCharts, m_pageShips;
398 size_t m_pageUI, m_pagePlugins;
399 int lastPage, lastSubPage;
400 wxPoint lastWindowPos;
401 wxSize lastWindowSize;
402 wxButton *m_ApplyButton, *m_OKButton, *m_CancelButton;
403
404 ChartGroupArray *m_pGroupArray;
405 int m_groups_changed;
406
407 // Sizer flags
408 wxSizerFlags inputFlags, verticleInputFlags, labelFlags, groupInputFlags;
409 wxSizerFlags groupLabelFlags, groupLabelFlagsHoriz;
410
411 // For general options
412 wxScrolledWindow *pDisplayPanel;
413 wxCheckBox *pShowStatusBar, *pShowMenuBar, *pShowChartBar, *pShowCompassWin;
414 wxCheckBox *pPrintShowIcon, *pCDOOutlines, *pSDepthUnits, *pSDisplayGrid;
415 wxCheckBox *pAutoAnchorMark, *pCDOQuilting, *pCBRaster, *pCBVector;
416 wxCheckBox *pCBCM93, *pCBLookAhead, *pSkewComp, *pOpenGL, *pSmoothPanZoom;
417 wxCheckBox *pFullScreenQuilt, *pMobile, *pResponsive, *pOverzoomEmphasis;
418 wxCheckBox *pOZScaleVector, *pToolbarAutoHideCB, *pInlandEcdis, *pRollover;
419 wxCheckBox *pZoomButtons, *pChartBarEX;
420 wxTextCtrl *pCOGUPUpdateSecs, *m_pText_OSCOG_Predictor, *pScreenMM;
421 wxTextCtrl *pToolbarHideSecs, *m_pText_OSHDT_Predictor, *m_pTxt_OwnMMSI;
422 // Radio buttons to control the date/time format.
423 // In the future, other date/time formats may be added here. For example:
424 // 1. Local Mean Time (LMT) at the location.
425 // 2. Custom timezone, such as for route planning purpose.
426
429 wxRadioButton *pTimezoneLocalTime;
431 wxRadioButton *pTimezoneUTC;
432 wxTextCtrl *pCmdSoundString;
433
434 wxChoice *m_pShipIconType, *m_pcTCDatasets;
435 wxSlider *m_pSlider_Zoom_Raster, *m_pSlider_GUI_Factor,
436 *m_pSlider_Chart_Factor, *m_pSlider_Ship_Factor, *m_pSlider_Text_Factor,
437 *m_pSlider_ENCText_Factor;
438 wxSlider *m_pMouse_Zoom_Slider;
439 wxSlider *m_pSlider_Zoom_Vector;
440 wxSlider *m_pSlider_CM93_Zoom;
441 // LIVE ETA OPTION
442 wxCheckBox *pSLiveETA;
443 wxTextCtrl *pSDefaultBoatSpeed;
444
445 wxRadioButton *pCBCourseUp, *pCBNorthUp, *pRBSizeAuto, *pRBSizeManual;
446 int k_tides;
447
448 // For the Display\Units page
449 wxStaticText *itemStaticTextUserVar;
450 wxStaticText *itemStaticTextUserVar2;
451 wxButton *m_configDeleteButton, *m_configApplyButton;
452
453 void OnAISRolloverClick(wxCommandEvent &event);
454 void UpdateChartDirList();
455
456 void OnCanvasConfigSelectClick(int ID, bool selected);
457
458 bool b_haveWMM;
459 bool b_oldhaveWMM;
460 ColorScheme m_cs;
461
462 // For "S57" page
463 wxBoxSizer *vectorPanel;
464 wxScrolledWindow *ps57Ctl;
465
466 OCPNCheckedListCtrl *ps57CtlListBox;
467
468 wxChoice *pDispCat, *pPointStyle, *pBoundStyle, *p24Color;
469 wxButton *itemButtonClearList, *itemButtonSelectList, *itemButtonSetStd;
470 wxCheckBox *pCheck_SOUNDG, *pCheck_META, *pCheck_SHOWIMPTEXT;
471 wxCheckBox *pCheck_SCAMIN, *pCheck_SuperSCAMIN;
472 wxCheckBox *pCheck_ATONTEXT, *pCheck_LDISTEXT;
473 wxCheckBox *pCheck_XLSECTTEXT, *pCheck_DECLTEXT, *pCheck_NATIONALTEXT;
474 wxCheckBox *pSEnableCM93Offset;
475 wxTextCtrl *m_ShallowCtl, *m_SafetyCtl, *m_DeepCtl;
476 wxStaticText *m_depthUnitsShal, *m_depthUnitsSafe, *m_depthUnitsDeep;
477 int k_vectorcharts;
478
479 // For "Units" page
480 wxChoice *pSDMMFormat, *pDistanceFormat, *pSpeedFormat, *pDepthUnitSelect,
481 *pTempFormat, *pWindSpeedFormat, *pHeightUnitSelect;
482 wxCheckBox *pCBTrueShow, *pCBMagShow;
483 wxTextCtrl *pMagVar;
484
485 // For "Charts" page
486 wxStaticBoxSizer *activeSizer;
487 wxBoxSizer *chartPanel;
488 wxTextCtrl *pSelCtl;
489
490 ArrayOfCDI ActiveChartArray;
491
492 wxStaticBox *itemActiveChartStaticBox;
493 wxCheckBox *pUpdateCheckBox, *pScanCheckBox;
494 wxButton *pParseENCButton;
495 wxButton *m_removeBtn, *m_compressBtn;
496 wxButton *m_migrateBtn;
497 int k_charts;
498 int m_nCharWidthMax;
499 wxBoxSizer *boxSizerCharts;
500 wxScrolledWindow *m_scrollWinChartList;
501 wxScrolledWindow *chartPanelWin;
502 wxBoxSizer *cmdButtonSizer;
503 wxStaticBox *loadedBox;
504 std::vector<OCPNChartDirPanel *> panelVector;
505 wxArrayString activeChartList;
506
507 // For the "Charts->Display Options" page
508 wxScrolledWindow *m_ChartDisplayPage;
509
510 // For the "AIS" page
511 wxCheckBox *m_pCheck_CPA_Max, *m_pCheck_CPA_Warn, *m_pCheck_CPA_WarnT;
512 wxCheckBox *m_pCheck_Mark_Lost, *m_pCheck_Remove_Lost;
513 wxCheckBox *m_pCheck_Show_COG, *m_pCheck_Sync_OCOG_ACOG;
514 wxCheckBox *m_pCheck_Show_Tracks, *m_pCheck_Hide_Moored,
515 *m_pCheck_Scale_Priority;
516 wxCheckBox *m_pCheck_AlertDialog, *m_pCheck_AlertAudio;
517 wxCheckBox *m_pCheck_Alert_Moored, *m_pCheck_Rollover_Class;
518 wxCheckBox *m_pCheck_Rollover_COG, *m_pCheck_Rollover_CPA;
519 wxCheckBox *m_pCheck_Ack_Timout, *m_pCheck_Show_Area_Notices;
520 wxCheckBox *m_pCheck_Draw_Target_Size, *m_pCheck_Draw_Realtime_Prediction;
521 wxCheckBox *m_pCheck_Show_Target_Name;
522 wxChoice *m_pWplAction;
523 wxCheckBox *m_pCheck_use_Wpl, *m_pCheck_ShowAllCPA;
524 wxTextCtrl *m_pText_CPA_Max, *m_pText_CPA_Warn, *m_pText_CPA_WarnT;
525 wxTextCtrl *m_pText_Mark_Lost, *m_pText_Remove_Lost, *m_pText_COG_Predictor;
526 wxTextCtrl *m_pText_Track_Length, *m_pText_Moored_Speed,
527 *m_pText_Scale_Priority;
528 wxTextCtrl *m_pText_ACK_Timeout, *m_pText_Show_Target_Name_Scale;
529 wxTextCtrl *m_pText_RealtPred_Speed;
530
531 // For Display->Configs page...
532 wxScrolledWindow *m_DisplayConfigsPage;
533
534 CanvasConfigSelect *m_sconfigSelect_single;
535 CanvasConfigSelect *m_sconfigSelect_twovertical;
536 wxStaticText *m_Text_def_boat_speed;
537
538 // For Configuration Template panel
539 wxScrolledWindow *m_scrollWinConfigList;
540 wxStaticText *m_templateTitleText;
541 wxStaticText *m_staticTextLastAppled;
542 wxStaticBoxSizer *m_templateStatusBoxSizer;
543
544 // For the ship page
545 wxFlexGridSizer *realSizes;
546 wxTextCtrl *m_pOSLength, *m_pOSWidth, *m_pOSGPSOffsetX, *m_pOSGPSOffsetY;
547 wxTextCtrl *m_pOSMinSize, *m_pText_ACRadius;
548 wxStaticBoxSizer *dispOptions, *dispWaypointOptions;
549 wxScrolledWindow *itemPanelShip, *itemPanelRoutes;
550 wxBoxSizer *ownShip, *Routes;
551 wxCheckBox *pShowshipToActive;
552 wxChoice *m_shipToActiveStyle, *m_shipToActiveColor;
553
554 OCPNIconCombo *pWaypointDefaultIconChoice;
555 OCPNIconCombo *pRoutepointDefaultIconChoice;
556 wxCheckBox *pScaMinChckB, *pScaMinOverruleChckB;
557 wxTextCtrl *m_pText_ScaMin;
558
559 // For the font page
560 wxBoxSizer *m_itemBoxSizerFontPanel;
561 wxChoice *m_itemFontElementListBox, *m_itemStyleListBox, *m_itemLangListBox;
562 wxStaticText *m_textSample;
563 bool m_bVisitLang;
564 bool m_bVisitPlugins;
565
566 // For "AIS Options"
567 wxComboBox *m_itemAISListBox;
568
569 // For "PlugIns" Panel
570 PluginListPanel *m_pPlugInCtrl;
571 AddPluginPanel *m_AddPluginPanel;
572 CatalogMgrPanel *m_PluginCatalogMgrPanel;
573 wxScrolledWindow *itemPanelPlugins;
574 wxBoxSizer *itemBoxSizerPanelPlugins;
575 wxFlexGridSizer *radarGrid, *waypointradarGrid;
576 wxChoice *pNavAidRadarRingsNumberVisible, *pWaypointRangeRingsNumber;
577 OCPNColourPickerCtrl *m_colourOwnshipRangeRingColour;
578 wxChoice *m_itemRadarRingsUnits, *m_itemWaypointRangeRingsUnits;
579 OCPNColourPickerCtrl *m_colourTrackLineColour;
580 ;
581 wxChoice *pTrackPrecision;
582 wxTextCtrl *pNavAidRadarRingsStep, *pWaypointRangeRingsStep;
583 wxCheckBox *pSogCogFromLLCheckBox;
584 wxSpinCtrl *pSogCogFromLLDampInterval;
585 wxTextCtrl *m_pText_TP_Secs, *m_pText_TP_Dist;
586 wxCheckBox *pWayPointPreventDragging, *pConfirmObjectDeletion;
587 wxCheckBox *pEnableZoomToCursor, *pPreserveScale, *pPlayShipsBells;
588 wxCheckBox *pEnableTenHertz, *pTransparentToolbar;
589 wxCheckBox *pAdvanceRouteWaypointOnArrivalOnly, *pTrackShowIcon;
590 wxCheckBox *pTrackDaily, *pTrackHighlite;
591 wxStaticText *pStatic_CallSign;
592
593#if wxCHECK_VERSION(2, 9, 0)
594#if wxUSE_TIMEPICKCTRL
595#ifdef __WXGTK__
596 TimeCtrl *pTrackRotateTime;
597#else
598 wxTimePickerCtrl *pTrackRotateTime;
599#endif
600#endif
601#endif
602 wxRadioButton *pTrackRotateComputerTime, *pTrackRotateUTC, *pTrackRotateLMT;
603 OCPNColourPickerCtrl *m_colourWaypointRangeRingsColour;
604 wxChoice *pSoundDeviceIndex;
605 wxStaticText *stSoundDeviceIndex;
606
607 wxArrayPtrVoid OBJLBoxArray;
608 wxString m_init_chart_dir;
609 wxArrayString *m_pSerialArray;
610
611 ArrayOfCDI m_CurrentDirList, *m_pWorkDirList;
612 MyConfig *m_pConfig;
613 wxWindow *pParent;
614
615 int k_plugins;
616 bool m_bForceNewToolbaronCancel;
617
618 // Sounds panel
619
620 OCPNSoundPanel *m_soundPanelAnchor;
621 OCPNSoundPanel *m_soundPanelAIS;
622 OCPNSoundPanel *m_soundPanelSART;
623 OCPNSoundPanel *m_soundPanelDSC;
624 void OnUXAudioEnableButtonClickAIS(wxCommandEvent &event);
625 void OnUXAudioEnableButtonClickSART(wxCommandEvent &event);
626 void OnUXAudioEnableButtonClickDSC(wxCommandEvent &event);
627
630 ObsListener m_sound_done_listener;
631
632private:
633 void Init(void);
634 void CreatePanel_MMSI(size_t parent, int border_size, int group_item_spacing);
635 void CreatePanel_AIS(size_t parent, int border_size, int group_item_spacing);
636 void CreatePanel_Ownship(size_t parent, int border_size,
637 int group_item_spacing);
638 void CreatePanel_NMEA(size_t parent, int border_size, int group_item_spacing);
639 void CreatePanel_ChartsLoad(size_t parent, int border_size,
640 int group_item_spacing);
641 void CreatePanel_VectorCharts(size_t parent, int border_size,
642 int group_item_spacing);
643 void CreatePanel_TidesCurrents(size_t parent, int border_size,
644 int group_item_spacing);
645 void CreatePanel_ChartGroups(size_t parent, int border_size,
646 int group_item_spacing);
647 void CreatePanel_Display(size_t parent, int border_size,
648 int group_item_spacing);
649 void CreatePanel_UI(size_t parent, int border_size, int group_item_spacing);
650 void CreatePanel_Units(size_t parent, int border_size,
651 int group_item_spacing);
652 void CreatePanel_Sounds(size_t parent, int border_size,
653 int group_item_spacing);
654 void CreatePanel_Advanced(size_t parent, int border_size,
655 int group_item_spacing);
656 void CreatePanel_Configs(size_t parent, int border_size,
657 int group_item_spacing);
658 void CreatePanel_Routes(size_t parent, int border_size,
659 int group_item_spacing);
660
661 void OnAlertEnableButtonClick(wxCommandEvent &event);
662 void OnAlertAudioEnableButtonClick(wxCommandEvent &event);
663 void OnResetFont(wxCommandEvent &event);
664
665 void UpdateTemplateTitleText();
666 void CheckDeviceAccess(wxString &path);
667 int m_returnChanges;
668 wxListCtrl *tcDataSelected;
669 std::vector<int> marinersStdXref;
670 ChartGroupsUI *groupsPanel;
671 wxImageList *m_topImgList;
672
673 wxCheckBox *m_persist_active_route_chkbox;
674 wxScrolledWindow *m_pNMEAForm;
675 void resetMarStdList(bool bsetConfig, bool bsetStd);
676
677 ObservableListener compat_os_listener;
678 void ApplyChanges(wxCommandEvent &event);
679
680 unsigned int m_screenConfig;
681
682 wxNotebookPage *m_groupsPage;
683 wxFont *dialogFont;
684 wxFont smallFont;
685 // wxFont *dialogFont;
686 wxSize m_small_button_size;
687
688 bool m_bcompact;
689 int m_fontHeight, m_scrollRate;
690 bool m_bfontChanged;
691 wxArrayString m_font_element_array;
692
693 bool m_bVectorInit;
694
695 wxBoxSizer *m_boxSizerConfigs;
696 wxColour m_panelBackgroundUnselected;
697 wxString m_selectedConfigPanelGUID;
698 wxSize m_colourPickerDefaultSize;
699
700 wxSize m_sliderSize;
701 bool m_bneedNew;
702
703 std::shared_ptr<ConnectionsDlg> comm_dialog;
704
705 DECLARE_EVENT_TABLE()
706};
707
708class CanvasConfigSelect : public wxPanel {
709public:
710 CanvasConfigSelect(wxWindow *parent, options *parentOptions, int id,
711 wxBitmap &bmp, const wxPoint &pos = wxDefaultPosition,
712 const wxSize &size = wxDefaultSize);
714
715 void OnMouseSelected(wxMouseEvent &event);
716 void SetSelected(bool selected);
717 void OnPaint(wxPaintEvent &event);
718
719 bool GetSelected() { return m_bSelected; }
720
721private:
722 options *m_parentOptions;
723 bool m_bSelected;
724 wxColour m_boxColour;
725 wxBitmap m_bmpNormal;
726 int m_borderWidth;
727
728 DECLARE_EVENT_TABLE()
729};
730
731class ChartGroupsUI : public wxScrolledWindow {
732public:
733 ChartGroupsUI(wxWindow *parent);
734 ~ChartGroupsUI(void);
735
736 void CreatePanel(size_t parent, int border_size, int group_item_spacing);
737 void CompletePanel(void);
738 void SetDBDirs(ArrayOfCDI &array) { m_db_dirs = array; }
739 void SetGroupArray(ChartGroupArray *pGroupArray) {
740 m_pGroupArray = pGroupArray;
741 }
742 void SetInitialSettings(void);
743 void CompleteInitialSettings(void);
744 void PopulateTrees(void);
745 void PopulateTreeCtrl(wxTreeCtrl *ptc, const wxArrayString &dir_array,
746 const wxColour &col, wxFont *pFont = NULL);
747 void BuildNotebookPages(ChartGroupArray *pGroupArray);
748 void EmptyChartGroupArray(ChartGroupArray *s);
749 void ClearGroupPages();
750
751 void OnNodeExpanded(wxTreeEvent &event);
752 void OnAvailableSelection(wxTreeEvent &event);
753 void OnInsertChartItem(wxCommandEvent &event);
754 void OnRemoveChartItem(wxCommandEvent &event);
755 void OnGroupPageChange(wxNotebookEvent &event);
756 void OnNewGroup(wxCommandEvent &event);
757 void OnDeleteGroup(wxCommandEvent &event);
758
759 ChartGroupArray *CloneChartGroupArray(ChartGroupArray *s);
760 wxTreeCtrl *AddEmptyGroupPage(const wxString &label);
761
762 bool modified, m_UIcomplete, m_settingscomplete, m_treespopulated;
763
764 wxScrolledWindow *m_panel;
765
766private:
767 int FindGroupBranch(ChartGroup *pGroup, wxTreeCtrl *ptree, wxTreeItemId item,
768 wxString *pbranch_adder);
769
770 wxWindow *pParent;
771 wxFlexGridSizer *groupsSizer;
772 wxButton *m_pAddButton, *m_pRemoveButton, *m_pNewGroupButton;
773 wxButton *m_pDeleteGroupButton;
774 wxGenericDirCtrl *allAvailableCtl, *defaultAllCtl;
775 wxTreeCtrl *m_pActiveChartsTree, *lastSelectedCtl;
776 wxTreeItemId lastDeletedItem;
777 wxNotebook *m_GroupNB;
778 wxFont *iFont;
779 wxFont *dialogFont;
780
781 ArrayOfCDI m_db_dirs;
782 ArrayOfDirCtrls m_DirCtrlArray;
783 ChartGroupArray *m_pGroupArray;
784
785 int m_border_size, m_group_item_spacing, m_GroupSelectedPage;
786
787 wxBoxSizer *m_topSizer;
788
789 DECLARE_EVENT_TABLE()
790};
791
792#ifdef ocpnUSE_GL
793class OpenGLOptionsDlg : private Uncopyable, public wxDialog {
794public:
795 explicit OpenGLOptionsDlg(wxWindow *parent);
796 bool GetAcceleratedPanning(void) const;
797 bool GetTextureCompression(void) const;
798 bool GetPolygonSmoothing(void) const;
799 bool GetLineSmoothing(void) const;
800 bool GetSoftwareGL(void) const;
801 bool GetTextureCompressionCaching(void) const;
802 bool GetRebuildCache(void) const;
803 int GetTextureMemorySize(void) const;
804
805private:
806 void Populate(void);
807 void OnButtonRebuild(wxCommandEvent &event);
808 void OnButtonClear(wxCommandEvent &event);
809 wxString GetTextureCacheSize(void);
810
811 wxCheckBox *m_cbUseAcceleratedPanning, *m_cbTextureCompression;
812 wxCheckBox *m_cbTextureCompressionCaching, *m_cbSoftwareGL,
813 *m_cbPolygonSmoothing, *m_cbLineSmoothing;
814 wxSpinCtrl *m_sTextureDimension, *m_sTextureMemorySize;
815 wxStaticText *m_cacheSize, *m_memorySize;
816
817 bool m_brebuild_cache;
818
819 DECLARE_EVENT_TABLE()
820};
821#endif
822
823#define ID_MMSI_PROPS_LIST 10073
824
825enum {
826 mlMMSI = 0,
827 mlTrackMode,
828 mlIgnore,
829 mlMOB,
830 mlVDM,
831 mlFollower,
832 mlShipName
833}; // MMSIListCtrl Columns;
834
835class MMSIListCtrl : private Uncopyable, public wxListCtrl {
836public:
837 explicit MMSIListCtrl(wxWindow *parent, wxWindowID id, const wxPoint &pos,
838 const wxSize &size, long style);
839 ~MMSIListCtrl(void);
840
841 wxString OnGetItemText(long item, long column) const;
842 void OnListItemClick(wxListEvent &event);
843 void OnListItemActivated(wxListEvent &event);
844 void OnListItemRightClick(wxListEvent &event);
845 void PopupMenuHandler(wxCommandEvent &event);
846
847 wxWindow *m_parent;
848 int m_context_item;
849
850 DECLARE_EVENT_TABLE()
851};
852
853#define ID_MMSIEDIT_OK 8191
854#define ID_MMSIEDIT_CANCEL 8192
855#define ID_MMSI_CTL 8193
856#define ID_DEF_MENU_MMSI_EDIT 8194
857#define ID_DEF_MENU_MMSI_DELETE 8195
858
859class MMSIEditDialog : private Uncopyable, public wxDialog {
860public:
861 explicit MMSIEditDialog(MmsiProperties *props, wxWindow *parent,
862 wxWindowID id = wxID_ANY,
863 const wxString &caption = wxEmptyString,
864 const wxPoint &pos = wxDefaultPosition,
865 const wxSize &size = wxDefaultSize, long style = 0);
866 ~MMSIEditDialog(void);
867
868 void SetColorScheme(ColorScheme cs);
869 void CreateControls(void);
870 void OnMMSIEditCancelClick(wxCommandEvent &event);
871 void OnMMSIEditOKClick(wxCommandEvent &event);
872 void OnCtlUpdated(wxCommandEvent &event);
873 void OnMMSIChanged(wxCommandEvent &event);
874
875 MmsiProperties *m_props;
876 wxTextCtrl *m_MMSICtl, *m_ShipNameCtl; // Has ToDo take away?
877 wxRadioButton *m_rbTypeTrackDefault, *m_rbTypeTrackAlways;
878 wxRadioButton *m_rbTypeTrackNever;
879 wxCheckBox *m_cbTrackPersist, *m_IgnoreButton, *m_MOBButton, *m_VDMButton,
880 *m_FollowerButton;
881 wxButton *m_CancelButton, *m_OKButton;
882
883private:
884 void Persist();
885
886 DECLARE_EVENT_TABLE()
887};
888
889class MMSI_Props_Panel : private Uncopyable, public wxPanel {
890public:
891 explicit MMSI_Props_Panel(wxWindow *parent);
893
894 void OnNewButton(wxCommandEvent &event);
895 void SetColorScheme(ColorScheme cs);
896 void UpdateMMSIList(void);
897
898 MMSIListCtrl *m_pListCtrlMMSI;
899 wxButton *m_pButtonNew;
900
901private:
902 wxWindow *m_pparent;
903};
904
905class ConfigCreateDialog : private Uncopyable, public wxDialog {
906public:
907 explicit ConfigCreateDialog(wxWindow *parent, wxWindowID id = wxID_ANY,
908 const wxString &caption = wxEmptyString,
909 const wxPoint &pos = wxDefaultPosition,
910 const wxSize &size = wxDefaultSize,
911 long style = 0);
913
914 void SetColorScheme(ColorScheme cs);
915 void CreateControls(void);
916 void OnConfigEditCancelClick(wxCommandEvent &event);
917 void OnConfigEditOKClick(wxCommandEvent &event);
918 wxString GetCreatedTemplateGUID() { return m_createdTemplateGUID; }
919
920 wxTextCtrl *m_TitleCtl, *m_DescriptionCtl;
921 wxButton *m_CancelButton, *m_OKButton;
922 wxString m_createdTemplateGUID;
923 DECLARE_EVENT_TABLE()
924};
925
926#endif
927// _OPTIONS_H_
Class AisDecoder and helpers.
Basic chart info storage.
Represents a user-defined collection of logically related charts.
Definition chartdbs.h:468
Generic event handling between MVC Model and Controller based on a shared EventVar variable.
Process incoming AIS messages.
Definition ais_decoder.h:74
Custom combobox for selecting waypoint icons.
Definition mark_info.h:151
Define an action to be performed when a KeyProvider is notified.
Definition observable.h:257
Keeps listening over its lifespan, removes itself on destruction.
Definition observable.h:155
Encapsulates persistent canvas configuration.
wxRadioButton * pTimezoneUTC
Specify date/time should be formatted in UTC.
Definition options.h:431
EventVar m_on_sound_done
Notified with a OCPN_Sound* pointer when sound has completed.
Definition options.h:629
wxRadioButton * pTimezoneLocalTime
Specify date/time should be formatted in timezone as configured in the operating system.
Definition options.h:429
Options | Connections GUI tab managing connections
Waypoint properties maintenance dialog.
Utility functions.
OpenCPN Platform specific support utilities.
options * g_options
Global instance.
Definition options.cpp:179
PlugInManager and helper classes – Mostly gui parts (dialogs) and plugin API stuff.
Time textbox to replace broken wxTimePickerCtrl on wxGTK.