OpenCPN Partial API docs
Loading...
Searching...
No Matches
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
34class 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
56class GoToPositionDialog : public wxDialog {
57 DECLARE_EVENT_TABLE()
58
59public:
62 GoToPositionDialog(wxWindow* parent, wxWindowID id = SYMBOL_GOTOPOS_IDNAME,
63 const wxString& caption = SYMBOL_GOTOPOS_TITLE,
64 const wxPoint& pos = SYMBOL_GOTOPOS_POSITION,
65 const wxSize& size = SYMBOL_GOTOPOS_SIZE,
66 long style = SYMBOL_GOTOPOS_STYLE);
67
69
71 bool Create(wxWindow* parent, wxWindowID id = SYMBOL_GOTOPOS_IDNAME,
72 const wxString& caption = SYMBOL_GOTOPOS_TITLE,
73 const wxPoint& pos = SYMBOL_GOTOPOS_POSITION,
74 const wxSize& size = SYMBOL_GOTOPOS_SIZE,
75 long style = SYMBOL_GOTOPOS_STYLE);
76
77 void SetCanvas(ChartCanvas* canvas) { m_hostCanvas = canvas; }
78 void SetColorScheme(ColorScheme cs);
79
80 void CreateControls();
81
82 void OnGoToPosCancelClick(wxCommandEvent& event);
83 void OnGoToPosOkClick(wxCommandEvent& event);
84 void OnPositionCtlUpdated(wxCommandEvent& event);
85 void CheckPasteBufferForPosition();
86
88 static bool ShowToolTips();
89
90 wxTextCtrl* m_MarkLatCtl;
91 wxTextCtrl* m_MarkLonCtl;
92 wxButton* m_CancelButton;
93 wxButton* m_OKButton;
94
95 double m_lat_save;
96 double m_lon_save;
97 ChartCanvas* m_hostCanvas;
98};
99
100#endif
Chart display canvas.
Definition chcanv.h:135
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?