1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: declaration of wxAboutDialog class
4 // Author: Vadim Zeitlin
6 // Copyright: (c) 2006 Vadim Zeitlin <vadim@wxwindows.org>
7 // Licence: wxWindows licence
8 ///////////////////////////////////////////////////////////////////////////////
10 #ifndef _WX_ABOUTDLG_H_
11 #define _WX_ABOUTDLG_H_
20 // ----------------------------------------------------------------------------
21 // wxAboutDialogInfo: information shown by the standard "About" dialog
22 // ----------------------------------------------------------------------------
24 class WXDLLIMPEXP_ADV wxAboutDialogInfo
27 // all fields are initially uninitialized
28 wxAboutDialogInfo() { }
30 // accessors for various simply fields
31 // -----------------------------------
33 // name of the program, if not used defaults to wxApp::GetAppDisplayName()
34 void SetName(const wxString
& name
) { m_name
= name
; }
35 wxString
GetName() const
36 { return m_name
.empty() ? wxTheApp
->GetAppDisplayName() : m_name
; }
38 // version should contain program version without "version" word (e.g.,
39 // "1.2" or "RC2") while longVersion may contain the full version including
40 // "version" word (e.g., "Version 1.2" or "Release Candidate 2")
42 // if longVersion is empty, it is automatically constructed from version
44 // generic and gtk native: use short version only, as a suffix to the
45 // program name msw and osx native: use long version
46 void SetVersion(const wxString
& version
,
47 const wxString
& longVersion
= wxString());
49 bool HasVersion() const { return !m_version
.empty(); }
50 const wxString
& GetVersion() const { return m_version
; }
51 const wxString
& GetLongVersion() const { return m_longVersion
; }
53 // brief, but possibly multiline, description of the program
54 void SetDescription(const wxString
& desc
) { m_description
= desc
; }
55 bool HasDescription() const { return !m_description
.empty(); }
56 const wxString
& GetDescription() const { return m_description
; }
58 // short string containing the program copyright information
59 void SetCopyright(const wxString
& copyright
) { m_copyright
= copyright
; }
60 bool HasCopyright() const { return !m_copyright
.empty(); }
61 const wxString
& GetCopyright() const { return m_copyright
; }
63 // long, multiline string containing the text of the program licence
64 void SetLicence(const wxString
& licence
) { m_licence
= licence
; }
65 void SetLicense(const wxString
& licence
) { m_licence
= licence
; }
66 bool HasLicence() const { return !m_licence
.empty(); }
67 const wxString
& GetLicence() const { return m_licence
; }
69 // icon to be shown in the dialog, defaults to the main frame icon
70 void SetIcon(const wxIcon
& icon
) { m_icon
= icon
; }
71 bool HasIcon() const { return m_icon
.IsOk(); }
72 wxIcon
GetIcon() const;
74 // web site for the program and its description (defaults to URL itself if
76 void SetWebSite(const wxString
& url
, const wxString
& desc
= wxEmptyString
)
79 m_urlDesc
= desc
.empty() ? url
: desc
;
82 bool HasWebSite() const { return !m_url
.empty(); }
84 const wxString
& GetWebSiteURL() const { return m_url
; }
85 const wxString
& GetWebSiteDescription() const { return m_urlDesc
; }
87 // accessors for the arrays
88 // ------------------------
90 // the list of developers of the program
91 void SetDevelopers(const wxArrayString
& developers
)
92 { m_developers
= developers
; }
93 void AddDeveloper(const wxString
& developer
)
94 { m_developers
.push_back(developer
); }
96 bool HasDevelopers() const { return !m_developers
.empty(); }
97 const wxArrayString
& GetDevelopers() const { return m_developers
; }
99 // the list of documentation writers
100 void SetDocWriters(const wxArrayString
& docwriters
)
101 { m_docwriters
= docwriters
; }
102 void AddDocWriter(const wxString
& docwriter
)
103 { m_docwriters
.push_back(docwriter
); }
105 bool HasDocWriters() const { return !m_docwriters
.empty(); }
106 const wxArrayString
& GetDocWriters() const { return m_docwriters
; }
108 // the list of artists for the program art
109 void SetArtists(const wxArrayString
& artists
)
110 { m_artists
= artists
; }
111 void AddArtist(const wxString
& artist
)
112 { m_artists
.push_back(artist
); }
114 bool HasArtists() const { return !m_artists
.empty(); }
115 const wxArrayString
& GetArtists() const { return m_artists
; }
117 // the list of translators
118 void SetTranslators(const wxArrayString
& translators
)
119 { m_translators
= translators
; }
120 void AddTranslator(const wxString
& translator
)
121 { m_translators
.push_back(translator
); }
123 bool HasTranslators() const { return !m_translators
.empty(); }
124 const wxArrayString
& GetTranslators() const { return m_translators
; }
127 // implementation only
128 // -------------------
130 // "simple" about dialog shows only textual information (with possibly
131 // default icon but without hyperlink nor any long texts such as the
133 bool IsSimple() const
134 { return !HasWebSite() && !HasIcon() && !HasLicence(); }
136 // get the description and credits (i.e. all of developers, doc writers,
137 // artists and translators) as a one long multiline string
138 wxString
GetDescriptionAndCredits() const;
140 // returns the copyright with the (C) string substituted by the Unicode
142 wxString
GetCopyrightToDisplay() const;
157 wxArrayString m_developers
,
163 // functions to show the about dialog box
164 WXDLLIMPEXP_ADV
void wxAboutBox(const wxAboutDialogInfo
& info
, wxWindow
* parent
= NULL
);
166 #endif // wxUSE_ABOUTDLG
168 #endif // _WX_ABOUTDLG_H_