OpenCPN Partial API docs
Loading...
Searching...
No Matches
go_to_position_dlg.h
Go to the documentation of this file.
1/**************************************************************************
2 * Copyright (C) 2013 by David S. Register *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, see <https://www.gnu.org/licenses/>. *
16 ***************************************************************************/
17
24#ifndef __GOTOPOSITIONDIALOG_H__
25#define __GOTOPOSITIONDIALOG_H__
26
27#include <wx/dialog.h>
28#include <wx/textctrl.h>
29
30#include "model/ocpn_types.h"
31#include "color_types.h"
32
33class ChartCanvas;
34
36class GoToPositionDialog; // forward
43#define ID_GOTOPOS 8100
44#define SYMBOL_GOTOPOS_STYLE \
45 wxCAPTION | wxRESIZE_BORDER | wxSYSTEM_MENU | wxCLOSE_BOX
46#define SYMBOL_GOTOPOS_TITLE _("Center view")
47#define SYMBOL_GOTOPOS_IDNAME ID_GOTOPOS
48#define SYMBOL_GOTOPOS_SIZE wxSize(200, 300)
49#define SYMBOL_GOTOPOS_POSITION wxDefaultPosition
50#define ID_GOTOPOS_CANCEL 8101
51#define ID_GOTOPOS_OK 8102
52
54
58class GoToPositionDialog : public wxDialog {
59 DECLARE_EVENT_TABLE()
60
61public:
64 GoToPositionDialog(wxWindow* parent, wxWindowID id = SYMBOL_GOTOPOS_IDNAME,
65 const wxString& caption = SYMBOL_GOTOPOS_TITLE,
66 const wxPoint& pos = SYMBOL_GOTOPOS_POSITION,
67 const wxSize& size = SYMBOL_GOTOPOS_SIZE,
68 long style = SYMBOL_GOTOPOS_STYLE);
69
71
73 bool Create(wxWindow* parent, wxWindowID id = SYMBOL_GOTOPOS_IDNAME,
74 const wxString& caption = SYMBOL_GOTOPOS_TITLE,
75 const wxPoint& pos = SYMBOL_GOTOPOS_POSITION,
76 const wxSize& size = SYMBOL_GOTOPOS_SIZE,
77 long style = SYMBOL_GOTOPOS_STYLE);
78
79 void SetCanvas(ChartCanvas* canvas) { m_hostCanvas = canvas; }
80 void SetColorScheme(ColorScheme cs);
81
82 void CreateControls();
83
84 void OnGoToPosCancelClick(wxCommandEvent& event);
85 void OnGoToPosOkClick(wxCommandEvent& event);
86 void OnPositionCtlUpdated(wxCommandEvent& event);
87 void CheckPasteBufferForPosition();
88
90 static bool ShowToolTips();
91
92 wxTextCtrl* m_MarkLatCtl;
93 wxTextCtrl* m_MarkLonCtl;
94 wxButton* m_CancelButton;
95 wxButton* m_OKButton;
96
97 double m_lat_save;
98 double m_lon_save;
99 ChartCanvas* m_hostCanvas;
100};
101
102#endif
ChartCanvas - Main chart display and interaction component.
Definition chcanv.h:151
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?
GoToPositionDialog * pGoToPositionDialog
Global instance.