]>
git.saurik.com Git - wxWidgets.git/blob - interface/aboutdlg.h
3159a11a307d1c0591ec4a9acb4f69654372e6c4
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: documentation for wxAboutDialogInfo class
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
10 @class wxAboutDialogInfo
13 wxAboutDialogInfo contains information shown in the standard @e About
14 dialog displayed by the wxAboutBox function.
16 This class contains the general information about the program, such as its
17 name, version, copyright and so on, as well as lists of the program developers,
18 documentation writers, artists and translators. The simple properties from the
19 former group are represented as a string with the exception of the program icon
20 and the program web site, while the lists from the latter group are stored as
21 wxArrayString and can be either set entirely at once
22 using wxAboutDialogInfo::SetDevelopers and similar
23 functions or built one by one using wxAboutDialogInfo::AddDeveloper
26 Please also notice that while all the main platforms have the native
27 implementation of the about dialog, they are often more limited than the
28 generic version provided by wxWidgets and so the generic version is used if
29 wxAboutDialogInfo has any fields not supported by the native version. Currently
30 GTK+ version supports all the possible fields natively but MSW and Mac versions
31 don't support URLs, licence text nor custom icons in the about dialog and if
32 either of those is used, wxAboutBox will automatically
33 use the generic version so you should avoid specifying these fields to achieve
34 more native look and feel.
40 wxAboutDialogInfo::SetArtists
42 class wxAboutDialogInfo
46 Default constructor leaves all fields are initially uninitialized, in general
47 you should call at least SetVersion(), SetCopyright() and SetDescription().
52 Adds an artist name to be shown in the program credits.
56 void AddArtist(const wxString
& artist
);
59 Adds a developer name to be shown in the program credits.
63 void AddDeveloper(const wxString
& developer
);
66 Adds a documentation writer name to be shown in the program credits.
70 void AddDocWriter(const wxString
& docwriter
);
73 Adds a translator name to be shown in the program credits. Notice that if no
74 translator names are specified explicitely, wxAboutBox will try to use the
75 translation of the string @c translator-credits from the currently used message
76 catalog -- this can be used to show just the name of the translator of the
77 program in the current language.
81 void AddTranslator(const wxString
& translator
);
84 Sets the the list of artists to be shown in the program credits.
88 void SetArtists(const wxArrayString
& artists
);
91 Set the short string containing the program copyright information. Notice
92 that any occurrences of @c "(C)" in @e copyright will be replaced by the
93 copyright symbol (circled C) automatically, which means that you can avoid
94 using this symbol in the program source code which can be problematic,
96 void SetCopyright(const wxString
& copyright
);
99 Set brief, but possibly multiline, description of the program.
101 void SetDescription(const wxString
& desc
);
104 Set the list of developers of the program.
108 void SetDevelopers(const wxArrayString
& developers
);
111 Set the list of documentation writers.
115 void SetDocWriters(const wxArrayString
& docwriters
);
118 Set the icon to be shown in the dialog. By default the icon of the main frame
119 will be shown if the native about dialog supports custom icons. If it doesn't
120 but a valid icon is specified using this method, the generic about dialog is
121 used instead so you should avoid calling this function for maximally native
124 void SetIcon(const wxIcon
& icon
);
127 Set the long, multiline string containing the text of the program licence.
129 Only GTK+ version supports showing the licence text in the native about dialog
130 currently so the generic version will be used under all the other platforms if
131 this method is called. To preserve the native look and feel it is advised that
132 you do not call this method but provide a separate menu item in the
133 @c "Help" menu for displaying the text of your program licence.
135 void SetLicence(const wxString
& licence
);
138 This is the same as SetLicence().
140 void SetLicense(const wxString
& licence
);
143 Set the name of the program. If this method is not called, the string returned
144 by wxApp::GetAppName will be shown in the dialog.
146 void SetName(const wxString
& name
);
149 Set the list of translators. Please see AddTranslator() for additional
152 void SetTranslators(const wxArrayString
& translators
);
155 Set the version of the program. The version is in free format, i.e. not
156 necessarily in the @c x.y.z form but it shouldn't contain the "version" word.
158 void SetVersion(const wxString
& version
);
161 Set the web site for the program and its description (which defaults to URL
164 Please notice that only GTK+ version currently supports showing the link in the
165 native about dialog so if this method is called, the generic version will be
166 used under all the other platforms.
168 void SetWebSite(const wxString
& url
,
169 const wxString
& desc
= wxEmptyString
);
173 // ============================================================================
174 // Global functions/macros
175 // ============================================================================
178 This function shows the standard about dialog containing the information
179 specified in @e info. If the current platform has a native about dialog
180 which is capable of showing all the fields in @e info, the native dialog is
181 used, otherwise the function falls back to the generic wxWidgets version of the
182 dialog, i.e. does the same thing as wxGenericAboutBox.
184 Here is an example of how this function may be used:
187 void MyFrame::ShowSimpleAboutDialog(wxCommandEvent& WXUNUSED(event))
189 wxAboutDialogInfo info;
190 info.SetName(_("My Program"));
191 info.SetVersion(_("1.2.3 Beta"));
192 info.SetDescription(_("This program does something great."));
193 info.SetCopyright(_T("(C) 2007 Me my@email.addre.ss"));
199 Please see the @ref overview_sampledialogs "dialogs sample" for more examples of
200 using this function and wxAboutDialogInfo for the
201 description of the information which can be shown in the about dialog.
203 void wxAboutBox(const wxAboutDialogInfo
& info
);
206 This function does the same thing as wxAboutBox except
207 that it always uses the generic wxWidgets version of the dialog instead of the
208 native one. This is mainly useful if you need to customize the dialog by e.g.
209 adding custom controls to it (customizing the native dialog is not currently
212 See the @ref overview_sampledialogs "dialogs sample" for an example of about
213 dialog customization.
215 @sa wxAboutDialogInfo
217 void wxGenericAboutBox(const wxAboutDialogInfo
& info
);