1 /******************************************************************************
2  *
3  * Project:  OpenCPN
4  * Purpose:  About Dialog
5  * Author:   David Register
6  *
7  ***************************************************************************
8  *   Copyright (C) 2010 by David S. Register   *
9  *                                                                         *
10  *   This program is free software; you can redistribute it and/or modify  *
11  *   it under the terms of the GNU General Public License as published by  *
12  *   the Free Software Foundation; either version 2 of the License, or     *
13  *   (at your option) any later version.                                   *
14  *                                                                         *
15  *   This program is distributed in the hope that it will be useful,       *
16  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
17  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
18  *   GNU General Public License for more details.                          *
19  *                                                                         *
20  *   You should have received a copy of the GNU General Public License     *
21  *   along with this program; if not, write to the                         *
22  *   Free Software Foundation, Inc.,                                       *
23  *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,  USA.             *
24  ***************************************************************************
25  *
26 
27  */
28 
29 
30 #ifndef _ABOUT_H_
31 #define _ABOUT_H_
32 
33 #include "wx/notebook.h"
34 
35 //      Constants
36 
37 #define ID_DIALOG 10001
38 
39 #define SYMBOL_ABOUT_TITLE _("About OpenCPN")
40 
41 #define xID_OK          10009
42 #define ID_DONATE       10010
43 #define ID_COPYINI      10011
44 #define ID_COPYLOG      10012
45 
46 #define ID_NOTEBOOK_HELP 10002
47 
48 class wxHtmlWindow;
49 
50 class about: public wxDialog
51 {
52   DECLARE_DYNAMIC_CLASS( about )
53       DECLARE_EVENT_TABLE()
54 
55   public:
56     explicit about( );
57     explicit about( wxWindow* parent, wxString License_Data_Locn,
58            wxWindowID id = ID_DIALOG,
59            const wxString& caption = SYMBOL_ABOUT_TITLE,
60            const wxPoint& pos = wxDefaultPosition,
61            const wxSize& size = wxSize(500, 500),
62            long style = wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX );
63    bool Create( wxWindow* parent,
64                 wxWindowID id = ID_DIALOG,
65                  const wxString& caption = SYMBOL_ABOUT_TITLE,
66                  const wxPoint& pos = wxDefaultPosition,
67                  const wxSize& size = wxSize(500, 500),
68                  long style = wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX );
69 
70    void RecalculateSize( void );
71 
72   private:
73     void CreateControls( void );
74     void Populate( void );
75     void OnXidOkClick( wxCommandEvent& event );
76     void OnNBPageChange(wxNotebookEvent& event);
77     void OnDonateClick( wxCommandEvent& event );
78     void OnCopyClick( wxCommandEvent& event );
79     void OnClose( wxCloseEvent& event );
80     void SetColorScheme( void );
81 
82     wxString m_DataLocn;
83     wxWindow *m_parent;
84     bool m_btips_loaded;
85     bool m_blicensePageSet;
86 
87     wxPanel* itemPanelAbout;
88     wxPanel* itemPanelAuthors;
89     wxPanel* itemPanelLicense;
90     wxPanel* itemPanelTips;
91 
92     wxTextCtrl *pAuthorTextCtl;
93     wxTextCtrl *pLicenseTextCtl;
94     wxNotebook *pNotebook;
95     wxHtmlWindow *pAboutHTMLCtl;
96     wxHtmlWindow *pLicenseHTMLCtl;
97     wxHtmlWindow *pAuthorHTMLCtl;
98 
99     wxSize m_displaySize;
100 
101 };
102 
103 #endif    // _ABOUT_H_
104 
105