Code::Blocks  SVN r11506
dlgabout.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of the Code::Blocks IDE and licensed under the GNU General Public License, version 3
3  * http://www.gnu.org/licenses/gpl-3.0.html
4  *
5  * $Revision: 11300 $
6  * $Id: dlgabout.cpp 11300 2018-02-21 00:18:15Z fuscated $
7  * $HeadURL: https://svn.code.sf.net/p/codeblocks/code/trunk/src/src/dlgabout.cpp $
8  */
9 
10 #include "sdk.h"
11 
12 #ifndef CB_PRECOMP
13  #ifdef __WXMAC__
14  #include <wx/font.h>
15  #endif //__WXMAC__
16  #include <wx/button.h> // wxImage
17  #include <wx/image.h> // wxImage
18  #include <wx/intl.h>
19  #include <wx/stattext.h>
20  #include <wx/string.h>
21  #include <wx/textctrl.h>
22  #include <wx/xrc/xmlres.h>
23  #if wxCHECK_VERSION(3, 0, 0)
24  #include <wx/versioninfo.h>
25  #endif // wxCHECK_VERSION
26 
27  #include "licenses.h"
28  #include "configmanager.h"
29  #include "wx/wxscintilla.h"
30 #endif
31 
32 #include <wx/bitmap.h>
33 #include <wx/dcmemory.h> // wxMemoryDC
34 #include <wx/statbmp.h>
35 
36 #include "appglobals.h"
37 #include "dlgabout.h" // class's header file
38 #include "configmanager.h"
39 #include "splashscreen.h"
40 
41 // class constructor
42 
44 {
45  if (!wxXmlResource::Get()->LoadObject(this, parent, _T("dlgAbout"), _T("wxScrollingDialog")))
46  {
47  cbMessageBox(_("There was an error loading the \"About\" dialog from XRC file."),
48  _("Information"), wxICON_EXCLAMATION);
49  return;
50  }
51 
52  wxButton *cancelButton = XRCCTRL(*this, "wxID_CANCEL", wxButton);
53  cancelButton->SetDefault();
54  cancelButton->SetFocus();
55 
56  const wxString description = _("Welcome to ") + appglobals::AppName + _T(" ") +
58  _(" is a full-featured IDE (Integrated Development Environment) "
59  "aiming to make the individual developer (and the development team) "
60  "work in a nice programming environment offering everything he/they "
61  "would ever need from a program of that kind.\n"
62  "Its pluggable architecture allows you, the developer, to add "
63  "any kind of functionality to the core program, through the use of "
64  "plugins...\n");
65 
66  wxString file = ConfigManager::ReadDataPath() + _T("/images/splash_1312.png");
68  wxBitmap bmp(im);
69  wxMemoryDC dc;
70  dc.SelectObject(bmp);
72 
73  wxStaticBitmap *bmpControl = XRCCTRL(*this, "lblTitle", wxStaticBitmap);
74  bmpControl->SetSize(im.GetWidth(),im.GetHeight());
75  bmpControl->SetBitmap(bmp);
76 
77  XRCCTRL(*this, "lblBuildTimestamp", wxStaticText)->SetLabel(wxString(_("Build: ")) + appglobals::AppBuildTimestamp);
78  XRCCTRL(*this, "txtDescription", wxTextCtrl)->SetValue(description);
79  XRCCTRL(*this, "txtThanksTo", wxTextCtrl)->SetValue(_(
80  "Developers:\n"
81  "--------------\n"
82  "Yiannis Mandravellos: Developer - Project leader\n"
83  "Thomas Denk : Developer\n"
84  "Lieven de Cock : Developer\n"
85  "\"tiwag\" : Developer\n"
86  "Martin Halle : Developer\n"
87  "Biplab Modak : Developer\n"
88  "Jens Lody : Developer\n"
89  "Yuchen Deng : Developer\n"
90  "Teodor Petrov : Developer\n"
91  "Daniel Anselmi : Developer\n"
92  "Yuanhui Zhang : Developer\n"
93  "Damien Moore : Developer\n"
94  "Micah Ng : Developer\n"
95  "Ricardo Garcia : All-hands person\n"
96  "Paul A. Jimenez : Help and AStyle plugins\n"
97  "Thomas Lorblanches : CodeStat and Profiler plugins\n"
98  "Bartlomiej Swiecki : wxSmith RAD plugin\n"
99  "Jerome Antoine : ThreadSearch plugin\n"
100  "Pecan Heber : Keybinder, BrowseTracker, DragScroll\n"
101  " CodeSnippets plugins\n"
102  "Arto Jonsson : CodeSnippets plugin (passed on to Pecan)\n"
103  "Darius Markauskas : Fortran support\n"
104  "Mario Cupelli : Compiler support for embedded systems\n"
105  " User's manual\n"
106  "Jonas Zinn : Misc. wxSmith AddOns and plugins\n"
107  "Mirai Computing : cbp2make tool\n"
108  "Anders F Bjoerklund : wxMac compatibility\n"
109  "\n"
110  "Contributors (in no special order):\n"
111  "-----------------------------------\n"
112  "Daniel Orb : RPM spec file and packages\n"
113  "byo,elvstone, me22 : Conversion to Unicode\n"
114  "pasgui : Providing Ubuntu nightly packages\n"
115  "Hakki Dogusan : DigitalMars compiler support\n"
116  "ybx : OpenWatcom compiler support\n"
117  "Tim Baker : Patches for the direct-compile-mode\n"
118  " dependencies generation system\n"
119  "David Perfors : Unicode tester and future documentation writer\n"
120  "Sylvain Prat : Initial MSVC workspace and project importers\n"
121  "Chris Raschko : Design of the 3D logo for Code::Blocks\n"
122  "J.A. Ortega : 3D Icon based on the above\n"
123  "Alexandr Efremo : Providing OpenSuSe packages\n"
124  "Huki : Misc. Code-Completion improvements\n"
125  "stahta01 : Misc. patches for several enhancements\n"
126  "BlueHazzard : Misc. patches for several enhancements\n"
127  "\n"
128  "All contributors that provided patches.\n"
129  "The wxWidgets project (http://www.wxwidgets.org).\n"
130  "wxScintilla (http://sourceforge.net/projects/wxscintilla).\n"
131  "TinyXML parser (http://www.grinninglizard.com/tinyxml).\n"
132  "Squirrel scripting language (http://www.squirrel-lang.org).\n"
133  "The GNU Software Foundation (http://www.gnu.org).\n"
134  "Last, but not least, the open-source community."));
135  XRCCTRL(*this, "txtLicense", wxTextCtrl)->SetValue(LICENSE_GPL);
136 
137  XRCCTRL(*this, "lblName", wxStaticText)->SetLabel(appglobals::AppName);
138  XRCCTRL(*this, "lblVersion", wxStaticText)->SetLabel(appglobals::AppActualVersionVerb);
139  XRCCTRL(*this, "lblSDK", wxStaticText)->SetLabel(appglobals::AppSDKVersion);
140 #if wxCHECK_VERSION(3, 0, 0)
141  const wxVersionInfo scintillaVersion = wxScintilla::GetLibraryVersionInfo();
142  const wxString scintillaStr = wxString::Format(wxT("%d.%d.%d"),
143  scintillaVersion.GetMajor(),
144  scintillaVersion.GetMinor(),
145  scintillaVersion.GetMicro());
146 #else
147  const wxString scintillaStr = wxSCINTILLA_VERSION;
148 #endif // wxCHECK_VERSION
149  XRCCTRL(*this, "lblScintillaVer", wxStaticText)->SetLabel(scintillaStr);
150  XRCCTRL(*this, "lblAuthor", wxStaticText)->SetLabel(_("The Code::Blocks Team"));
151  XRCCTRL(*this, "lblEmail", wxStaticText)->SetLabel(appglobals::AppContactEmail);
152  XRCCTRL(*this, "lblWebsite", wxStaticText)->SetLabel(appglobals::AppUrl);
153 
154 #ifdef __WXMAC__
155  // Courier 8 point is not readable on Mac OS X, increase font size:
156  wxFont font1 = XRCCTRL(*this, "txtThanksTo", wxTextCtrl)->GetFont();
157  font1.SetPointSize(10);
158  XRCCTRL(*this, "txtThanksTo", wxTextCtrl)->SetFont(font1);
159 
160  wxFont font2 = XRCCTRL(*this, "txtLicense", wxTextCtrl)->GetFont();
161  font2.SetPointSize(10);
162  XRCCTRL(*this, "txtLicense", wxTextCtrl)->SetFont(font2);
163 #endif
164  Fit();
165  CentreOnParent();
166 }
167 
168 // class destructor
170 {
171  // insert your code here
172 }
int GetWidth() const
bool ConvertAlphaToMask(unsigned char threshold=wxIMAGE_ALPHA_THRESHOLD)
const wxString AppActualVersionVerb
Definition: appglobals.cpp:26
virtual void SetPointSize(int pointSize)
#define _T(string)
const wxString AppUrl
Definition: appglobals.cpp:39
#define wxT(string)
virtual bool LoadFile(wxInputStream &stream, wxBitmapType type=wxBITMAP_TYPE_ANY, int index=-1)
#define wxICON_EXCLAMATION
static wxVersionInfo GetLibraryVersionInfo()
int GetMinor() const
int GetMajor() const
virtual void SetBitmap(const wxBitmap &label)
const wxString AppBuildTimestamp
Definition: appglobals.cpp:66
const wxString AppContactEmail
Definition: appglobals.cpp:40
const wxString & _(const wxString &string)
const wxString AppName
Definition: appglobals.cpp:22
dlgAbout(wxWindow *parent)
Definition: dlgabout.cpp:43
#define wxSCINTILLA_VERSION
Definition: wxscintilla.h:36
#define LICENSE_GPL
Definition: licenses.h:10
const wxString AppVersion
Definition: appglobals.cpp:25
static void DrawReleaseInfo(class wxDC &dc)
static wxString ReadDataPath()
static wxXmlResource * Get()
const wxString AppSDKVersion
Definition: appglobals.cpp:34
int GetMicro() const
static wxString Format(const wxString &format,...)
int GetHeight() const
DLLIMPORT int cbMessageBox(const wxString &message, const wxString &caption=wxEmptyString, int style=wxOK, wxWindow *parent=NULL, int x=-1, int y=-1)
wxMessageBox wrapper.
Definition: globals.cpp:1395