OpenCPN Partial API docs
Loading...
Searching...
No Matches
AISTargetAlertDialog.h
1/***************************************************************************
2 *
3 * Project: OpenCPN
4 *
5 ***************************************************************************
6 * Copyright (C) 2010 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 __AISTARGETALERTDIALOG_H__
26#define __AISTARGETALERTDIALOG_H__
27
28#include <wx/dialog.h>
29
30#define ID_ACKNOWLEDGE 10001
31#define ID_SILENCE 10002
32#define ID_JUMPTO 10004
33#define ID_WPT_CREATE 10005
34
35class AisDecoder;
36class wxHtmlWindow;
37
38class OCPN_AlertDialog : public wxDialog {
39 DECLARE_CLASS(OCPN_AlertDialog)
40 DECLARE_EVENT_TABLE()
41public:
43
44 virtual ~OCPN_AlertDialog();
45 virtual void Init();
46
47 virtual bool Create(wxWindow* parent, wxWindowID id = wxID_ANY,
48 const wxString& caption = _("OpenCPN Alert"),
49 const wxPoint& pos = wxDefaultPosition,
50 const wxSize& size = wxDefaultSize,
51 long style = wxCAPTION | wxRESIZE_BORDER | wxSYSTEM_MENU);
52
53private:
54 wxWindow* m_pparent;
55};
56
63 DECLARE_CLASS(AISTargetAlertDialog)
64 DECLARE_EVENT_TABLE()
65public:
67
69 using OCPN_AlertDialog::Create;
70 bool Create(int target_mmsi, wxWindow* parent, AisDecoder* pdecoder,
71 bool b_jumpto, bool b_createWP, bool b_ack,
72 wxWindowID id = wxID_ANY,
73 const wxString& caption = _("OpenCPN AIS Alert"),
74 const wxPoint& pos = wxDefaultPosition,
75 const wxSize& size = wxDefaultSize,
76 long style = wxCAPTION | wxRESIZE_BORDER | wxSYSTEM_MENU);
77 void Init();
78
79 int Get_Dialog_MMSI(void) { return m_target_mmsi; }
80 void UpdateText();
81 void RecalculateSize(void);
82
83 wxDateTime dtAlertExpireTime;
84
85private:
86 void CreateControls();
87 bool GetAlertText(void);
88 void SetColorScheme(void);
89 void OnClose(wxCloseEvent& event);
90 void OnIdAckClick(wxCommandEvent& event);
91 void OnMove(wxMoveEvent& event);
92 void OnSize(wxSizeEvent& event);
93 void OnIdSilenceClick(wxCommandEvent& event);
94 void OnIdJumptoClick(wxCommandEvent& event);
95 void OnIdCreateWPClick(wxCommandEvent& event);
96
97 wxWindow* m_pParent;
98 wxHtmlWindow* m_pAlertTextCtl;
99 int m_target_mmsi;
100 AisDecoder* m_pdecoder;
101 wxFont* m_pFont;
102 wxString m_alert_text;
103 bool m_bjumpto;
104 bool m_back;
105 bool m_bcreateWP;
106 int m_max_nline;
107 int m_adj_height;
108 bool m_bsizeSet;
109};
110
111#endif
Dialog for displaying AIS target alerts.