1 /****************************************************************************** 2 * 3 * Project: OpenCPN 4 * 5 *************************************************************************** 6 * Copyright (C) 2013 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 __S57QUERYDIALOG_H__ 26 #define __S57QUERYDIALOG_H__ 27 28 #include <wx/frame.h> 29 #include <wx/html/htmlwin.h> 30 31 class wxHtmlWindow; 32 33 class S57QueryDialog: public wxFrame 34 { 35 DECLARE_CLASS( S57QueryDialog ) 36 DECLARE_EVENT_TABLE() 37 public: 38 39 /// Constructors 40 41 S57QueryDialog( ); 42 S57QueryDialog( wxWindow* parent, 43 wxWindowID id = wxID_ANY, 44 const wxString& caption = _("Object Query"), 45 const wxPoint& pos = wxDefaultPosition, 46 const wxSize& size = wxDefaultSize, 47 long style = wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU ); 48 49 ~S57QueryDialog( ); 50 void Init(); 51 52 bool Create( wxWindow* parent, 53 wxWindowID id = wxID_ANY, 54 const wxString& caption = _("Object Query"), 55 const wxPoint& pos = wxDefaultPosition, 56 const wxSize& size = wxDefaultSize, 57 long style = wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU ); 58 59 void SetColorScheme(void); 60 61 void CreateControls(); 62 void OnSize(wxSizeEvent& event); 63 void RecalculateSize( void ); 64 65 void OnClose(wxCloseEvent& event); 66 void OnHtmlLinkClicked(wxHtmlLinkEvent& event); 67 OnOKClick(wxCommandEvent & event)68 void OnOKClick(wxCommandEvent& event) { Close(); } 69 void OnKey( wxKeyEvent& ke ); 70 71 // Overrides 72 void OnPaint ( wxPaintEvent& event ); 73 74 void SetHTMLPage(wxString& page); 75 76 // Data 77 wxHtmlWindow *m_phtml; 78 wxSize m_createsize; 79 80 wxButton *m_btnOK; 81 }; 82 83 class S57ExtraQueryInfoDlg: public S57QueryDialog 84 { 85 DECLARE_CLASS( S57ExtraQueryInfoDlg ) 86 DECLARE_EVENT_TABLE() 87 public: 88 89 /// Constructors 90 91 S57ExtraQueryInfoDlg( ); 92 S57ExtraQueryInfoDlg( wxWindow* parent, 93 wxWindowID id = wxID_ANY, 94 const wxString& caption = _("Extra Object Info"), 95 const wxPoint& pos = wxDefaultPosition, 96 const wxSize& size = wxDefaultSize, 97 long style = wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU ); 98 bool Create( wxWindow* parent, 99 wxWindowID id = wxID_ANY, 100 const wxString& caption = _("Extra Object Info"), 101 const wxPoint& pos = wxDefaultPosition, 102 const wxSize& size = wxDefaultSize, 103 long style = wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU ); 104 105 ~S57ExtraQueryInfoDlg( ); 106 void OnClose(wxCloseEvent& event); 107 void OnSize( wxSizeEvent& event ); 108 void RecalculateSize( void ); 109 private: 110 wxButton *m_btnOK; 111 }; 112 113 #endif 114