HatchKeeper  0.90
The Free Open-Source Egg Incubation Software
HelpDialog.cpp
Go to the documentation of this file.
1 /***********************************************************************
2  * @file HelpDialog.h
3  * @brief Declares and Defines HelpDialog
4  * @author mill-j
5  * @since (C) 2018 - 2023
6  * @copyright GNU GPL v3
7  **********************************************************************/
8 
9 #include <wx/wx.h>
10 #include <wx/scrolwin.h>
11 #include <wx/hyperlink.h>
12 #include "../../.HatchKeeper_Data_90/Images/HatchKeeper_Icon.xpm"
13 
20 class HelpDialog : public wxDialog
21 {
22  private:
23  wxScrolledWindow* AboutPanel;
24  wxStaticBitmap* iconBitmap;
25  wxStaticText* versionStat;
26  wxStaticText* decriptionStat;
27  wxStaticText* copywriteStat;
28  wxStaticText* licenseStat;
29  wxHyperlinkCtrl* homepageStat;
30  wxHyperlinkCtrl* helppageStat;
31  wxStaticText* CreditStat;
32  wxStaticText* m_staticText8;
33  wxStaticText* TeamStat;
34  wxStaticText* ThanksStat;
35  wxStaticText* ThankNamesStat;
36  wxButton* HelpCloseButton;
37 
38  void ScanLicense();
39  void OnClose(wxCommandEvent&);
40  public:
41  HelpDialog( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 500,550 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
42 };
43 
45 HelpDialog::HelpDialog( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
46 {
47  this->SetSizeHints( wxDefaultSize, wxDefaultSize );
48 
49  //Colors
50  vector<int> ColorRed = Settings.GetIntArray("ColorRed");
51  vector<int> ColorGreen = Settings.GetIntArray("ColorGreen");
52  vector<int> ColorBlue = Settings.GetIntArray("ColorBlue");
53 
54  this->SetForegroundColour( wxColor(ColorRed[8],ColorGreen[8],ColorBlue[8]) );
55  this->SetBackgroundColour( wxColor(ColorRed[7],ColorGreen[7],ColorBlue[7]) );
56 
57  wxBoxSizer* bSizer1;
58  bSizer1 = new wxBoxSizer( wxVERTICAL );
59 
60  AboutPanel = new wxScrolledWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL );
61  AboutPanel->SetScrollRate( 5, 5 );
62  AboutPanel->SetForegroundColour( wxColor(ColorRed[8],ColorGreen[8],ColorBlue[8]) );
63  AboutPanel->SetBackgroundColour( wxColor(ColorRed[7],ColorGreen[7],ColorBlue[7]) );
64  wxBoxSizer* bSizer2;
65  bSizer2 = new wxBoxSizer( wxVERTICAL );
66 
67  iconBitmap = new wxStaticBitmap( AboutPanel, wxID_ANY, wxBitmap( HatchKeeper_Icon_xpm ), wxDefaultPosition, wxDefaultSize, 0 );
68  bSizer2->Add( iconBitmap, 0, wxALL|wxEXPAND, 5 );
69 
70  versionStat = new wxStaticText( AboutPanel, wxID_ANY, Info.GetVersion().c_str(), wxDefaultPosition, wxDefaultSize, 0 );
71  versionStat->Wrap( -1 );
72  bSizer2->Add( versionStat, 0, wxALIGN_CENTER_HORIZONTAL, 5 );
73 
74  homepageStat = new wxHyperlinkCtrl( AboutPanel, wxID_ANY, wxT("Website"),"https://hatchkeeper.sourceforge.io" ,wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
75  bSizer2->Add( homepageStat, 0, wxALIGN_CENTER_HORIZONTAL, 5 );
76 
77  helppageStat = new wxHyperlinkCtrl( AboutPanel, wxID_ANY, wxT("Help"),"https://hatchkeeper.sourceforge.io/help", wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
78  bSizer2->Add( helppageStat,0,wxALIGN_CENTER_HORIZONTAL, 5 );
79 
80  m_staticText8 = new wxStaticText( AboutPanel, wxID_ANY, l(""), wxDefaultPosition, wxDefaultSize, 0 );
81  m_staticText8->SetLabelMarkup("\n<b>"+l("The HatchKeeper Team Is:") + "</b>\n\nmill-j:\tMain Developer\nEthan Beachy:\tDesign\n");
82  m_staticText8->Wrap( -1 );
83  bSizer2->Add( m_staticText8, 0, wxALIGN_CENTER_HORIZONTAL, 5 );
84 
85  wxStaticText* m_staticText80 = new wxStaticText( AboutPanel, wxID_ANY, l(""), wxDefaultPosition, wxDefaultSize, 0 );
86  m_staticText80->SetLabelMarkup("\n<b>"+l("Translators Are:") + "</b>\n\nMarc036:\tDutch");
87  m_staticText80->Wrap(-1 );
88  bSizer2->Add( m_staticText80, 0, wxALIGN_CENTER_HORIZONTAL, 5 );
89 
90  ThanksStat = new wxStaticText( AboutPanel, wxID_ANY, l(""), wxDefaultPosition, wxDefaultSize, 0 );
91  ThanksStat->SetLabelMarkup("\n<b>"+l("Special Thanks:") + "</b>\n\nChilliy\nTabasco Jack\nFaye-King\nGeek-a-Byte\nMolpet\nKikisGirls");
92  ThanksStat->Wrap( -1 );
93  bSizer2->Add( ThanksStat,0, wxALIGN_CENTER_HORIZONTAL, 5 );
94 
95  copywriteStat = new wxStaticText( AboutPanel, wxID_ANY, Info.GetCopyright(), wxDefaultPosition, wxDefaultSize, 0 );
96  copywriteStat->SetLabelMarkup("\n<b>" + Info.GetCopyright() + "</b>\n");
97  copywriteStat->Wrap( -1 );
98  bSizer2->Add( copywriteStat, 0, wxALIGN_CENTER_HORIZONTAL, 5 );
99 
100  licenseStat = new wxStaticText( AboutPanel, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, 0 );
101  licenseStat->SetLabel("This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3 of the License.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.");
102  licenseStat->Wrap( 400 );
103  bSizer2->Add( licenseStat, 0, wxALIGN_CENTER_HORIZONTAL, 5 );
104 
105  AboutPanel->SetSizer( bSizer2 );
106  AboutPanel->Layout();
107 
108  bSizer1->Add( AboutPanel, 1, wxEXPAND | wxALL, 5 );
109 
110  HelpCloseButton = new wxButton( this, wxID_ANY, l("Close"), wxDefaultPosition, wxDefaultSize, 0 );
111  bSizer1->Add( HelpCloseButton, 0, wxALL|wxEXPAND, 5 );
112  string FileFolder;
113 
114  HelpCloseButton->Bind(wxEVT_BUTTON, &HelpDialog::OnClose, this );
115 
116  this->SetSizer( bSizer1 );
117  this->Layout();
118 
119  this->Centre( wxBOTH );
120 }
121 
123 void HelpDialog::OnClose(wxCommandEvent&){EndModal(0);}
HK_KeyValue Settings
Definition: Declare.h:36
HK_Info Info
Definition: Declare.h:34
std::string l(std::string Text)
A Helper Function For HK_Language.
Definition: Declare.h:52
std::string GetVersion()
Returns The Version Of HatchKeeper.
Definition: HK_Info.cpp:15
std::string GetCopyright()
Returns Copyright Info.
Definition: HK_Info.cpp:21
vector< int > GetIntArray(int Selection)
Returns The Selected Value As An Array Of Integers.
A Dialog For Displaying Version, Help, Credits And More.
Definition: HelpDialog.cpp:21
wxStaticText * copywriteStat
Definition: HelpDialog.cpp:27
wxStaticText * ThanksStat
Definition: HelpDialog.cpp:34
wxStaticText * decriptionStat
Definition: HelpDialog.cpp:26
wxHyperlinkCtrl * helppageStat
Definition: HelpDialog.cpp:30
wxButton * HelpCloseButton
Definition: HelpDialog.cpp:36
wxStaticText * ThankNamesStat
Definition: HelpDialog.cpp:35
wxStaticText * versionStat
Definition: HelpDialog.cpp:25
wxStaticBitmap * iconBitmap
Definition: HelpDialog.cpp:24
wxHyperlinkCtrl * homepageStat
Definition: HelpDialog.cpp:29
void OnClose(wxCommandEvent &)
Close Dialog.
Definition: HelpDialog.cpp:123
HelpDialog(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=wxEmptyString, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(500, 550), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
Constructor.
Definition: HelpDialog.cpp:45
wxStaticText * TeamStat
Definition: HelpDialog.cpp:33
wxStaticText * CreditStat
Definition: HelpDialog.cpp:31
void ScanLicense()
wxStaticText * licenseStat
Definition: HelpDialog.cpp:28
wxStaticText * m_staticText8
Definition: HelpDialog.cpp:32
wxScrolledWindow * AboutPanel
Definition: HelpDialog.cpp:23