]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/aboutdlg.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxAboutDialogInfo
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
10 @class wxAboutDialogInfo
12 wxAboutDialogInfo contains information shown in the standard @e About
13 dialog displayed by the wxAboutBox() function.
15 This class contains the general information about the program, such as its
16 name, version, copyright and so on, as well as lists of the program developers,
17 documentation writers, artists and translators. The simple properties from the
18 former group are represented as a string with the exception of the program icon
19 and the program web site, while the lists from the latter group are stored as
20 wxArrayString and can be either set entirely at once using
21 wxAboutDialogInfo::SetDevelopers and similar functions or built one by one using
22 wxAboutDialogInfo::AddDeveloper etc.
24 Please also notice that while all the main platforms have the native
25 implementation of the about dialog, they are often more limited than the
26 generic version provided by wxWidgets and so the generic version is used if
27 wxAboutDialogInfo has any fields not supported by the native version. Currently
28 GTK+ version supports all the possible fields natively but MSW and Mac versions
29 don't support URLs, licence text nor custom icons in the about dialog and if
30 either of those is used, wxAboutBox() will automatically use the generic version
31 so you should avoid specifying these fields to achieve more native look and feel.
35 void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
37 wxAboutDialogInfo aboutInfo;
38 aboutInfo.SetName("MyApp");
39 aboutInfo.SetVersion(MY_APP_VERSION_STRING);
40 aboutInfo.SetDescription(_("My wxWidgets-based application!"));
41 aboutInfo.SetCopyright("(C) 1992-2010");
42 aboutInfo.SetWebSite("http://myapp.org");
43 aboutInfo.AddDeveloper("My Self");
45 wxAboutBox(aboutInfo);
50 @category{cmndlg,data}
52 @see wxAboutDialogInfo::SetArtists
54 class wxAboutDialogInfo
58 Default constructor leaves all fields are initially uninitialized, in general
59 you should call at least SetVersion(), SetCopyright() and SetDescription().
64 Adds an artist name to be shown in the program credits.
68 void AddArtist(const wxString
& artist
);
71 Adds a developer name to be shown in the program credits.
75 void AddDeveloper(const wxString
& developer
);
78 Adds a documentation writer name to be shown in the program credits.
82 void AddDocWriter(const wxString
& docwriter
);
85 Adds a translator name to be shown in the program credits. Notice that if no
86 translator names are specified explicitely, wxAboutBox() will try to use the
87 translation of the string @c translator-credits from the currently used message
88 catalog -- this can be used to show just the name of the translator of the
89 program in the current language.
93 void AddTranslator(const wxString
& translator
);
96 Sets the the list of artists to be shown in the program credits.
100 void SetArtists(const wxArrayString
& artists
);
103 Set the short string containing the program copyright information. Notice that
104 any occurrences of @c "(C)" in @a copyright will be replaced by the
105 copyright symbol (circled C) automatically, which means that you can avoid
106 using this symbol in the program source code which can be problematic,
108 void SetCopyright(const wxString
& copyright
);
111 Set brief, but possibly multiline, description of the program.
113 void SetDescription(const wxString
& desc
);
116 Set the list of developers of the program.
120 void SetDevelopers(const wxArrayString
& developers
);
123 Set the list of documentation writers.
127 void SetDocWriters(const wxArrayString
& docwriters
);
130 Set the icon to be shown in the dialog. By default the icon of the main frame
131 will be shown if the native about dialog supports custom icons. If it doesn't
132 but a valid icon is specified using this method, the generic about dialog is
133 used instead so you should avoid calling this function for maximally native
136 void SetIcon(const wxIcon
& icon
);
139 Set the long, multiline string containing the text of the program licence.
141 Only GTK+ version supports showing the licence text in the native about dialog
142 currently so the generic version will be used under all the other platforms if
143 this method is called. To preserve the native look and feel it is advised that
144 you do not call this method but provide a separate menu item in the
145 @c "Help" menu for displaying the text of your program licence.
147 void SetLicence(const wxString
& licence
);
150 This is the same as SetLicence().
152 void SetLicense(const wxString
& licence
);
155 Set the name of the program. If this method is not called, the string returned
156 by wxApp::GetAppName will be shown in the dialog.
158 void SetName(const wxString
& name
);
161 Set the list of translators. Please see AddTranslator() for additional
164 void SetTranslators(const wxArrayString
& translators
);
167 Set the version of the program. The word "version" shouldn't be included
168 in @a version. Example @a version values: "1.2" and "RC2". In about dialogs
169 with more space set aside for version information, @a longVersion is used.
170 Example @a longVersion values: "Version 1.2" and "Release Candidate 2".
171 If @a version is non-empty but @a longVersion is empty, a long version
172 is constructed automatically, using @a version (by simply prepending
173 "Version " to @a version).
175 The generic about dialog and native GTK+ dialog use @a version only,
176 as a suffix to the program name. The native MSW and OS X about dialogs
177 use the long version.
179 void SetVersion(const wxString
& version
, const wxString
& longVersion
= wxString());
182 Set the web site for the program and its description (which defaults to @a url
185 Please notice that only GTK+ version currently supports showing the link in the
186 native about dialog so if this method is called, the generic version will be
187 used under all the other platforms.
189 void SetWebSite(const wxString
& url
,
190 const wxString
& desc
= wxEmptyString
);
194 // ============================================================================
195 // Global functions/macros
196 // ============================================================================
198 /** @addtogroup group_funcmacro_dialog */
202 This function shows the standard about dialog containing the information
203 specified in @a info. If the current platform has a native about dialog
204 which is capable of showing all the fields in @a info, the native dialog is
205 used, otherwise the function falls back to the generic wxWidgets version of
206 the dialog, i.e. does the same thing as wxGenericAboutBox.
208 Here is an example of how this function may be used:
211 void MyFrame::ShowSimpleAboutDialog(wxCommandEvent& WXUNUSED(event))
213 wxAboutDialogInfo info;
214 info.SetName(_("My Program"));
215 info.SetVersion(_("1.2.3 Beta"));
216 info.SetDescription(_("This program does something great."));
217 info.SetCopyright(wxT("(C) 2007 Me <my@email.addre.ss>"));
223 Please see the @ref page_samples_dialogs for more examples of using this
224 function and wxAboutDialogInfo for the description of the information which
225 can be shown in the about dialog.
227 @header{wx/aboutdlg.h}
229 void wxAboutBox(const wxAboutDialogInfo
& info
, wxWindow
* parent
= NULL
);
232 This function does the same thing as wxAboutBox() except that it always uses
233 the generic wxWidgets version of the dialog instead of the native one.
235 This is mainly useful if you need to customize the dialog by e.g. adding
236 custom controls to it (customizing the native dialog is not currently
239 See the @ref page_samples_dialogs for an example of about dialog
242 @see wxAboutDialogInfo
244 @header{wx/aboutdlg.h}
246 void wxGenericAboutBox(const wxAboutDialogInfo
& info
, wxWindow
* parent
= NULL
);