1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: declaration of wxAboutDialog class
4 // Author: Vadim Zeitlin
7 // Copyright: (c) 2006 Vadim Zeitlin <vadim@wxwindows.org>
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_ABOUTDLG_H_
12 #define _WX_ABOUTDLG_H_
21 // ----------------------------------------------------------------------------
22 // wxAboutDialogInfo: information shown by the standard "About" dialog
23 // ----------------------------------------------------------------------------
25 class WXDLLIMPEXP_CORE wxAboutDialogInfo
28 // all fields are initially uninitialized
29 wxAboutDialogInfo() { }
31 // accessors for various simply fields
32 // -----------------------------------
34 // name of the program, if not used defaults wxApp::GetAppName()
35 void SetName(const wxString
& name
) { m_name
= name
; }
36 wxString
GetName() const
37 { return m_name
.empty() ? wxTheApp
->GetAppName() : m_name
; }
39 // version of the program, in free format (but without "version" word)
40 void SetVersion(const wxString
& version
) { m_version
= version
; }
41 bool HasVersion() const { return !m_version
.empty(); }
42 wxString
GetVersion() const { return m_version
; }
44 // brief, but possibly multiline, description of the program
45 void SetDescription(const wxString
& desc
) { m_description
= desc
; }
46 bool HasDescription() const { return !m_description
.empty(); }
47 wxString
GetDescription() const { return m_description
; }
49 // short string containing the program copyright information
50 void SetCopyright(const wxString
& copyright
) { m_copyright
= copyright
; }
51 bool HasCopyright() const { return !m_copyright
.empty(); }
52 wxString
GetCopyright() const { return m_copyright
; }
54 // long, multiline string containing the text of the program licence
55 void SetLicence(const wxString
& licence
) { m_licence
= licence
; }
56 void SetLicense(const wxString
& licence
) { m_licence
= licence
; }
57 bool HasLicence() const { return !m_licence
.empty(); }
58 wxString
GetLicence() const { return m_licence
; }
60 // icon to be shown in the dialog, defaults to the main frame icon
61 void SetIcon(const wxIcon
& icon
) { m_icon
= icon
; }
62 bool HasIcon() const { return m_icon
.Ok(); }
63 wxIcon
GetIcon() const;
65 // web site for the program and its description (defaults to URL itself if
67 void SetWebSite(const wxString
& url
, const wxString
& desc
= wxEmptyString
)
70 m_urlDesc
= desc
.empty() ? url
: desc
;
73 bool HasWebSite() const { return !m_url
.empty(); }
75 wxString
GetWebSiteURL() const { return m_url
; }
76 wxString
GetWebSiteDescription() const { return m_urlDesc
; }
78 // accessors for the arrays
79 // ------------------------
81 // the list of developers of the program
82 void SetDevelopers(const wxArrayString
& developers
)
83 { m_developers
= developers
; }
84 void AddDeveloper(const wxString
& developer
)
85 { m_developers
.push_back(developer
); }
87 bool HasDevelopers() const { return !m_developers
.empty(); }
88 const wxArrayString
& GetDevelopers() const { return m_developers
; }
90 // the list of documentation writers
91 void SetDocWriters(const wxArrayString
& docwriters
)
92 { m_docwriters
= docwriters
; }
93 void AddDocWriter(const wxString
& docwriter
)
94 { m_docwriters
.push_back(docwriter
); }
96 bool HasDocWriters() const { return !m_docwriters
.empty(); }
97 const wxArrayString
& GetDocWriters() const { return m_docwriters
; }
99 // the list of artists for the program art
100 void SetArtists(const wxArrayString
& artists
)
101 { m_artists
= artists
; }
102 void AddArtist(const wxString
& artist
)
103 { m_artists
.push_back(artist
); }
105 bool HasArtists() const { return !m_artists
.empty(); }
106 const wxArrayString
& GetArtists() const { return m_artists
; }
108 // the list of translators
109 void SetTranslators(const wxArrayString
& translators
)
110 { m_translators
= translators
; }
111 void AddTranslator(const wxString
& translator
)
112 { m_translators
.push_back(translator
); }
114 bool HasTranslators() const { return !m_translators
.empty(); }
115 const wxArrayString
& GetTranslators() const { return m_translators
; }
118 // implementation only
119 // -------------------
121 // "simple" about dialog shows only textual information (with possibly
122 // default icon but without hyperlink nor any long texts such as the
124 bool IsSimple() const
125 { return !HasWebSite() && !HasIcon() && !HasLicence(); }
127 // get the description and credits (i.e. all of developers, doc writers,
128 // artists and translators) as a one long multiline string
129 wxString
GetDescriptionAndCredits() const;
143 wxArrayString m_developers
,
149 // functions to show the about dialog box
150 WXDLLIMPEXP_CORE
void wxAboutBox(const wxAboutDialogInfo
& info
);
152 #endif // wxUSE_ABOUTDLG
154 #endif // _WX_ABOUTDLG_H_