00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
#include <wx/wxprec.h>
00029
00030
#ifdef __BORLANDC__
00031
#pragma hdrstop
00032
#endif
00033
00034
#ifndef WX_PRECOMP
00035
00036
#include <wx/wx.h>
00037
#endif
00038
00039
#include <wx/notebook.h>
00040
00041
#include "dlgAbout.hpp"
00042
#include "frmSums.hpp"
00043
#include "appprefs.hpp"
00044
#include "comdefs.hpp"
00045
#include "language.hpp"
00046
#include "licence.hpp"
00047
#include "utils.hpp"
00048
00049
#include "compat.hpp"
00050
00051
00052
00053
00054
using namespace std;
00055
00056
00057 IMPLEMENT_DYNAMIC_CLASS(
dlgAbout, wxDialog)
00058
00059
00060
00061
00062
00063 dlgAbout::
dlgAbout() : wxDialog()
00064 {
00065 createControls();
00066 }
00067
00068
00069
00070
00071
00072
00073
00074
00075 dlgAbout::dlgAbout(wxWindow* parent) :
00076 wxDialog(parent, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize,
00077 wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
00078 {
00079
createControls();
00080
00081
00082
00083
if (parent != NULL)
00084 {
00085 wxSize s = parent->GetSize();
00086 this->SetSize((s.GetWidth() * 9) / 10, (s.GetHeight() * 2) / 3);
00087 }
00088 Centre();
00089 }
00090
00091
00092
00093
00094
00095
00096 void dlgAbout::createControls()
00097 {
00098
00099 this->SetTitle(wxString::Format(_(
"About %s"), wxT(
APP_NAME)));
00100
00101
00102 wxStaticBitmap* imgAppIcon;
00103
frmSums* parent = wxDynamicCast(this->GetParent(),
frmSums);
00104
if (parent != NULL)
00105 imgAppIcon =
new wxStaticBitmap(
this, -1, parent->GetIcon());
00106
else
00107 imgAppIcon =
new wxStaticBitmap(
this, -1, wxNullBitmap);
00108 wxStaticText* lblAppName =
new wxStaticText(
this, -1, ::
getAppName());
00109 wxFont f = lblAppName->GetFont();
00110 lblAppName->SetFont(wxFont((f.GetPointSize() * 125) / 100, f.GetFamily(), f.GetStyle(), f.GetWeight(), f.GetUnderlined(), f.GetFaceName(), f.GetDefaultEncoding()));
00111
00112
00113 wxNotebook* pgcAbout =
new wxNotebook(
this, -1);
00114
00115
00116 wxPanel* tabAbout =
new wxPanel(pgcAbout);
00117 pgcAbout->AddPage(tabAbout, _(
"About"),
true);
00118 wxStaticText* lblAppDesc =
new wxStaticText(tabAbout, -1, _(
"Computes and verifies checksums"));
00119 wxStaticText* lblAppCopyright =
new wxStaticText(tabAbout, -1, wxString::Format(_(
"Copyright (c) %s %s"), wxT(
APP_DEV_DATES), wxT(
APP_AUTHOR)));
00120
00121
00122 wxPanel* tabAuthors =
new wxPanel(pgcAbout);
00123 pgcAbout->AddPage(tabAuthors, _(
"Author"),
false);
00124 wxTextCtrl* txtAuthors =
new wxTextCtrl(tabAuthors, -1, wxString(wxT(
APP_AUTHOR)) + wxString(wxT(
" <jcouot@users.sourceforge.net>\n\t")) + _(
"Programmer & documentation"), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxTE_READONLY);
00125
00126
00127 wxPanel* tabTranslations =
new wxPanel(pgcAbout);
00128 pgcAbout->AddPage(tabTranslations, _(
"Translations"),
false);
00129 wxTextCtrl* txtTranslations =
new wxTextCtrl(tabTranslations, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxTE_READONLY);
00130
Languages languages;
00131
int i;
00132
for (i = 0; i < languages.
getLanguagesCount(); i++)
00133 {
00134 txtTranslations->AppendText(languages.
getLanguageShortName(i) + wxT(
'\t') + languages.
getLanguageTranslatorName(i));
00135
if (languages.
getLanguageTranslatorName(i) != languages.
getLanguageTranslatorNameInLocale(i))
00136 txtTranslations->AppendText(wxT(
" (") + languages.
getLanguageTranslatorNameInLocale(i) + wxT(
')'));
00137 txtTranslations->AppendText(wxT(
"\n"));
00138 }
00139
00140
00141 wxPanel* tabLicence =
new wxPanel(pgcAbout);
00142 pgcAbout->AddPage(tabLicence, _(
"Licence agreement"));
00143 wxTextCtrl* txtLicence =
new wxTextCtrl(tabLicence, -1, wxString(_(
"This program is distributed under the terms of the GPL v2.")) + wxString(wxT(
"\n\n")) + ::
getGPLLicenceText(), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxTE_READONLY);
00144
#if defined(__WXMSW__)
00145
txtLicence->SetFont(wxSystemSettings::GetFont(wxSYS_ANSI_FIXED_FONT));
00146
#else
00147
txtLicence->SetFont(wxFont(txtLicence->GetFont().GetPointSize(), wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));
00148
#endif // defined(__WXMSW__)
00149
00150
00151 wxPanel* tabMiscInfo =
new wxPanel(pgcAbout);
00152 pgcAbout->AddPage(tabMiscInfo, _(
"Misc information"));
00153 wxTextCtrl* txtMiscInfo =
new wxTextCtrl(tabMiscInfo, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxTE_READONLY);
00154 wxString star = wxT(
"* ");
00155 txtMiscInfo->AppendText(wxString::Format(star + _(
"Built with wxWidgets %d.%d.%d."), wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER));
00156
#if defined(wxC_USE_LARGE_FILES)
00157
txtMiscInfo->AppendText(wxString(wxT(
"\n")) + star + _(
"Large files support enabled."));
00158
#else
00159
txtMiscInfo->AppendText(wxString(wxT(
"\n")) + star + _(
"Large files support disabled."));
00160
#endif // defined(wxC_USE_LARGE_FILES)
00161
00162
00163 wxButton* btnClose =
new wxButton(
this, wxID_CANCEL, _(
"&Close"));
00164
00165
00166
00167
00168
00169
00170 wxBoxSizer* appIconAndNameSizer =
new wxBoxSizer(wxHORIZONTAL);
00171 appIconAndNameSizer->Add(imgAppIcon, 0, wxALIGN_CENTER_VERTICAL);
00172 appIconAndNameSizer->Add(lblAppName, 0, wxALIGN_CENTER_VERTICAL | wxLEFT,
CONTROL_SPACE);
00173
00174
00175
00176
00177
00178
00179 wxBoxSizer* tabAboutSizer2 =
new wxBoxSizer(wxVERTICAL);
00180 tabAbout->SetSizer(tabAboutSizer2);
00181 wxBoxSizer* tabAboutSizer =
new wxBoxSizer(wxVERTICAL);
00182 tabAboutSizer2->Add(tabAboutSizer, 1, wxALL | wxGROW,
CONTROL_SPACE);
00183
00184 tabAboutSizer->Add(lblAppDesc);
00185 tabAboutSizer->Add(lblAppCopyright, 0, wxTOP,
CONTROL_SPACE);
00186
00187
00188
00189
00190 wxBoxSizer* tabTranslationsSizer2 =
new wxBoxSizer(wxVERTICAL);
00191 tabTranslations->SetSizer(tabTranslationsSizer2);
00192 wxBoxSizer* tabTranslationsSizer =
new wxBoxSizer(wxVERTICAL);
00193 tabTranslationsSizer2->Add(tabTranslationsSizer, 1, wxALL | wxGROW,
CONTROL_SPACE);
00194
00195 tabTranslationsSizer->Add(txtTranslations, 1, wxGROW);
00196
00197
00198
00199
00200 wxBoxSizer* tabAuthorsSizer2 =
new wxBoxSizer(wxVERTICAL);
00201 tabAuthors->SetSizer(tabAuthorsSizer2);
00202 wxBoxSizer* tabAuthorsSizer =
new wxBoxSizer(wxVERTICAL);
00203 tabAuthorsSizer2->Add(tabAuthorsSizer, 1, wxALL | wxGROW,
CONTROL_SPACE);
00204
00205 tabAuthorsSizer->Add(txtAuthors, 1, wxGROW);
00206
00207
00208
00209
00210 wxBoxSizer* tabLicenceSizer2 =
new wxBoxSizer(wxVERTICAL);
00211 tabLicence->SetSizer(tabLicenceSizer2);
00212 wxBoxSizer* tabLicenceSizer =
new wxBoxSizer(wxVERTICAL);
00213 tabLicenceSizer2->Add(tabLicenceSizer, 1, wxALL | wxGROW,
CONTROL_SPACE);
00214
00215 tabLicenceSizer->Add(txtLicence, 1, wxGROW);
00216
00217
00218
00219
00220 wxBoxSizer* tabMiscInfoSizer2 =
new wxBoxSizer(wxVERTICAL);
00221 tabMiscInfo->SetSizer(tabMiscInfoSizer2);
00222 wxBoxSizer* tabMiscInfoSizer =
new wxBoxSizer(wxVERTICAL);
00223 tabMiscInfoSizer2->Add(tabMiscInfoSizer, 1, wxALL | wxGROW,
CONTROL_SPACE);
00224
00225 tabMiscInfoSizer->Add(txtMiscInfo, 1, wxGROW);
00226
00227
00228
00229 wxBoxSizer* dlgAboutSizer2 =
new wxBoxSizer(wxVERTICAL);
00230 this->SetSizer(dlgAboutSizer2);
00231 wxBoxSizer* dlgAboutSizer =
new wxBoxSizer(wxVERTICAL);
00232 dlgAboutSizer2->Add(dlgAboutSizer, 1, wxALL | wxGROW,
CONTROL_SPACE);
00233
00234 dlgAboutSizer->Add(appIconAndNameSizer);
00235 dlgAboutSizer->Add(pgcAbout, 1, wxGROW | wxTOP,
CONTROL_SPACE);
00236 dlgAboutSizer->Add(btnClose, 0, wxTOP | wxALIGN_RIGHT,
CONTROL_SPACE);
00237
00238
00239 this->SetAutoLayout(
true);
00240 this->Layout();
00241
00242
00243
00244 }
00245
00246
00247
00248
00249
00250
00251 dlgAbout::~dlgAbout()
00252 {
00253 }
00254
00255
00256
00257
00258
00259
00260