OpenCPN Partial API docs
Loading...
Searching...
No Matches
ais_target_query_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
24#ifndef __AISTARGETQUERYDIALOG_H__
25#define __AISTARGETQUERYDIALOG_H__
26
27#include <wx/frame.h>
28#include <wx/html/htmlwin.h>
29#include <wx/sizer.h>
30
31#include "model/ais_target_data.h"
32#include "model/ocpn_types.h"
33#include "color_types.h"
34
35class AISTargetQueryDialog; // forward
37
38#define AIS_TARGET_QUERY_STYLE wxDEFAULT_FRAME_STYLE | wxFRAME_FLOAT_ON_PARENT
39
44class AISTargetQueryDialog : public wxFrame {
45 DECLARE_CLASS(AISTargetQueryDialog)
46 DECLARE_EVENT_TABLE()
47public:
49
51 AISTargetQueryDialog(wxWindow* parent, wxWindowID id = wxID_ANY,
52 const wxString& caption = _("Object Query"),
53 const wxPoint& pos = wxDefaultPosition,
54 const wxSize& size = wxDefaultSize,
55 long style = AIS_TARGET_QUERY_STYLE);
56
59 void Init();
60
62 bool Create(wxWindow* parent, wxWindowID id = wxID_ANY,
63 const wxString& caption = _("Object Query"),
64 const wxPoint& pos = wxDefaultPosition,
65 const wxSize& size = wxDefaultSize,
66 long style = AIS_TARGET_QUERY_STYLE);
67
68 void OnClose(wxCloseEvent& event);
69 void OnIdOKClick(wxCommandEvent& event);
70 void OnIdWptCreateClick(wxCommandEvent& event);
71 void OnIdTrkCreateClick(wxCommandEvent& event);
72 void OnMove(wxMoveEvent& event);
73 void OnSize(wxSizeEvent& event);
74 void AdjustBestSize(AisTargetData* td);
75 void CreateControls();
76 void RenderHTMLQuery(AisTargetData* td);
77 void OnKey(wxKeyEvent& ke);
78
79 void SetText(const wxString& text_string);
80 void SetColorScheme(ColorScheme cs);
81
82 void RecalculateSize(void);
83 void SetAutoCentre(bool bval) { m_bautoCentre = bval; }
84 void SetAutoSize(bool bval) { m_bautosize = bval; }
85
86 void UpdateText(void);
87 void SetMMSI(int mmsi);
88 int GetMMSI(void) { return m_MMSI; }
89
90 // Data
91 int m_MMSI;
92 wxHtmlWindow* m_pQueryTextCtl;
93 ColorScheme m_colorscheme;
94 wxBoxSizer* m_pboxSizer;
95 int m_nl;
96 wxButton* m_okButton;
97 wxButton* m_createWptBtn;
98 wxButton* m_createTrkBtn;
99 int m_adjustedFontSize;
100 int m_control_font_size;
101 wxFont* m_basefont;
102 wxWindow* m_parent;
103 bool m_bautoCentre;
104 bool m_bautosize;
105};
106
107#endif
AISTargetQueryDialog * g_pais_query_dialog_active
Global instance.
Dialog for querying detailed information about an AIS target.
AISTargetQueryDialog()
Constructors.
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &caption=_("Object Query"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=AIS_TARGET_QUERY_STYLE)
Creation.
void Init()
Initialise our variables.