]> git.saurik.com Git - wxWidgets.git/blob - interface/aboutdlg.h
75b2c01e810a0d3c11b0994976890be2ab4ff063
[wxWidgets.git] / interface / aboutdlg.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: aboutdlg.h
3 // Purpose: interface of wxAboutDialogInfo
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
8
9 /**
10 @class wxAboutDialogInfo
11 @wxheader{aboutdlg.h}
12
13 wxAboutDialogInfo contains information shown in the standard @e About
14 dialog displayed by the wxAboutBox function.
15
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 using
22 wxAboutDialogInfo::SetDevelopers and similar functions or built one by one using
23 wxAboutDialogInfo::AddDeveloper etc.
24
25 Please also notice that while all the main platforms have the native
26 implementation of the about dialog, they are often more limited than the
27 generic version provided by wxWidgets and so the generic version is used if
28 wxAboutDialogInfo has any fields not supported by the native version. Currently
29 GTK+ version supports all the possible fields natively but MSW and Mac versions
30 don't support URLs, licence text nor custom icons in the about dialog and if
31 either of those is used, wxAboutBox will automatically
32 use the generic version so you should avoid specifying these fields to achieve
33 more native look and feel.
34
35 @library{wxadv}
36 @category{FIXME}
37
38 @seealso
39 wxAboutDialogInfo::SetArtists
40 */
41 class wxAboutDialogInfo
42 {
43 public:
44 /**
45 Default constructor leaves all fields are initially uninitialized, in general
46 you should call at least SetVersion(), SetCopyright() and SetDescription().
47 */
48 wxAboutDialogInfo();
49
50 /**
51 Adds an artist name to be shown in the program credits.
52
53 @see SetArtists()
54 */
55 void AddArtist(const wxString& artist);
56
57 /**
58 Adds a developer name to be shown in the program credits.
59
60 @see SetDevelopers()
61 */
62 void AddDeveloper(const wxString& developer);
63
64 /**
65 Adds a documentation writer name to be shown in the program credits.
66
67 @see SetDocWriters()
68 */
69 void AddDocWriter(const wxString& docwriter);
70
71 /**
72 Adds a translator name to be shown in the program credits. Notice that if no
73 translator names are specified explicitely, wxAboutBox will try to use the
74 translation of the string @c translator-credits from the currently used message
75 catalog -- this can be used to show just the name of the translator of the
76 program in the current language.
77
78 @see SetTranslators()
79 */
80 void AddTranslator(const wxString& translator);
81
82 /**
83 Sets the the list of artists to be shown in the program credits.
84
85 @see AddArtist()
86 */
87 void SetArtists(const wxArrayString& artists);
88
89 /**
90 Set the short string containing the program copyright information. Notice that
91 any occurrences of @c "(C)" in @a copyright will be replaced by the
92 copyright symbol (circled C) automatically, which means that you can avoid
93 using this symbol in the program source code which can be problematic,
94 */
95 void SetCopyright(const wxString& copyright);
96
97 /**
98 Set brief, but possibly multiline, description of the program.
99 */
100 void SetDescription(const wxString& desc);
101
102 /**
103 Set the list of developers of the program.
104
105 @see AddDeveloper()
106 */
107 void SetDevelopers(const wxArrayString& developers);
108
109 /**
110 Set the list of documentation writers.
111
112 @see AddDocWriter()
113 */
114 void SetDocWriters(const wxArrayString& docwriters);
115
116 /**
117 Set the icon to be shown in the dialog. By default the icon of the main frame
118 will be shown if the native about dialog supports custom icons. If it doesn't
119 but a valid icon is specified using this method, the generic about dialog is
120 used instead so you should avoid calling this function for maximally native
121 look and feel.
122 */
123 void SetIcon(const wxIcon& icon);
124
125 /**
126 Set the long, multiline string containing the text of the program licence.
127
128 Only GTK+ version supports showing the licence text in the native about dialog
129 currently so the generic version will be used under all the other platforms if
130 this method is called. To preserve the native look and feel it is advised that
131 you do not call this method but provide a separate menu item in the
132 @c "Help" menu for displaying the text of your program licence.
133 */
134 void SetLicence(const wxString& licence);
135
136 /**
137 This is the same as SetLicence().
138 */
139 void SetLicense(const wxString& licence);
140
141 /**
142 Set the name of the program. If this method is not called, the string returned
143 by wxApp::GetAppName will be shown in the dialog.
144 */
145 void SetName(const wxString& name);
146
147 /**
148 Set the list of translators. Please see AddTranslator() for additional
149 discussion.
150 */
151 void SetTranslators(const wxArrayString& translators);
152
153 /**
154 Set the version of the program. The version is in free format, i.e. not
155 necessarily in the @c x.y.z form but it shouldn't contain the "version" word.
156 */
157 void SetVersion(const wxString& version);
158
159 /**
160 Set the web site for the program and its description (which defaults to @a url
161 itself if empty).
162
163 Please notice that only GTK+ version currently supports showing the link in the
164 native about dialog so if this method is called, the generic version will be
165 used under all the other platforms.
166 */
167 void SetWebSite(const wxString& url,
168 const wxString& desc = wxEmptyString);
169 };
170
171
172 // ============================================================================
173 // Global functions/macros
174 // ============================================================================
175
176 /**
177 This function shows the standard about dialog containing the information
178 specified in @a info. If the current platform has a native about dialog
179 which is capable of showing all the fields in @a info, the native dialog is
180 used, otherwise the function falls back to the generic wxWidgets version of
181 the dialog, i.e. does the same thing as wxGenericAboutBox.
182
183 Here is an example of how this function may be used:
184
185 @code
186 void MyFrame::ShowSimpleAboutDialog(wxCommandEvent& WXUNUSED(event))
187 {
188 wxAboutDialogInfo info;
189 info.SetName(_("My Program"));
190 info.SetVersion(_("1.2.3 Beta"));
191 info.SetDescription(_("This program does something great."));
192 info.SetCopyright(_T("(C) 2007 Me my@email.addre.ss"));
193
194 wxAboutBox(info);
195 }
196 @endcode
197
198 Please see the @ref page_utils_samples_dialogs for more examples of
199 using this function and wxAboutDialogInfo for the description of the
200 information which can be shown in the about dialog.
201 */
202 void wxAboutBox(const wxAboutDialogInfo& info);
203
204 /**
205 This function does the same thing as wxAboutBox except that it always uses
206 the generic wxWidgets version of the dialog instead of the native one.
207
208 This is mainly useful if you need to customize the dialog by e.g. adding
209 custom controls to it (customizing the native dialog is not currently
210 supported).
211
212 See the @ref page_utils_samples_dialogs for an example of about dialog
213 customization.
214
215 @see wxAboutDialogInfo
216 */
217 void wxGenericAboutBox(const wxAboutDialogInfo& info);
218