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 ID_TENHZCHECKBOX
226};
227
228/* Define an int bit field for dialog return value
229 * to indicate which types of settings have changed */
230#define GENERIC_CHANGED 1
231#define S52_CHANGED 1 << 1
232#define FONT_CHANGED 1 << 2
233#define FORCE_UPDATE 1 << 3
234#define VISIT_CHARTS 1 << 4
235#define LOCALE_CHANGED 1 << 5
236#define TOOLBAR_CHANGED 1 << 6
237#define CHANGE_CHARTS 1 << 7
238#define SCAN_UPDATE 1 << 8
239#define GROUPS_CHANGED 1 << 9
240#define STYLE_CHANGED 1 << 10
241#define TIDES_CHANGED 1 << 11
242#define GL_CHANGED 1 << 12
243#define REBUILD_RASTER_CACHE 1 << 13
244#define NEED_NEW_OPTIONS 1 << 14
245#define PARSE_ENC 1 << 15
246#define CONFIG_CHANGED 1 << 16
247#define FONT_CHANGED_SAFE 1 << 17
248
249#ifndef wxCLOSE_BOX
250#define wxCLOSE_BOX 0x1000
251#endif
252#ifndef wxFIXED_MINSIZE
253#define wxFIXED_MINSIZE 0
254#endif
255
256#include <wx/arrimpl.cpp>
257WX_DEFINE_ARRAY_PTR(wxGenericDirCtrl *, ArrayOfDirCtrls);
258
260protected:
261 Uncopyable(void) {}
262 ~Uncopyable(void) {}
263
264private:
265 Uncopyable(const Uncopyable &);
266 Uncopyable &operator=(const Uncopyable &);
267};
268
269#ifndef bert // wxCHECK_VERSION(2, 9, 0)
270class options : private Uncopyable,
271 public wxDialog
272#else
273class options : private Uncopyable,
274 public wxScrollingDialog
275#endif
276{
277public:
278 explicit options(wxWindow *parent, wxWindowID id = SYMBOL_OPTIONS_IDNAME,
279 const wxString &caption = SYMBOL_OPTIONS_TITLE,
280 const wxPoint &pos = SYMBOL_OPTIONS_POSITION,
281 const wxSize &size = SYMBOL_OPTIONS_SIZE,
282 long style = SYMBOL_OPTIONS_STYLE);
283
284 ~options(void);
285#if wxCHECK_VERSION(3, 0, 0)
286 bool SendIdleEvents(wxIdleEvent &event);
287#endif
288 void SetInitialPage(int page_sel, int sub_page = -1);
289 void Finish(void);
290
291 void OnClose(wxCloseEvent &event);
292
293 void ShowOKButtons(bool _show) { m_OK_Cancel_Apply_buttons->Show(_show); }
294
295 void CreateListbookIcons();
296 void CreateControls(void);
297 size_t CreatePanel(const wxString &title);
298 wxScrolledWindow *AddPage(size_t parent, const wxString &title);
299 bool DeletePluginPage(wxScrolledWindow *page);
300 void SetColorScheme(ColorScheme cs);
301 void RecalculateSize(int hint_x, int hint_y);
302
303 void SetInitChartDir(const wxString &dir) { m_init_chart_dir = dir; }
304 void SetInitialSettings(void);
305 void SetInitialVectorSettings(void);
306
307 void SetCurrentDirList(ArrayOfCDI p) { m_CurrentDirList = p; }
308 void SetWorkDirListPtr(ArrayOfCDI *p) { m_pWorkDirList = p; }
309 ArrayOfCDI *GetWorkDirListPtr(void) { return m_pWorkDirList; }
310
311 void AddChartDir(const wxString &dir);
312
313 void UpdateDisplayedChartDirList(ArrayOfCDI p);
314 void UpdateOptionsUnits(void);
315
316 void SetConfigPtr(MyConfig *p) { m_pConfig = p; }
317 void OnDebugcheckbox1Click(wxCommandEvent &event);
318 void OnDirctrlSelChanged(wxTreeEvent &event);
319 void OnButtonaddClick(wxCommandEvent &event);
320 void OnButtondeleteClick(wxCommandEvent &event);
321 void OnButtonParseENC(wxCommandEvent &event);
322 void OnButtoncompressClick(wxCommandEvent &event);
323 void OnButtonmigrateClick(wxCommandEvent &event);
324 void OnButtonEcdisHelp(wxCommandEvent &event);
325 void OnRadioboxSelected(wxCommandEvent &event);
326 void OnApplyClick(wxCommandEvent &event);
327 void OnXidOkClick(wxCommandEvent &event);
328 void OnCancelClick(wxCommandEvent &event);
329 void OnChooseFont(wxCommandEvent &event);
330 void OnFontChoice(wxCommandEvent &event);
331 void OnCPAWarnClick(wxCommandEvent &event);
332 void OnSyncCogPredClick(wxCommandEvent &event);
333 void OnSizeAutoButton(wxCommandEvent &event);
334 void OnSizeManualButton(wxCommandEvent &event);
335
336#if defined(__WXGTK__) || defined(__WXQT__)
337 void OnChooseFontColor(wxCommandEvent &event);
338#endif
339 void OnGLClicked(wxCommandEvent &event);
340 void OnOpenGLOptions(wxCommandEvent &event);
341 void OnDisplayCategoryRadioButton(wxCommandEvent &event);
342 void OnButtonClearClick(wxCommandEvent &event);
343 void OnButtonSelectClick(wxCommandEvent &event);
344 void OnButtonSetStd(wxCommandEvent &event);
345
346 void OnPageChange(wxListbookEvent &event);
347 void OnTopNBPageChange(wxNotebookEvent &event);
348 void OnSubNBPageChange(wxNotebookEvent &event);
349 void DoOnPageChange(size_t page);
350
351 wxString SelectSoundFile();
352 void OnButtonSelectSound(wxCommandEvent &event);
353 void OnButtonTestSound(wxCommandEvent &event);
354
355 void OnShowGpsWindowCheckboxClick(wxCommandEvent &event);
356 void OnZTCCheckboxClick(wxCommandEvent &event);
357 void OnRadarringSelect(wxCommandEvent &event);
358 void OnWaypointRangeRingSelect(wxCommandEvent &event);
359 void OnShipTypeSelect(wxCommandEvent &event);
360 void OnButtonGroups(wxCommandEvent &event);
361 void OnInsertTideDataLocation(wxCommandEvent &event);
362 void OnRemoveTideDataLocation(wxCommandEvent &event);
363 void OnCharHook(wxKeyEvent &event);
364 void OnChartsPageChange(wxListbookEvent &event);
365 void OnChartDirListSelect(wxCommandEvent &event);
366 void OnUnitsChoice(wxCommandEvent &event);
367
368 void UpdateWorkArrayFromDisplayPanel(void);
369 ArrayOfCDI GetSelectedChartDirs();
370 ArrayOfCDI GetUnSelectedChartDirs();
371 void SetDirActionButtons();
372
373 void OnCreateConfig(wxCommandEvent &event);
374 void OnEditConfig(wxCommandEvent &event);
375 void OnDeleteConfig(wxCommandEvent &event);
376 void OnApplyConfig(wxCommandEvent &event);
377 void SetConfigButtonState();
378 void ClearConfigList();
379 void BuildConfigList();
380 void OnConfigMouseSelected(wxMouseEvent &event);
381 void OnDialogInit(wxInitDialogEvent &event);
382
383 bool GetNeedNew() { return m_bneedNew; }
384 void SetNeedNew(bool bnew) { m_bneedNew = bnew; }
385 int GetScrollRate() { return m_scrollRate; }
386 void SetForceNewToolbarOnCancel(bool val) {
387 m_bForceNewToolbaronCancel = val;
388 }
389
390 wxArrayString *GetSerialArray() { return m_pSerialArray; }
391
392 // Should we show tooltips?
393 static bool ShowToolTips(void);
394
395#ifdef __OCPN__OPTIONS_USE_LISTBOOK__
396 wxListbook *m_pListbook;
397#else
398 wxNotebook *m_pListbook;
399#endif
400
401 wxBoxSizer *m_OK_Cancel_Apply_buttons;
402
403 size_t m_pageDisplay, m_pageConnections, m_pageCharts, m_pageShips;
404 size_t m_pageUI, m_pagePlugins;
405 int lastPage, lastSubPage;
406 wxPoint lastWindowPos;
407 wxSize lastWindowSize;
408 wxButton *m_ApplyButton, *m_OKButton, *m_CancelButton;
409
410 ChartGroupArray *m_pGroupArray;
411 int m_groups_changed;
412
413 // Sizer flags
414 wxSizerFlags inputFlags, verticleInputFlags, labelFlags, groupInputFlags;
415 wxSizerFlags groupLabelFlags, groupLabelFlagsHoriz;
416
417 // For general options
418 wxScrolledWindow *pDisplayPanel;
419 wxCheckBox *pShowStatusBar, *pShowMenuBar, *pShowChartBar, *pShowCompassWin;
420 wxCheckBox *pPrintShowIcon, *pCDOOutlines, *pSDepthUnits, *pSDisplayGrid;
421 wxCheckBox *pAutoAnchorMark, *pCDOQuilting, *pCBRaster, *pCBVector;
422 wxCheckBox *pCBCM93, *pCBLookAhead, *pSkewComp, *pOpenGL, *pSmoothPanZoom;
423 wxCheckBox *pFullScreenQuilt, *pMobile, *pResponsive, *pOverzoomEmphasis;
424 wxCheckBox *pOZScaleVector, *pToolbarAutoHideCB, *pInlandEcdis, *pRollover;
425 wxCheckBox *pZoomButtons, *pChartBarEX;
426 wxTextCtrl *pCOGUPUpdateSecs, *m_pText_OSCOG_Predictor, *pScreenMM;
427 wxTextCtrl *pToolbarHideSecs, *m_pText_OSHDT_Predictor, *m_pTxt_OwnMMSI;
428 // Radio buttons to control the date/time format.
429 // In the future, other date/time formats may be added here. For example:
430 // 1. Local Mean Time (LMT) at the location.
431 // 2. Custom timezone, such as for route planning purpose.
432
435 wxRadioButton *pTimezoneLocalTime;
437 wxRadioButton *pTimezoneUTC;
438 wxTextCtrl *pCmdSoundString;
439
440 wxChoice *m_pShipIconType, *m_pcTCDatasets;
441 wxSlider *m_pSlider_Zoom_Raster, *m_pSlider_GUI_Factor,
442 *m_pSlider_Chart_Factor, *m_pSlider_Ship_Factor, *m_pSlider_Text_Factor,
443 *m_pSlider_ENCText_Factor;
444 wxSlider *m_pMouse_Zoom_Slider;
445 wxSlider *m_pSlider_Zoom_Vector;
446 wxSlider *m_pSlider_CM93_Zoom;
447 // LIVE ETA OPTION
448 wxCheckBox *pSLiveETA;
449 wxTextCtrl *pSDefaultBoatSpeed;
450
451 wxRadioButton *pCBCourseUp, *pCBNorthUp, *pRBSizeAuto, *pRBSizeManual;
452 int k_tides;
453
454 // For the Display\Units page
455 wxStaticText *itemStaticTextUserVar;
456 wxStaticText *itemStaticTextUserVar2;
457 wxButton *m_configDeleteButton, *m_configApplyButton;
458
459 void OnAISRolloverClick(wxCommandEvent &event);
460 void UpdateChartDirList();
461
462 void OnCanvasConfigSelectClick(int ID, bool selected);
463
464 bool b_haveWMM;
465 bool b_oldhaveWMM;
466 ColorScheme m_cs;
467
468 // For "S57" page
469 wxBoxSizer *vectorPanel;
470 wxScrolledWindow *ps57Ctl;
471
472 OCPNCheckedListCtrl *ps57CtlListBox;
473
474 wxChoice *pDispCat, *pPointStyle, *pBoundStyle, *p24Color;
475 wxButton *itemButtonClearList, *itemButtonSelectList, *itemButtonSetStd;
476 wxCheckBox *pCheck_SOUNDG, *pCheck_META, *pCheck_SHOWIMPTEXT;
477 wxCheckBox *pCheck_SCAMIN, *pCheck_SuperSCAMIN;
478 wxCheckBox *pCheck_ATONTEXT, *pCheck_LDISTEXT;
479 wxCheckBox *pCheck_XLSECTTEXT, *pCheck_DECLTEXT, *pCheck_NATIONALTEXT;
480 wxCheckBox *pSEnableCM93Offset;
481 wxTextCtrl *m_ShallowCtl, *m_SafetyCtl, *m_DeepCtl;
482 wxStaticText *m_depthUnitsShal, *m_depthUnitsSafe, *m_depthUnitsDeep;
483 int k_vectorcharts;
484
485 // For "Units" page
486 wxChoice *pSDMMFormat, *pDistanceFormat, *pSpeedFormat, *pDepthUnitSelect,
487 *pTempFormat, *pWindSpeedFormat;
488 wxCheckBox *pCBTrueShow, *pCBMagShow;
489 wxTextCtrl *pMagVar;
490
491 // For "Charts" page
492 wxStaticBoxSizer *activeSizer;
493 wxBoxSizer *chartPanel;
494 wxTextCtrl *pSelCtl;
495
496 ArrayOfCDI ActiveChartArray;
497
498 wxStaticBox *itemActiveChartStaticBox;
499 wxCheckBox *pUpdateCheckBox, *pScanCheckBox;
500 wxButton *pParseENCButton;
501 wxButton *m_removeBtn, *m_compressBtn;
502 wxButton *m_migrateBtn;
503 int k_charts;
504 int m_nCharWidthMax;
505 wxBoxSizer *boxSizerCharts;
506 wxScrolledWindow *m_scrollWinChartList;
507 wxScrolledWindow *chartPanelWin;
508 wxBoxSizer *cmdButtonSizer;
509 wxStaticBox *loadedBox;
510 std::vector<OCPNChartDirPanel *> panelVector;
511 wxArrayString activeChartList;
512
513 // For the "Charts->Display Options" page
514 wxScrolledWindow *m_ChartDisplayPage;
515
516 // For the "AIS" page
517 wxCheckBox *m_pCheck_CPA_Max, *m_pCheck_CPA_Warn, *m_pCheck_CPA_WarnT;
518 wxCheckBox *m_pCheck_Mark_Lost, *m_pCheck_Remove_Lost;
519 wxCheckBox *m_pCheck_Show_COG, *m_pCheck_Sync_OCOG_ACOG;
520 wxCheckBox *m_pCheck_Show_Tracks, *m_pCheck_Hide_Moored,
521 *m_pCheck_Scale_Priority;
522 wxCheckBox *m_pCheck_AlertDialog, *m_pCheck_AlertAudio;
523 wxCheckBox *m_pCheck_Alert_Moored, *m_pCheck_Rollover_Class;
524 wxCheckBox *m_pCheck_Rollover_COG, *m_pCheck_Rollover_CPA;
525 wxCheckBox *m_pCheck_Ack_Timout, *m_pCheck_Show_Area_Notices;
526 wxCheckBox *m_pCheck_Draw_Target_Size, *m_pCheck_Draw_Realtime_Prediction;
527 wxCheckBox *m_pCheck_Show_Target_Name;
528 wxChoice *m_pWplAction;
529 wxCheckBox *m_pCheck_use_Wpl, *m_pCheck_ShowAllCPA;
530 wxTextCtrl *m_pText_CPA_Max, *m_pText_CPA_Warn, *m_pText_CPA_WarnT;
531 wxTextCtrl *m_pText_Mark_Lost, *m_pText_Remove_Lost, *m_pText_COG_Predictor;
532 wxTextCtrl *m_pText_Track_Length, *m_pText_Moored_Speed,
533 *m_pText_Scale_Priority;
534 wxTextCtrl *m_pText_ACK_Timeout, *m_pText_Show_Target_Name_Scale;
535 wxTextCtrl *m_pText_RealtPred_Speed;
536
537 // For Display->Configs page...
538 wxScrolledWindow *m_DisplayConfigsPage;
539
540 CanvasConfigSelect *m_sconfigSelect_single;
541 CanvasConfigSelect *m_sconfigSelect_twovertical;
542 wxStaticText *m_Text_def_boat_speed;
543
544 // For Configuration Template panel
545 wxScrolledWindow *m_scrollWinConfigList;
546 wxStaticText *m_templateTitleText;
547 wxStaticText *m_staticTextLastAppled;
548 wxStaticBoxSizer *m_templateStatusBoxSizer;
549
550 // For the ship page
551 wxFlexGridSizer *realSizes;
552 wxTextCtrl *m_pOSLength, *m_pOSWidth, *m_pOSGPSOffsetX, *m_pOSGPSOffsetY;
553 wxTextCtrl *m_pOSMinSize, *m_pText_ACRadius;
554 wxStaticBoxSizer *dispOptions, *dispWaypointOptions;
555 wxScrolledWindow *itemPanelShip, *itemPanelRoutes;
556 wxBoxSizer *ownShip, *Routes;
557 wxCheckBox *pShowshipToActive;
558 wxChoice *m_shipToActiveStyle, *m_shipToActiveColor;
559
560 OCPNIconCombo *pWaypointDefaultIconChoice;
561 OCPNIconCombo *pRoutepointDefaultIconChoice;
562 wxCheckBox *pScaMinChckB, *pScaMinOverruleChckB;
563 wxTextCtrl *m_pText_ScaMin;
564
565 // For the font page
566 wxBoxSizer *m_itemBoxSizerFontPanel;
567 wxChoice *m_itemFontElementListBox, *m_itemStyleListBox, *m_itemLangListBox;
568 wxStaticText *m_textSample;
569 bool m_bVisitLang;
570
571 // For "AIS Options"
572 wxComboBox *m_itemAISListBox;
573
574 // For "PlugIns" Panel
575 PluginListPanel *m_pPlugInCtrl;
576 AddPluginPanel *m_AddPluginPanel;
577 CatalogMgrPanel *m_PluginCatalogMgrPanel;
578 wxScrolledWindow *itemPanelPlugins;
579 wxBoxSizer *itemBoxSizerPanelPlugins;
580 wxFlexGridSizer *radarGrid, *waypointradarGrid;
581 wxChoice *pNavAidRadarRingsNumberVisible, *pWaypointRangeRingsNumber;
582 OCPNColourPickerCtrl *m_colourOwnshipRangeRingColour;
583 wxChoice *m_itemRadarRingsUnits, *m_itemWaypointRangeRingsUnits;
584 OCPNColourPickerCtrl *m_colourTrackLineColour;
585 ;
586 wxChoice *pTrackPrecision;
587 wxTextCtrl *pNavAidRadarRingsStep, *pWaypointRangeRingsStep;
588 wxCheckBox *pSogCogFromLLCheckBox;
589 wxSpinCtrl *pSogCogFromLLDampInterval;
590 wxTextCtrl *m_pText_TP_Secs, *m_pText_TP_Dist;
591 wxCheckBox *pWayPointPreventDragging, *pConfirmObjectDeletion;
592 wxCheckBox *pEnableZoomToCursor, *pPreserveScale, *pPlayShipsBells;
593 wxCheckBox *pEnableTenHertz, *pTransparentToolbar;
594 wxCheckBox *pAdvanceRouteWaypointOnArrivalOnly, *pTrackShowIcon;
595 wxCheckBox *pTrackDaily, *pTrackHighlite;
596 wxStaticText *pStatic_CallSign;
597
598#if wxCHECK_VERSION(2, 9, 0)
599#if wxUSE_TIMEPICKCTRL
600#ifdef __WXGTK__
601 TimeCtrl *pTrackRotateTime;
602#else
603 wxTimePickerCtrl *pTrackRotateTime;
604#endif
605#endif
606#endif
607 wxRadioButton *pTrackRotateComputerTime, *pTrackRotateUTC, *pTrackRotateLMT;
608 OCPNColourPickerCtrl *m_colourWaypointRangeRingsColour;
609 wxChoice *pSoundDeviceIndex;
610 wxStaticText *stSoundDeviceIndex;
611
612 wxArrayPtrVoid OBJLBoxArray;
613 wxString m_init_chart_dir;
614 wxArrayString *m_pSerialArray;
615
616 ArrayOfCDI m_CurrentDirList, *m_pWorkDirList;
617 MyConfig *m_pConfig;
618 wxWindow *pParent;
619
620 int k_plugins;
621 bool m_bForceNewToolbaronCancel;
622
623 // Sounds panel
624
625 OCPNSoundPanel *m_soundPanelAnchor;
626 OCPNSoundPanel *m_soundPanelAIS;
627 OCPNSoundPanel *m_soundPanelSART;
628 OCPNSoundPanel *m_soundPanelDSC;
629 void OnUXAudioEnableButtonClickAIS(wxCommandEvent &event);
630 void OnUXAudioEnableButtonClickSART(wxCommandEvent &event);
631 void OnUXAudioEnableButtonClickDSC(wxCommandEvent &event);
632
635 ObsListener m_sound_done_listener;
636
637private:
638 void Init(void);
639 void CreatePanel_MMSI(size_t parent, int border_size, int group_item_spacing);
640 void CreatePanel_AIS(size_t parent, int border_size, int group_item_spacing);
641 void CreatePanel_Ownship(size_t parent, int border_size,
642 int group_item_spacing);
643 void CreatePanel_NMEA(size_t parent, int border_size, int group_item_spacing);
644 void CreatePanel_ChartsLoad(size_t parent, int border_size,
645 int group_item_spacing);
646 void CreatePanel_VectorCharts(size_t parent, int border_size,
647 int group_item_spacing);
648 void CreatePanel_TidesCurrents(size_t parent, int border_size,
649 int group_item_spacing);
650 void CreatePanel_ChartGroups(size_t parent, int border_size,
651 int group_item_spacing);
652 void CreatePanel_Display(size_t parent, int border_size,
653 int group_item_spacing);
654 void CreatePanel_UI(size_t parent, int border_size, int group_item_spacing);
655 void CreatePanel_Units(size_t parent, int border_size,
656 int group_item_spacing);
657 void CreatePanel_Sounds(size_t parent, int border_size,
658 int group_item_spacing);
659 void CreatePanel_Advanced(size_t parent, int border_size,
660 int group_item_spacing);
661 void CreatePanel_Configs(size_t parent, int border_size,
662 int group_item_spacing);
663 void CreatePanel_Routes(size_t parent, int border_size,
664 int group_item_spacing);
665
666 void OnAlertEnableButtonClick(wxCommandEvent &event);
667 void OnAlertAudioEnableButtonClick(wxCommandEvent &event);
668 void OnResetFont(wxCommandEvent &event);
669
670 void UpdateTemplateTitleText();
671 void CheckDeviceAccess(wxString &path);
672 int m_returnChanges;
673 wxListCtrl *tcDataSelected;
674 std::vector<int> marinersStdXref;
675 ChartGroupsUI *groupsPanel;
676 wxImageList *m_topImgList;
677
678 wxCheckBox *m_persist_active_route_chkbox;
679 wxScrolledWindow *m_pNMEAForm;
680 void resetMarStdList(bool bsetConfig, bool bsetStd);
681
682 ObservableListener compat_os_listener;
683 void ApplyChanges(wxCommandEvent &event);
684
685 unsigned int m_screenConfig;
686
687 wxNotebookPage *m_groupsPage;
688 wxFont *dialogFont;
689 wxFont smallFont;
690 // wxFont *dialogFont;
691 wxSize m_small_button_size;
692
693 bool m_bcompact;
694 int m_fontHeight, m_scrollRate;
695 bool m_bfontChanged;
696 wxArrayString m_font_element_array;
697
698 bool m_bVectorInit;
699
700 wxBoxSizer *m_boxSizerConfigs;
701 wxColour m_panelBackgroundUnselected;
702 wxString m_selectedConfigPanelGUID;
703 wxSize m_colourPickerDefaultSize;
704
705 wxSize m_sliderSize;
706 bool m_bneedNew;
707
708 std::shared_ptr<ConnectionsDlg> comm_dialog;
709
710 DECLARE_EVENT_TABLE()
711};
712
713class CanvasConfigSelect : public wxPanel {
714public:
715 CanvasConfigSelect(wxWindow *parent, options *parentOptions, int id,
716 wxBitmap &bmp, const wxPoint &pos = wxDefaultPosition,
717 const wxSize &size = wxDefaultSize);
719
720 void OnMouseSelected(wxMouseEvent &event);
721 void SetSelected(bool selected);
722 void OnPaint(wxPaintEvent &event);
723
724 bool GetSelected() { return m_bSelected; }
725
726private:
727 options *m_parentOptions;
728 bool m_bSelected;
729 wxColour m_boxColour;
730 wxBitmap m_bmpNormal;
731 int m_borderWidth;
732
733 DECLARE_EVENT_TABLE()
734};
735
736class ChartGroupsUI : public wxScrolledWindow {
737public:
738 ChartGroupsUI(wxWindow *parent);
739 ~ChartGroupsUI(void);
740
741 void CreatePanel(size_t parent, int border_size, int group_item_spacing);
742 void CompletePanel(void);
743 void SetDBDirs(ArrayOfCDI &array) { m_db_dirs = array; }
744 void SetGroupArray(ChartGroupArray *pGroupArray) {
745 m_pGroupArray = pGroupArray;
746 }
747 void SetInitialSettings(void);
748 void CompleteInitialSettings(void);
749 void PopulateTrees(void);
750 void PopulateTreeCtrl(wxTreeCtrl *ptc, const wxArrayString &dir_array,
751 const wxColour &col, wxFont *pFont = NULL);
752 void BuildNotebookPages(ChartGroupArray *pGroupArray);
753 void EmptyChartGroupArray(ChartGroupArray *s);
754 void ClearGroupPages();
755
756 void OnNodeExpanded(wxTreeEvent &event);
757 void OnAvailableSelection(wxTreeEvent &event);
758 void OnInsertChartItem(wxCommandEvent &event);
759 void OnRemoveChartItem(wxCommandEvent &event);
760 void OnGroupPageChange(wxNotebookEvent &event);
761 void OnNewGroup(wxCommandEvent &event);
762 void OnDeleteGroup(wxCommandEvent &event);
763
764 ChartGroupArray *CloneChartGroupArray(ChartGroupArray *s);
765 wxTreeCtrl *AddEmptyGroupPage(const wxString &label);
766
767 bool modified, m_UIcomplete, m_settingscomplete, m_treespopulated;
768
769 wxScrolledWindow *m_panel;
770
771private:
772 int FindGroupBranch(ChartGroup *pGroup, wxTreeCtrl *ptree, wxTreeItemId item,
773 wxString *pbranch_adder);
774
775 wxWindow *pParent;
776 wxFlexGridSizer *groupsSizer;
777 wxButton *m_pAddButton, *m_pRemoveButton, *m_pNewGroupButton;
778 wxButton *m_pDeleteGroupButton;
779 wxGenericDirCtrl *allAvailableCtl, *defaultAllCtl;
780 wxTreeCtrl *m_pActiveChartsTree, *lastSelectedCtl;
781 wxTreeItemId lastDeletedItem;
782 wxNotebook *m_GroupNB;
783 wxFont *iFont;
784 wxFont *dialogFont;
785
786 ArrayOfCDI m_db_dirs;
787 ArrayOfDirCtrls m_DirCtrlArray;
788 ChartGroupArray *m_pGroupArray;
789
790 int m_border_size, m_group_item_spacing, m_GroupSelectedPage;
791
792 wxBoxSizer *m_topSizer;
793
794 DECLARE_EVENT_TABLE()
795};
796
797#ifdef ocpnUSE_GL
798class OpenGLOptionsDlg : private Uncopyable, public wxDialog {
799public:
800 explicit OpenGLOptionsDlg(wxWindow *parent);
801 bool GetAcceleratedPanning(void) const;
802 bool GetTextureCompression(void) const;
803 bool GetPolygonSmoothing(void) const;
804 bool GetLineSmoothing(void) const;
805 bool GetSoftwareGL(void) const;
806 bool GetTextureCompressionCaching(void) const;
807 bool GetRebuildCache(void) const;
808 int GetTextureMemorySize(void) const;
809
810private:
811 void Populate(void);
812 void OnButtonRebuild(wxCommandEvent &event);
813 void OnButtonClear(wxCommandEvent &event);
814 wxString GetTextureCacheSize(void);
815
816 wxCheckBox *m_cbUseAcceleratedPanning, *m_cbTextureCompression;
817 wxCheckBox *m_cbTextureCompressionCaching, *m_cbSoftwareGL,
818 *m_cbPolygonSmoothing, *m_cbLineSmoothing;
819 wxSpinCtrl *m_sTextureDimension, *m_sTextureMemorySize;
820 wxStaticText *m_cacheSize, *m_memorySize;
821
822 bool m_brebuild_cache;
823
824 DECLARE_EVENT_TABLE()
825};
826#endif
827
828#define ID_MMSI_PROPS_LIST 10073
829
830enum {
831 mlMMSI = 0,
832 mlTrackMode,
833 mlIgnore,
834 mlMOB,
835 mlVDM,
836 mlFollower,
837 mlShipName
838}; // MMSIListCtrl Columns;
839
840class MMSIListCtrl : private Uncopyable, public wxListCtrl {
841public:
842 explicit MMSIListCtrl(wxWindow *parent, wxWindowID id, const wxPoint &pos,
843 const wxSize &size, long style);
844 ~MMSIListCtrl(void);
845
846 wxString OnGetItemText(long item, long column) const;
847 void OnListItemClick(wxListEvent &event);
848 void OnListItemActivated(wxListEvent &event);
849 void OnListItemRightClick(wxListEvent &event);
850 void PopupMenuHandler(wxCommandEvent &event);
851
852 wxWindow *m_parent;
853 int m_context_item;
854
855 DECLARE_EVENT_TABLE()
856};
857
858#define ID_MMSIEDIT_OK 8191
859#define ID_MMSIEDIT_CANCEL 8192
860#define ID_MMSI_CTL 8193
861#define ID_DEF_MENU_MMSI_EDIT 8194
862#define ID_DEF_MENU_MMSI_DELETE 8195
863
864class MMSIEditDialog : private Uncopyable, public wxDialog {
865public:
866 explicit MMSIEditDialog(MmsiProperties *props, wxWindow *parent,
867 wxWindowID id = wxID_ANY,
868 const wxString &caption = wxEmptyString,
869 const wxPoint &pos = wxDefaultPosition,
870 const wxSize &size = wxDefaultSize, long style = 0);
871 ~MMSIEditDialog(void);
872
873 void SetColorScheme(ColorScheme cs);
874 void CreateControls(void);
875 void OnMMSIEditCancelClick(wxCommandEvent &event);
876 void OnMMSIEditOKClick(wxCommandEvent &event);
877 void OnCtlUpdated(wxCommandEvent &event);
878 void OnMMSIChanged(wxCommandEvent &event);
879
880 MmsiProperties *m_props;
881 wxTextCtrl *m_MMSICtl, *m_ShipNameCtl; // Has ToDo take away?
882 wxRadioButton *m_rbTypeTrackDefault, *m_rbTypeTrackAlways;
883 wxRadioButton *m_rbTypeTrackNever;
884 wxCheckBox *m_cbTrackPersist, *m_IgnoreButton, *m_MOBButton, *m_VDMButton,
885 *m_FollowerButton;
886 wxButton *m_CancelButton, *m_OKButton;
887
888private:
889 void Persist();
890
891 DECLARE_EVENT_TABLE()
892};
893
894class MMSI_Props_Panel : private Uncopyable, public wxPanel {
895public:
896 explicit MMSI_Props_Panel(wxWindow *parent);
898
899 void OnNewButton(wxCommandEvent &event);
900 void SetColorScheme(ColorScheme cs);
901 void UpdateMMSIList(void);
902
903 MMSIListCtrl *m_pListCtrlMMSI;
904 wxButton *m_pButtonNew;
905
906private:
907 wxWindow *m_pparent;
908};
909
910class ConfigCreateDialog : private Uncopyable, public wxDialog {
911public:
912 explicit ConfigCreateDialog(wxWindow *parent, wxWindowID id = wxID_ANY,
913 const wxString &caption = wxEmptyString,
914 const wxPoint &pos = wxDefaultPosition,
915 const wxSize &size = wxDefaultSize,
916 long style = 0);
918
919 void SetColorScheme(ColorScheme cs);
920 void CreateControls(void);
921 void OnConfigEditCancelClick(wxCommandEvent &event);
922 void OnConfigEditOKClick(wxCommandEvent &event);
923 wxString GetCreatedTemplateGUID() { return m_createdTemplateGUID; }
924
925 wxTextCtrl *m_TitleCtl, *m_DescriptionCtl;
926 wxButton *m_CancelButton, *m_OKButton;
927 wxString m_createdTemplateGUID;
928 DECLARE_EVENT_TABLE()
929};
930
931#endif
932// _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:437
EventVar m_on_sound_done
Notified with a OCPN_Sound* pointer when sound has completed.
Definition options.h:634
wxRadioButton * pTimezoneLocalTime
Specify date/time should be formatted in timezone as configured in the operating system.
Definition options.h:435
The ConnectionsDlg class.