OpenCPN Partial API docs
GoToPositionDialog.h
1 /******************************************************************************
2  *
3  * Project: OpenCPN
4  *
5  ***************************************************************************
6  * Copyright (C) 2013 by David S. Register *
7  * *
8  * This program is free software; you can redistribute it and/or modify *
9  * it under the terms of the GNU General Public License as published by *
10  * the Free Software Foundation; either version 2 of the License, or *
11  * (at your option) any later version. *
12  * *
13  * This program is distributed in the hope that it will be useful, *
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16  * GNU General Public License for more details. *
17  * *
18  * You should have received a copy of the GNU General Public License *
19  * along with this program; if not, write to the *
20  * Free Software Foundation, Inc., *
21  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
22  ***************************************************************************
23  */
24 
25 #ifndef __GOTOPOSITIONDIALOG_H__
26 #define __GOTOPOSITIONDIALOG_H__
27 
28 #include <wx/dialog.h>
29 #include <wx/textctrl.h>
30 
31 #include "model/ocpn_types.h"
32 #include "color_types.h"
33 
34 class ChartCanvas;
35 
41 #define ID_GOTOPOS 8100
42 #define SYMBOL_GOTOPOS_STYLE \
43  wxCAPTION | wxRESIZE_BORDER | wxSYSTEM_MENU | wxCLOSE_BOX
44 #define SYMBOL_GOTOPOS_TITLE _("Center view")
45 #define SYMBOL_GOTOPOS_IDNAME ID_GOTOPOS
46 #define SYMBOL_GOTOPOS_SIZE wxSize(200, 300)
47 #define SYMBOL_GOTOPOS_POSITION wxDefaultPosition
48 #define ID_GOTOPOS_CANCEL 8101
49 #define ID_GOTOPOS_OK 8102
50 
52 
56 class GoToPositionDialog : public wxDialog {
57  DECLARE_DYNAMIC_CLASS(GoToPositionDialog)
58  DECLARE_EVENT_TABLE()
59 
60 public:
63  GoToPositionDialog(wxWindow* parent, wxWindowID id = SYMBOL_GOTOPOS_IDNAME,
64  const wxString& caption = SYMBOL_GOTOPOS_TITLE,
65  const wxPoint& pos = SYMBOL_GOTOPOS_POSITION,
66  const wxSize& size = SYMBOL_GOTOPOS_SIZE,
67  long style = SYMBOL_GOTOPOS_STYLE);
68 
70 
72  bool Create(wxWindow* parent, wxWindowID id = SYMBOL_GOTOPOS_IDNAME,
73  const wxString& caption = SYMBOL_GOTOPOS_TITLE,
74  const wxPoint& pos = SYMBOL_GOTOPOS_POSITION,
75  const wxSize& size = SYMBOL_GOTOPOS_SIZE,
76  long style = SYMBOL_GOTOPOS_STYLE);
77 
78  void SetCanvas(ChartCanvas* canvas) { m_hostCanvas = canvas; }
79  void SetColorScheme(ColorScheme cs);
80 
81  void CreateControls();
82 
83  void OnGoToPosCancelClick(wxCommandEvent& event);
84  void OnGoToPosOkClick(wxCommandEvent& event);
85  void OnPositionCtlUpdated(wxCommandEvent& event);
86  void CheckPasteBufferForPosition();
87 
89  static bool ShowToolTips();
90 
91  wxTextCtrl* m_MarkLatCtl;
92  wxTextCtrl* m_MarkLonCtl;
93  wxButton* m_CancelButton;
94  wxButton* m_OKButton;
95 
96  double m_lat_save;
97  double m_lon_save;
98  ChartCanvas* m_hostCanvas;
99 };
100 
101 #endif
bool Create(wxWindow *parent, wxWindowID id=SYMBOL_GOTOPOS_IDNAME, const wxString &caption=SYMBOL_GOTOPOS_TITLE, const wxPoint &pos=SYMBOL_GOTOPOS_POSITION, const wxSize &size=SYMBOL_GOTOPOS_SIZE, long style=SYMBOL_GOTOPOS_STYLE)
Creation.
GoToPositionDialog()
Constructors.
static bool ShowToolTips()
Should we show tooltips?