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 bool Create(int target_mmsi, wxWindow* parent, AisDecoder* pdecoder,
70 bool b_jumpto, bool b_createWP, bool b_ack,
71 wxWindowID id = wxID_ANY,
72 const wxString& caption = _("OpenCPN AIS Alert"),
73 const wxPoint& pos = wxDefaultPosition,
74 const wxSize& size = wxDefaultSize,
75 long style = wxCAPTION | wxRESIZE_BORDER | wxSYSTEM_MENU);
76 void Init();
77
78 int Get_Dialog_MMSI(void) { return m_target_mmsi; }
79 void UpdateText();
80 void RecalculateSize(void);
81
82 wxDateTime dtAlertExpireTime;
83
84private:
85 void CreateControls();
86 bool GetAlertText(void);
87 void SetColorScheme(void);
88 void OnClose(wxCloseEvent& event);
89 void OnIdAckClick(wxCommandEvent& event);
90 void OnMove(wxMoveEvent& event);
91 void OnSize(wxSizeEvent& event);
92 void OnIdSilenceClick(wxCommandEvent& event);
93 void OnIdJumptoClick(wxCommandEvent& event);
94 void OnIdCreateWPClick(wxCommandEvent& event);
95
96 wxWindow* m_pParent;
97 wxHtmlWindow* m_pAlertTextCtl;
98 int m_target_mmsi;
99 AisDecoder* m_pdecoder;
100 wxFont* m_pFont;
101 wxString m_alert_text;
102 bool m_bjumpto;
103 bool m_back;
104 bool m_bcreateWP;
105 int m_max_nline;
106 int m_adj_height;
107 bool m_bsizeSet;
108};
109
110#endif
Dialog for displaying AIS target alerts.