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