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
37class GoToPositionDialog; // forward
38extern GoToPositionDialog* pGoToPositionDialog;
44#define ID_GOTOPOS 8100
45#define SYMBOL_GOTOPOS_STYLE \
46 wxCAPTION | wxRESIZE_BORDER | wxSYSTEM_MENU | wxCLOSE_BOX
47#define SYMBOL_GOTOPOS_TITLE _("Center view")
48#define SYMBOL_GOTOPOS_IDNAME ID_GOTOPOS
49#define SYMBOL_GOTOPOS_SIZE wxSize(200, 300)
50#define SYMBOL_GOTOPOS_POSITION wxDefaultPosition
51#define ID_GOTOPOS_CANCEL 8101
52#define ID_GOTOPOS_OK 8102
53
55
59class GoToPositionDialog : public wxDialog {
60 DECLARE_EVENT_TABLE()
61
62public:
65 GoToPositionDialog(wxWindow* parent, wxWindowID id = SYMBOL_GOTOPOS_IDNAME,
66 const wxString& caption = SYMBOL_GOTOPOS_TITLE,
67 const wxPoint& pos = SYMBOL_GOTOPOS_POSITION,
68 const wxSize& size = SYMBOL_GOTOPOS_SIZE,
69 long style = SYMBOL_GOTOPOS_STYLE);
70
72
74 bool Create(wxWindow* parent, wxWindowID id = SYMBOL_GOTOPOS_IDNAME,
75 const wxString& caption = SYMBOL_GOTOPOS_TITLE,
76 const wxPoint& pos = SYMBOL_GOTOPOS_POSITION,
77 const wxSize& size = SYMBOL_GOTOPOS_SIZE,
78 long style = SYMBOL_GOTOPOS_STYLE);
79
80 void SetCanvas(ChartCanvas* canvas) { m_hostCanvas = canvas; }
81 void SetColorScheme(ColorScheme cs);
82
83 void CreateControls();
84
85 void OnGoToPosCancelClick(wxCommandEvent& event);
86 void OnGoToPosOkClick(wxCommandEvent& event);
87 void OnPositionCtlUpdated(wxCommandEvent& event);
88 void CheckPasteBufferForPosition();
89
91 static bool ShowToolTips();
92
93 wxTextCtrl* m_MarkLatCtl;
94 wxTextCtrl* m_MarkLonCtl;
95 wxButton* m_CancelButton;
96 wxButton* m_OKButton;
97
98 double m_lat_save;
99 double m_lon_save;
100 ChartCanvas* m_hostCanvas;
101};
102
103#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?