Power System Platform  2026w10a-beta
Loading...
Searching...
No Matches
AboutForm.cpp
1/*
2 * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17
18#include "AboutForm.h"
19
20AboutForm::AboutForm(wxWindow* parent) : AboutFormBase(parent) { Init(); }
21AboutForm::~AboutForm() {}
22void AboutForm::Init()
23{
24 // Set program version. Format: (Alpha/Beta/Release) (YEAR)w(WEEK)(a/b/c/...)
25 m_staticTextVersion->SetLabel("2026w11a-beta");
26
27 // Create developers table
28 m_gridCredits->EnableGridLines(false);
29 wxFont headerFont = m_gridCredits->GetDefaultCellFont();
30 headerFont.SetWeight(wxFONTWEIGHT_BOLD);
31 headerFont.SetPointSize(headerFont.GetPointSize() + 1);
32 wxColour headerColour(200, 200, 200);
33 wxColour hyperlinkColour(6, 69, 173);
34
35 m_gridCredits->AppendCols(3);
36 m_gridCredits->AppendRows(6);
37 m_gridCredits->HideColLabels();
38 m_gridCredits->HideRowLabels();
39 m_gridCredits->SetCellSize(0, 0, 1, 3);
40 m_gridCredits->SetCellSize(3, 0, 1, 3);
41
42 m_gridCredits->SetCellValue(0, 0, _("Developers"));
43 m_gridCredits->SetCellAlignment(0, 0, wxALIGN_CENTRE, wxALIGN_CENTRE);
44 m_gridCredits->SetCellBackgroundColour(0, 0, headerColour);
45 m_gridCredits->SetCellFont(0, 0, headerFont);
46 m_gridCredits->SetCellValue(1, 0, wxT("Thales Lima Oliveira"));
47 m_gridCredits->SetCellValue(1, 1, _("Main developer and project admin"));
48 m_gridCredits->SetCellValue(1, 2, wxT("thales@ufu.br"));
49
50 m_gridCredits->SetRowMinimalHeight(2, 30);
51
52 m_gridCredits->SetCellValue(3, 0, _("Contributors / Special Thanks"));
53 m_gridCredits->SetCellAlignment(3, 0, wxALIGN_CENTRE, wxALIGN_CENTRE);
54 m_gridCredits->SetCellBackgroundColour(3, 0, headerColour);
55 m_gridCredits->SetCellFont(3, 0, headerFont);
56 // Caixeta
57 m_gridCredits->SetCellValue(4, 0, wxT("Geraldo Caixeta Guimar") + static_cast<wxString>(L'\u00E3') + wxT("es"));
58 m_gridCredits->SetCellValue(4, 1, _("Chief advisor"));
59 m_gridCredits->SetCellValue(4, 2, wxT("gcaixeta@ufu.br"));
60 // Marcio Tamashiro
61 m_gridCredits->SetCellValue(5, 0, wxT("M") + static_cast<wxString>(L'\u00E1') + wxT("rcio Augusto Tamashiro"));
62 m_gridCredits->SetCellValue(5, 1, "");
63 m_gridCredits->SetCellValue(5, 2, wxT("tamashiro@ifto.edu.br"));
64
65 for(int i = 0; i < m_gridCredits->GetNumberRows(); ++i) {
66 m_gridCredits->SetCellTextColour(i, 2, hyperlinkColour);
67 }
68
69 m_gridCredits->AutoSize();
70
71 // Last col size
72 int lastColSize = m_notebook->GetPage(1)->GetSize().GetWidth();
73 int lastColNumber = m_gridCredits->GetNumberCols() - 1;
74 for(int i = 0; i < lastColNumber; ++i) {
75 lastColSize -= m_gridCredits->GetColSize(i);
76 }
77 m_gridCredits->SetColSize(lastColNumber, lastColSize);
78 m_gridCredits->SetSize(m_notebook->GetPage(1)->GetSize());
79
80 // Load license file
81 wxString licenseStr = "";
82 wxTextFile file;
83 wxFileName fn(wxStandardPaths::Get().GetExecutablePath());
84 wxString licensePath = fn.GetPath() + wxFileName::DirName("\\..\\data\\LICENSE", wxPATH_WIN).GetPath();
85 if(!file.Open(licensePath)) {
86 // Error message
87 } else {
88 licenseStr += file.GetFirstLine() + "\n";
89 while(!file.Eof()) {
90 licenseStr += file.GetNextLine() + "\n";
91 }
92 }
93 wxFont font = m_richTextCtrlLicense->GetFont();
94 font.SetFamily(wxFONTFAMILY_TELETYPE);
95 m_richTextCtrlLicense->SetFont(font);
96 m_richTextCtrlLicense->SetEditable(false);
97 m_richTextCtrlLicense->AppendText(licenseStr);
98}