OpenCPN Partial API docs
AboutFrameImpl.h
1 /***************************************************************************
2  *
3  * Project: OpenCPN
4  *
5  ***************************************************************************
6  * Copyright (C) 2019 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 #pragma once
25 #ifndef _ABOUTFRAMEIMPL_H_
26 #define _ABOUTFRAMEIMPL_H_
27 
28 #include "AboutFrame.h"
29 
30 class AboutFrameImpl : public AboutFrame {
31 protected:
32  void AboutFrameOnClose(wxCloseEvent& event) {
33  Hide();
34  SetSize(GetMinSize());
35  Centre();
36  event.Veto();
37  }
38  void OnLinkDonate(wxHyperlinkEvent& event) { event.Skip(); }
39  void OnLinkGetInvolved(wxHyperlinkEvent& event) { event.Skip(); }
40  void OnLinkLogfile(wxHyperlinkEvent& event) { event.Skip(); }
41  void OnLinkConfigfile(wxHyperlinkEvent& event) { event.Skip(); }
42  void OnLinkHelp(wxHyperlinkEvent& event);
43  void OnLinkLicense(wxHyperlinkEvent& event);
44  void OnLinkAuthors(wxHyperlinkEvent& event);
45  void AboutFrameOnActivate(wxActivateEvent& event);
46 #if wxUSE_WEBVIEW && defined(HAVE_WEBVIEW)
47  void m_btnBackOnButtonClick(wxCommandEvent& event) {
48  wxString locn = m_htmlWinHelp->GetCurrentURL();
49  if (!locn.Contains("toc_flat")) {
50  m_htmlWinHelp->GoBack();
51  m_btnBack->Enable(m_htmlWinHelp->CanGoBack());
52  }
53  }
54 #else
55  void m_btnBackOnButtonClick(wxCommandEvent& event) {
56  m_htmlWinHelp->HistoryBack();
57  m_btnBack->Enable(m_htmlWinHelp->HistoryCanBack());
58  }
59 #endif
60  void m_htmlWinHelpOnHtmlLinkClicked(wxHtmlLinkEvent& event) {
61  m_btnBack->Enable();
62  event.Skip();
63  }
64 
65  void RecalculateSize(void);
66 
67 public:
68  ~AboutFrameImpl(){};
69 
70  AboutFrameImpl(wxWindow* parent, wxWindowID id = wxID_ANY,
71  const wxString& title = _("About OpenCPN"),
72  const wxPoint& pos = wxDefaultPosition,
73  const wxSize& size = wxSize(500, 300),
74  long style = wxCAPTION | wxCLOSE_BOX |
75  wxFRAME_FLOAT_ON_PARENT | wxFRAME_NO_TASKBAR |
76  wxRESIZE_BORDER | wxTAB_TRAVERSAL);
77 };
78 
79 #endif // _ABOUTFRAMEIMPL_H_
Class AboutFrame.
Definition: AboutFrame.h:39