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