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