OpenCPN Partial API docs
Loading...
Searching...
No Matches
options.h
1/***************************************************************************
2 *
3 * Project: OpenCPN
4 * Purpose: Options Dialog
5 * Author: David Register
6 *
7 ***************************************************************************
8 * Copyright (C) 2010 by David S. Register *
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 * This program is distributed in the hope that it will be useful, *
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
18 * GNU General Public License for more details. *
19 * *
20 * You should have received a copy of the GNU General Public License *
21 * along with this program; if not, write to the *
22 * Free Software Foundation, Inc., *
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
24 **************************************************************************/
25
26#ifndef _OPTIONS_H_
27#define _OPTIONS_H_
28
29#ifdef __MINGW32__
30#undef IPV6STRICT // mingw FTBS fix: missing struct ip_mreq
31#include <windows.h>
32#endif
33
34#include <memory>
35#include <vector>
36
37#include <wx/listbook.h>
38#include <wx/dirctrl.h>
39#include <wx/frame.h>
40#include <wx/spinctrl.h>
41#include <wx/listctrl.h>
42#include <wx/choice.h>
43#include <wx/collpane.h>
44#include <wx/clrpicker.h>
45#include <wx/colourdata.h>
46
47#if wxUSE_TIMEPICKCTRL
48#include <wx/timectrl.h>
49#endif
50
51#ifdef __WXGTK__
52// wxTimePickerCtrl is completely broken in Gnome based desktop environments as
53// of wxGTK 3.0
54#include "time_textbox.h"
55#endif
56
57#include "chartdbs.h"
58#include "pluginmanager.h" // FIXME: Refactor
59#include "connections_dlg.h"
60
61#ifndef __ANDROID__
62#define __OCPN__OPTIONS_USE_LISTBOOK__
63#endif
64
65// Forward Declarations
66class wxGenericDirCtrl;
67class MyConfig;
68class ChartGroupsUI;
69// class ConnectionParams;
70class PluginListPanel;
71class ChartGroupArray;
72class ChartGroup;
74class MmsiProperties;
77class OCPNIconCombo;
80class OCPNSoundPanel;
81
82#define ID_DIALOG 10001
83#ifdef __WXOSX__
84#define SYMBOL_OPTIONS_STYLE \
85 wxCAPTION | wxRESIZE_BORDER | wxSYSTEM_MENU | wxCLOSE_BOX | wxSTAY_ON_TOP
86#else
87#define SYMBOL_OPTIONS_STYLE \
88 wxCAPTION | wxRESIZE_BORDER | wxSYSTEM_MENU | wxCLOSE_BOX
89#endif
90#define SYMBOL_OPTIONS_TITLE _("Options")
91#define SYMBOL_OPTIONS_IDNAME ID_DIALOG
92#define SYMBOL_OPTIONS_SIZE wxSize(500, 500)
93#define SYMBOL_OPTIONS_POSITION wxDefaultPosition
94
95enum {
96 ID_APPLY = 10000,
97 ID_ATONTEXTCHECKBOX,
98 ID_AUTOANCHORMARKBOX1,
99 ID_BELLSCHECKBOX,
100 ID_BUTTONADD,
101 ID_BUTTONDELETE,
102 ID_BUTTONCOMPRESS,
103 ID_BUTTONFONTCHOOSE,
104 ID_BUTTONFONT_RESET,
105 ID_BUTTONECDISHELP,
106 ID_BUTTONFONTCOLOR,
107 ID_BUTTONGROUP,
108 ID_BUTTONREBUILD,
109 ID_BUTTONTCDATA,
110 ID_CHECKLISTBOX,
111 ID_CHECK_DISPLAYGRID,
112 ID_CHECK_LOOKAHEAD,
113 ID_CHOICE_AIS,
114 ID_CHOICE_AP,
115 ID_CHOICE_FONTELEMENT,
116 ID_CHOICE_LANG,
117 ID_CHOICE_NMEA_BAUD,
118 ID_CLEARLIST,
119 ID_CM93CHECKBOX1,
120 ID_CM93ZOOM,
121 ID_COURSEUPCHECKBOX,
122 ID_DAILYCHECKBOX,
123 ID_DEBUGCHECKBOX1,
124 ID_DECLTEXTCHECKBOX,
125 ID_DIRCTRL,
126 ID_DRAGGINGCHECKBOX,
127 ID_FILTERNMEA,
128 ID_FSTOOLBARCHECKBOX,
129 ID_FULLSCREENQUILT,
130 ID_GARMINHOST,
131 ID_RADARRINGS,
132 ID_GRIBCHECKBOX,
133 ID_GROUPAVAILABLE,
134 ID_GROUPDELETEGROUP,
135 ID_GROUPINSERTDIR,
136 ID_GROUPNEWGROUP,
137 ID_GROUPNOTEBOOK,
138 ID_GROUPREMOVEDIR,
139 ID_IMPTEXTCHECKBOX,
140 ID_LDISTEXTCHECKBOX,
141 ID_LISTBOX,
142 ID_METACHECKBOX,
143 ID_NOTEBOOK,
144 ID_OPENGLBOX,
145 ID_OPENGLOPTIONS,
146 ID_SHIPICONTYPE,
147 ID_OUTLINECHECKBOX1,
148 ID_PANEL,
149 ID_PANEL2,
150 ID_PANEL3,
151 ID_PANELADVANCED,
152 ID_PANELAIS,
153 ID_PANELMMSI,
154 ID_PANELFONT,
155 ID_PANELPIM,
156 ID_PRESERVECHECKBOX,
157 ID_PRINTCHECKBOX1,
158 ID_QUILTCHECKBOX1,
159 ID_RADARDISTUNIT,
160 ID_RASTERCHECKBOX1,
161 ID_SCAMINCHECKBOX,
162 ID_SUPERSCAMINCHECKBOX,
163 ID_SCANCHECKBOX,
164 ID_SDMMFORMATCHOICE,
165 ID_DISTANCEUNITSCHOICE,
166 ID_SPEEDUNITSCHOICE,
167 ID_WINDSPEEDUNITCHOICE,
168 ID_DEPTHUNITSCHOICE,
169 ID_SELECTLIST,
170 ID_SHOWDEPTHUNITSBOX1,
171 ID_SHOWGPSWINDOW,
172 ID_SKEWCOMPBOX,
173 ID_SMOOTHPANZOOMBOX,
174 ID_SOUNDGCHECKBOX,
175 ID_STYLESCOMBOBOX,
176 ID_TCDATAADD,
177 ID_TCDATADEL,
178 ID_TEXTCHECKBOX,
179 ID_OPTEXTCTRL,
180 ID_TIDESELECTED,
181 ID_TRACKCHECKBOX,
182 ID_TRACKHILITE,
183 ID_TRANSTOOLBARCHECKBOX,
184 ID_UPDCHECKBOX,
185 ID_PARSEENCBUTTON,
186 ID_VECTORCHECKBOX1,
187 ID_ZTCCHECKBOX,
188 ID_DELETECHECKBOX,
189 ID_NATIONALTEXTCHECKBOX,
190 ID_TRUESHOWCHECKBOX,
191 ID_MAGSHOWCHECKBOX,
192 ID_MAGAPBCHECKBOX,
193 ID_MOBILEBOX,
194 ID_REPONSIVEBOX,
195 ID_SIZEMANUALRADIOBUTTON,
196 ID_OPWAYPOINTRANGERINGS,
197 xID_OK,
198 ID_BT_SCANTIMER,
199 ID_TRACKROTATETIME,
200 ID_TRACKROTATEUTC,
201 ID_TRACKROTATELMT,
202 ID_TRACKROTATECOMPUTER,
203 ID_SETSTDLIST,
204 ID_VECZOOM,
205 ID_INLANDECDISBOX,
206 ID_ROLLOVERBOX,
207 ID_SOGCOGFROMLLCHECKBOX,
208 ID_SOGCOGDAMPINTTEXTCTRL,
209 // LIVE ETA OPTION
210 ID_CHECK_LIVEETA,
211 ID_DEFAULT_BOAT_SPEED,
212 ID_SCREENCONFIG1,
213 ID_SCREENCONFIG2,
214 ID_CONFIGEDIT_OK,
215 ID_CONFIGEDIT_CANCEL,
216 ID_ZOOMBUTTONS,
217 ID_RASTERZOOM,
218 ID_ANCHORALERTAUDIO,
219 ID_AISALERTAUDIO,
220 ID_AISALERTDIALOG,
221 ID_TEMPUNITSCHOICE,
222 ID_BUTTONMIGRATE,
223 ID_TIMEZONE_UTC,
224 ID_TIMEZONE_LOCAL_TIME
225};
226
227/* Define an int bit field for dialog return value
228 * to indicate which types of settings have changed */
229#define GENERIC_CHANGED 1
230#define S52_CHANGED 1 << 1
231#define FONT_CHANGED 1 << 2
232#define FORCE_UPDATE 1 << 3
233#define VISIT_CHARTS 1 << 4
234#define LOCALE_CHANGED 1 << 5
235#define TOOLBAR_CHANGED 1 << 6
236#define CHANGE_CHARTS 1 << 7
237#define SCAN_UPDATE 1 << 8
238#define GROUPS_CHANGED 1 << 9
239#define STYLE_CHANGED 1 << 10
240#define TIDES_CHANGED 1 << 11
241#define GL_CHANGED 1 << 12
242#define REBUILD_RASTER_CACHE 1 << 13
243#define NEED_NEW_OPTIONS 1 << 14
244#define PARSE_ENC 1 << 15
245#define CONFIG_CHANGED 1 << 16
246#define FONT_CHANGED_SAFE 1 << 17
247
248#ifndef wxCLOSE_BOX
249#define wxCLOSE_BOX 0x1000
250#endif
251#ifndef wxFIXED_MINSIZE
252#define wxFIXED_MINSIZE 0
253#endif
254
255#include <wx/arrimpl.cpp>
256WX_DEFINE_ARRAY_PTR(wxGenericDirCtrl *, ArrayOfDirCtrls);
257
259protected:
260 Uncopyable(void) {}
261 ~Uncopyable(void) {}
262
263private:
264 Uncopyable(const Uncopyable &);
265 Uncopyable &operator=(const Uncopyable &);
266};
267
268#ifndef bert // wxCHECK_VERSION(2, 9, 0)
269class options : private Uncopyable,
270 public wxDialog
271#else
272class options : private Uncopyable,
273 public wxScrollingDialog
274#endif
275{
276public:
277 explicit options(wxWindow *parent, wxWindowID id = SYMBOL_OPTIONS_IDNAME,
278 const wxString &caption = SYMBOL_OPTIONS_TITLE,
279 const wxPoint &pos = SYMBOL_OPTIONS_POSITION,
280 const wxSize &size = SYMBOL_OPTIONS_SIZE,
281 long style = SYMBOL_OPTIONS_STYLE);
282
283 ~options(void);
284#if wxCHECK_VERSION(3, 0, 0)
285 bool SendIdleEvents(wxIdleEvent &event);
286#endif
287 void SetInitialPage(int page_sel, int sub_page = -1);
288 void Finish(void);
289
290 void OnClose(wxCloseEvent &event);
291
292 void CreateListbookIcons();
293 void CreateControls(void);
294 size_t CreatePanel(const wxString &title);
295 wxScrolledWindow *AddPage(size_t parent, const wxString &title);
296 bool DeletePluginPage(wxScrolledWindow *page);
297 void SetColorScheme(ColorScheme cs);
298 void RecalculateSize(int hint_x, int hint_y);
299
300 void SetInitChartDir(const wxString &dir) { m_init_chart_dir = dir; }
301 void SetInitialSettings(void);
302 void SetInitialVectorSettings(void);
303
304 void SetCurrentDirList(ArrayOfCDI p) { m_CurrentDirList = p; }
305 void SetWorkDirListPtr(ArrayOfCDI *p) { m_pWorkDirList = p; }
306 ArrayOfCDI *GetWorkDirListPtr(void) { return m_pWorkDirList; }
307
308 void AddChartDir(const wxString &dir);
309
310 void UpdateDisplayedChartDirList(ArrayOfCDI p);
311 void UpdateOptionsUnits(void);
312
313 void SetConfigPtr(MyConfig *p) { m_pConfig = p; }
314 void OnDebugcheckbox1Click(wxCommandEvent &event);
315 void OnDirctrlSelChanged(wxTreeEvent &event);
316 void OnButtonaddClick(wxCommandEvent &event);
317 void OnButtondeleteClick(wxCommandEvent &event);
318 void OnButtonParseENC(wxCommandEvent &event);
319 void OnButtoncompressClick(wxCommandEvent &event);
320 void OnButtonmigrateClick(wxCommandEvent &event);
321 void OnButtonEcdisHelp(wxCommandEvent &event);
322 void OnRadioboxSelected(wxCommandEvent &event);
323 void OnApplyClick(wxCommandEvent &event);
324 void OnXidOkClick(wxCommandEvent &event);
325 void OnCancelClick(wxCommandEvent &event);
326 void OnChooseFont(wxCommandEvent &event);
327 void OnFontChoice(wxCommandEvent &event);
328 void OnCPAWarnClick(wxCommandEvent &event);
329 void OnSyncCogPredClick(wxCommandEvent &event);
330 void OnSizeAutoButton(wxCommandEvent &event);
331 void OnSizeManualButton(wxCommandEvent &event);
332
333#if defined(__WXGTK__) || defined(__WXQT__)
334 void OnChooseFontColor(wxCommandEvent &event);
335#endif
336 void OnGLClicked(wxCommandEvent &event);
337 void OnOpenGLOptions(wxCommandEvent &event);
338 void OnDisplayCategoryRadioButton(wxCommandEvent &event);
339 void OnButtonClearClick(wxCommandEvent &event);
340 void OnButtonSelectClick(wxCommandEvent &event);
341 void OnButtonSetStd(wxCommandEvent &event);
342
343 void OnPageChange(wxListbookEvent &event);
344 void OnTopNBPageChange(wxNotebookEvent &event);
345 void OnSubNBPageChange(wxNotebookEvent &event);
346 void DoOnPageChange(size_t page);
347
348 wxString SelectSoundFile();
349 void OnButtonSelectSound(wxCommandEvent &event);
350 void OnButtonTestSound(wxCommandEvent &event);
351
352 void OnShowGpsWindowCheckboxClick(wxCommandEvent &event);
353 void OnZTCCheckboxClick(wxCommandEvent &event);
354 void OnRadarringSelect(wxCommandEvent &event);
355 void OnWaypointRangeRingSelect(wxCommandEvent &event);
356 void OnShipTypeSelect(wxCommandEvent &event);
357 void OnButtonGroups(wxCommandEvent &event);
358 void OnInsertTideDataLocation(wxCommandEvent &event);
359 void OnRemoveTideDataLocation(wxCommandEvent &event);
360 void OnCharHook(wxKeyEvent &event);
361 void OnChartsPageChange(wxListbookEvent &event);
362 void OnChartDirListSelect(wxCommandEvent &event);
363 void OnUnitsChoice(wxCommandEvent &event);
364
365 void UpdateWorkArrayFromDisplayPanel(void);
366 ArrayOfCDI GetSelectedChartDirs();
367 ArrayOfCDI GetUnSelectedChartDirs();
368 void SetDirActionButtons();
369
370 void OnCreateConfig(wxCommandEvent &event);
371 void OnEditConfig(wxCommandEvent &event);
372 void OnDeleteConfig(wxCommandEvent &event);
373 void OnApplyConfig(wxCommandEvent &event);
374 void SetConfigButtonState();
375 void ClearConfigList();
376 void BuildConfigList();
377 void OnConfigMouseSelected(wxMouseEvent &event);
378 void OnDialogInit(wxInitDialogEvent &event);
379
380 bool GetNeedNew() { return m_bneedNew; }
381 void SetNeedNew(bool bnew) { m_bneedNew = bnew; }
382 int GetScrollRate() { return m_scrollRate; }
383 void SetForceNewToolbarOnCancel(bool val) {
384 m_bForceNewToolbaronCancel = val;
385 }
386
387 wxArrayString *GetSerialArray() { return m_pSerialArray; }
388
389 // Should we show tooltips?
390 static bool ShowToolTips(void);
391
392#ifdef __OCPN__OPTIONS_USE_LISTBOOK__
393 wxListbook *m_pListbook;
394#else
395 wxNotebook *m_pListbook;
396#endif
397
398 size_t m_pageDisplay, m_pageConnections, m_pageCharts, m_pageShips;
399 size_t m_pageUI, m_pagePlugins;
400 int lastPage, lastSubPage;
401 wxPoint lastWindowPos;
402 wxSize lastWindowSize;
403 wxButton *m_ApplyButton, *m_OKButton, *m_CancelButton;
404
405 ChartGroupArray *m_pGroupArray;
406 int m_groups_changed;
407
408 // Sizer flags
409 wxSizerFlags inputFlags, verticleInputFlags, labelFlags, groupInputFlags;
410 wxSizerFlags groupLabelFlags, groupLabelFlagsHoriz;
411
412 // For general options
413 wxScrolledWindow *pDisplayPanel;
414 wxCheckBox *pShowStatusBar, *pShowMenuBar, *pShowChartBar, *pShowCompassWin;
415 wxCheckBox *pPrintShowIcon, *pCDOOutlines, *pSDepthUnits, *pSDisplayGrid;
416 wxCheckBox *pAutoAnchorMark, *pCDOQuilting, *pCBRaster, *pCBVector;
417 wxCheckBox *pCBCM93, *pCBLookAhead, *pSkewComp, *pOpenGL, *pSmoothPanZoom;
418 wxCheckBox *pFullScreenQuilt, *pMobile, *pResponsive, *pOverzoomEmphasis;
419 wxCheckBox *pOZScaleVector, *pToolbarAutoHideCB, *pInlandEcdis, *pRollover;
420 wxCheckBox *pZoomButtons, *pChartBarEX;
421 wxTextCtrl *pCOGUPUpdateSecs, *m_pText_OSCOG_Predictor, *pScreenMM;
422 wxTextCtrl *pToolbarHideSecs, *m_pText_OSHDT_Predictor, *m_pTxt_OwnMMSI;
423 // Radio buttons to control the date/time format.
424 // In the future, other date/time formats may be added here. For example:
425 // 1. Local Mean Time (LMT) at the location.
426 // 2. Custom timezone, such as for route planning purpose.
427
430 wxRadioButton *pTimezoneLocalTime;
432 wxRadioButton *pTimezoneUTC;
433 wxTextCtrl *pCmdSoundString;
434
435 wxChoice *m_pShipIconType, *m_pcTCDatasets;
436 wxSlider *m_pSlider_Zoom_Raster, *m_pSlider_GUI_Factor,
437 *m_pSlider_Chart_Factor, *m_pSlider_Ship_Factor, *m_pSlider_Text_Factor,
438 *m_pSlider_ENCText_Factor;
439 wxSlider *m_pMouse_Zoom_Slider;
440 wxSlider *m_pSlider_Zoom_Vector;
441 wxSlider *m_pSlider_CM93_Zoom;
442 // LIVE ETA OPTION
443 wxCheckBox *pSLiveETA;
444 wxTextCtrl *pSDefaultBoatSpeed;
445
446 wxRadioButton *pCBCourseUp, *pCBNorthUp, *pRBSizeAuto, *pRBSizeManual;
447 int k_tides;
448
449 // For the Display\Units page
450 wxStaticText *itemStaticTextUserVar;
451 wxStaticText *itemStaticTextUserVar2;
452 wxButton *m_configDeleteButton, *m_configApplyButton;
453
454 void OnAISRolloverClick(wxCommandEvent &event);
455 void UpdateChartDirList();
456
457 void OnCanvasConfigSelectClick(int ID, bool selected);
458
459 bool b_haveWMM;
460 bool b_oldhaveWMM;
461 ColorScheme m_cs;
462
463 // For "S57" page
464 wxBoxSizer *vectorPanel;
465 wxScrolledWindow *ps57Ctl;
466
467 OCPNCheckedListCtrl *ps57CtlListBox;
468
469 wxChoice *pDispCat, *pPointStyle, *pBoundStyle, *p24Color;
470 wxButton *itemButtonClearList, *itemButtonSelectList, *itemButtonSetStd;
471 wxCheckBox *pCheck_SOUNDG, *pCheck_META, *pCheck_SHOWIMPTEXT;
472 wxCheckBox *pCheck_SCAMIN, *pCheck_SuperSCAMIN;
473 wxCheckBox *pCheck_ATONTEXT, *pCheck_LDISTEXT;
474 wxCheckBox *pCheck_XLSECTTEXT, *pCheck_DECLTEXT, *pCheck_NATIONALTEXT;
475 wxCheckBox *pSEnableCM93Offset;
476 wxTextCtrl *m_ShallowCtl, *m_SafetyCtl, *m_DeepCtl;
477 wxStaticText *m_depthUnitsShal, *m_depthUnitsSafe, *m_depthUnitsDeep;
478 int k_vectorcharts;
479
480 // For "Units" page
481 wxChoice *pSDMMFormat, *pDistanceFormat, *pSpeedFormat, *pDepthUnitSelect,
482 *pTempFormat, *pWindSpeedFormat;
483 wxCheckBox *pCBTrueShow, *pCBMagShow;
484 wxTextCtrl *pMagVar;
485
486 // For "Charts" page
487 wxStaticBoxSizer *activeSizer;
488 wxBoxSizer *chartPanel;
489 wxTextCtrl *pSelCtl;
490
491 ArrayOfCDI ActiveChartArray;
492
493 wxStaticBox *itemActiveChartStaticBox;
494 wxCheckBox *pUpdateCheckBox, *pScanCheckBox;
495 wxButton *pParseENCButton;
496 wxButton *m_removeBtn, *m_compressBtn;
497 wxButton *m_migrateBtn;
498 int k_charts;
499 int m_nCharWidthMax;
500 wxBoxSizer *boxSizerCharts;
501 wxScrolledWindow *m_scrollWinChartList;
502 wxScrolledWindow *chartPanelWin;
503 wxBoxSizer *cmdButtonSizer;
504 wxStaticBox *loadedBox;
505 std::vector<OCPNChartDirPanel *> panelVector;
506 wxArrayString activeChartList;
507
508 // For the "Charts->Display Options" page
509 wxScrolledWindow *m_ChartDisplayPage;
510
511 // For the "AIS" page
512 wxCheckBox *m_pCheck_CPA_Max, *m_pCheck_CPA_Warn, *m_pCheck_CPA_WarnT;
513 wxCheckBox *m_pCheck_Mark_Lost, *m_pCheck_Remove_Lost;
514 wxCheckBox *m_pCheck_Show_COG, *m_pCheck_Sync_OCOG_ACOG;
515 wxCheckBox *m_pCheck_Show_Tracks, *m_pCheck_Hide_Moored,
516 *m_pCheck_Scale_Priority;
517 wxCheckBox *m_pCheck_AlertDialog, *m_pCheck_AlertAudio;
518 wxCheckBox *m_pCheck_Alert_Moored, *m_pCheck_Rollover_Class;
519 wxCheckBox *m_pCheck_Rollover_COG, *m_pCheck_Rollover_CPA;
520 wxCheckBox *m_pCheck_Ack_Timout, *m_pCheck_Show_Area_Notices;
521 wxCheckBox *m_pCheck_Draw_Target_Size, *m_pCheck_Draw_Realtime_Prediction;
522 wxCheckBox *m_pCheck_Show_Target_Name;
523 wxChoice *m_pWplAction;
524 wxCheckBox *m_pCheck_use_Wpl, *m_pCheck_ShowAllCPA;
525 wxTextCtrl *m_pText_CPA_Max, *m_pText_CPA_Warn, *m_pText_CPA_WarnT;
526 wxTextCtrl *m_pText_Mark_Lost, *m_pText_Remove_Lost, *m_pText_COG_Predictor;
527 wxTextCtrl *m_pText_Track_Length, *m_pText_Moored_Speed,
528 *m_pText_Scale_Priority;
529 wxTextCtrl *m_pText_ACK_Timeout, *m_pText_Show_Target_Name_Scale;
530 wxTextCtrl *m_pText_RealtPred_Speed;
531
532 // For Display->Configs page...
533 wxScrolledWindow *m_DisplayConfigsPage;
534
535 CanvasConfigSelect *m_sconfigSelect_single;
536 CanvasConfigSelect *m_sconfigSelect_twovertical;
537 wxStaticText *m_Text_def_boat_speed;
538
539 // For Configuration Template panel
540 wxScrolledWindow *m_scrollWinConfigList;
541 wxStaticText *m_templateTitleText;
542 wxStaticText *m_staticTextLastAppled;
543 wxStaticBoxSizer *m_templateStatusBoxSizer;
544
545 // For the ship page
546 wxFlexGridSizer *realSizes;
547 wxTextCtrl *m_pOSLength, *m_pOSWidth, *m_pOSGPSOffsetX, *m_pOSGPSOffsetY;
548 wxTextCtrl *m_pOSMinSize, *m_pText_ACRadius;
549 wxStaticBoxSizer *dispOptions, *dispWaypointOptions;
550 wxScrolledWindow *itemPanelShip, *itemPanelRoutes;
551 wxBoxSizer *ownShip, *Routes;
552 wxCheckBox *pShowshipToActive;
553 wxChoice *m_shipToActiveStyle, *m_shipToActiveColor;
554
555 OCPNIconCombo *pWaypointDefaultIconChoice;
556 OCPNIconCombo *pRoutepointDefaultIconChoice;
557 wxCheckBox *pScaMinChckB, *pScaMinOverruleChckB;
558 wxTextCtrl *m_pText_ScaMin;
559
560 // For the font page
561 wxBoxSizer *m_itemBoxSizerFontPanel;
562 wxChoice *m_itemFontElementListBox, *m_itemStyleListBox, *m_itemLangListBox;
563 wxStaticText *m_textSample;
564 bool m_bVisitLang;
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 *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
874 MmsiProperties *m_props;
875 wxTextCtrl *m_MMSICtl, m_ShipNameCtl; // Has ToDo take away?
876 wxRadioButton *m_rbTypeTrackDefault, *m_rbTypeTrackAlways;
877 wxRadioButton *m_rbTypeTrackNever;
878 wxCheckBox *m_cbTrackPersist, *m_IgnoreButton, *m_MOBButton, *m_VDMButton,
879 *m_FollowerButton;
880 wxButton *m_CancelButton, *m_OKButton;
881
882private:
883 void Persist();
884
885 DECLARE_EVENT_TABLE()
886};
887
888class MMSI_Props_Panel : private Uncopyable, public wxPanel {
889public:
890 explicit MMSI_Props_Panel(wxWindow *parent);
892
893 void OnNewButton(wxCommandEvent &event);
894 void SetColorScheme(ColorScheme cs);
895 void UpdateMMSIList(void);
896
897 MMSIListCtrl *m_pListCtrlMMSI;
898 wxButton *m_pButtonNew;
899
900private:
901 wxWindow *m_pparent;
902};
903
904class ConfigCreateDialog : private Uncopyable, public wxDialog {
905public:
906 explicit ConfigCreateDialog(wxWindow *parent, wxWindowID id = wxID_ANY,
907 const wxString &caption = wxEmptyString,
908 const wxPoint &pos = wxDefaultPosition,
909 const wxSize &size = wxDefaultSize,
910 long style = 0);
912
913 void SetColorScheme(ColorScheme cs);
914 void CreateControls(void);
915 void OnConfigEditCancelClick(wxCommandEvent &event);
916 void OnConfigEditOKClick(wxCommandEvent &event);
917 wxString GetCreatedTemplateGUID() { return m_createdTemplateGUID; }
918
919 wxTextCtrl *m_TitleCtl, *m_DescriptionCtl;
920 wxButton *m_CancelButton, *m_OKButton;
921 wxString m_createdTemplateGUID;
922 DECLARE_EVENT_TABLE()
923};
924
925#endif
926// _OPTIONS_H_
Represents a user-defined collection of logically related charts.
Definition chartdbs.h:464
Generic event handling between MVC Model and Controller based on a shared EventVar variable.
Custom combobox for selecting waypoint icons.
Definition MarkInfo.h:159
Define an action to be performed when a KeyProvider is notified.
Definition observable.h:228
Keeps listening over it's lifespan, removes itself on destruction.
Definition observable.h:131
wxRadioButton * pTimezoneUTC
Specify date/time should be formatted in UTC.
Definition options.h:432
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:430