OpenCPN Partial API docs
Loading...
Searching...
No Matches
ais_target_alert_dlg.h
Go to the documentation of this file.
1/**************************************************************************
2 * Copyright (C) 2010 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
18#ifndef __AISTARGETALERTDIALOG_H__
19#define __AISTARGETALERTDIALOG_H__
20
27#include <wx/dialog.h>
28#include <wx/html/htmlwin.h>
29
30#include "model/ais_decoder.h"
31
32#define ID_ACKNOWLEDGE 10001
33#define ID_SILENCE 10002
34#define ID_JUMPTO 10004
35#define ID_WPT_CREATE 10005
36
37class OCPN_AlertDialog : public wxDialog {
38 DECLARE_CLASS(OCPN_AlertDialog)
39 DECLARE_EVENT_TABLE()
40public:
42
43 virtual ~OCPN_AlertDialog();
44 virtual void Init();
45
46 virtual bool Create(wxWindow* parent, wxWindowID id = wxID_ANY,
47 const wxString& caption = _("OpenCPN Alert"),
48 const wxPoint& pos = wxDefaultPosition,
49 const wxSize& size = wxDefaultSize,
50 long style = wxCAPTION | wxRESIZE_BORDER | wxSYSTEM_MENU);
51
52private:
53 wxWindow* m_pparent;
54};
55
62 DECLARE_CLASS(AISTargetAlertDialog)
63 DECLARE_EVENT_TABLE()
64public:
66
68 using OCPN_AlertDialog::Create;
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
Class AisDecoder and helpers.
Dialog for displaying AIS target alerts.