OpenCPN Partial API docs
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 
35 class wxHtmlWindow;
36 class AisTargetData;
37 
38 class AISTargetQueryDialog : public wxFrame {
39  DECLARE_CLASS(AISTargetQueryDialog)
40  DECLARE_EVENT_TABLE()
41 public:
43 
45  AISTargetQueryDialog(wxWindow* parent, wxWindowID id = wxID_ANY,
46  const wxString& caption = _("Object Query"),
47  const wxPoint& pos = wxDefaultPosition,
48  const wxSize& size = wxDefaultSize,
49  long style = AIS_TARGET_QUERY_STYLE);
50 
53  void Init();
54 
56  bool Create(wxWindow* parent, wxWindowID id = wxID_ANY,
57  const wxString& caption = _("Object Query"),
58  const wxPoint& pos = wxDefaultPosition,
59  const wxSize& size = wxDefaultSize,
60  long style = AIS_TARGET_QUERY_STYLE);
61 
62  void OnClose(wxCloseEvent& event);
63  void OnIdOKClick(wxCommandEvent& event);
64  void OnIdWptCreateClick(wxCommandEvent& event);
65  void OnIdTrkCreateClick(wxCommandEvent& event);
66  void OnMove(wxMoveEvent& event);
67  void OnSize(wxSizeEvent& event);
68  void AdjustBestSize(AisTargetData* td);
69  void CreateControls();
70  void RenderHTMLQuery(AisTargetData* td);
71  void OnKey(wxKeyEvent& ke);
72 
73  void SetText(const wxString& text_string);
74  void SetColorScheme(ColorScheme cs);
75 
76  void RecalculateSize(void);
77  void SetAutoCentre(bool bval) { m_bautoCentre = bval; }
78  void SetAutoSize(bool bval) { m_bautosize = bval; }
79 
80  void UpdateText(void);
81  void SetMMSI(int mmsi);
82  int GetMMSI(void) { return m_MMSI; }
83 
84  // Data
85  int m_MMSI;
86  wxHtmlWindow* m_pQueryTextCtl;
87  ColorScheme m_colorscheme;
88  wxBoxSizer* m_pboxSizer;
89  int m_nl;
90  wxButton* m_okButton;
91  wxButton* m_createWptBtn;
92  wxButton* m_createTrkBtn;
93  int m_adjustedFontSize;
94  int m_control_font_size;
95  wxFont* m_basefont;
96  wxWindow* m_parent;
97  bool m_bautoCentre;
98  bool m_bautosize;
99 };
100 
101 #endif
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.