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