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