]>
Commit | Line | Data |
---|---|---|
4514447c FM |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: utilities.h | |
3 | // Purpose: Utilities page of the Doxygen manual | |
4 | // Author: wxWidgets team | |
5 | // RCS-ID: $Id$ | |
6 | // Licence: wxWindows license | |
7 | ///////////////////////////////////////////////////////////////////////////// | |
8 | ||
880efa2a | 9 | /** |
4514447c FM |
10 | |
11 | @page page_utils Utilities and samples supplied with wxWidgets | |
12 | ||
13 | @li @ref page_utils_utils | |
14 | @li @ref page_utils_samples | |
15 | ||
16 | ||
17 | <hr> | |
18 | ||
19 | ||
20 | @section page_utils_utils Utilities | |
21 | ||
69bc0cca | 22 | In addition to the @ref page_libs, some |
4514447c FM |
23 | additional utilities are supplied in the @c utils hierarchy. |
24 | ||
25 | For other user-contributed packages, please see the Contributions page | |
26 | on the wxWidgets Web site http://www.wxwidgets.org. | |
27 | ||
28 | ||
29 | @subsection page_utils_utils_helpview Helpview | |
30 | ||
31 | Helpview is a program for displaying wxWidgets HTML | |
32 | Help files. In many cases, you may wish to use the wxWidgets HTML | |
33 | Help classes from within your application, but this provides a | |
42efa498 | 34 | handy stand-alone viewer. See @ref overview_html for more details. |
4514447c FM |
35 | You can find it in @c samples/html/helpview. |
36 | ||
37 | @subsection page_utils_utils_tex2rtf Tex2RTF | |
38 | ||
3c4f71cc | 39 | Supplied with wxWidgets is a utility called Tex2RTF for |
4514447c | 40 | converting @e LaTeX manuals HTML, MS HTML Help, wxHTML Help, RTF, and Windows |
3c4f71cc VS |
41 | Help RTF formats. Tex2RTF was used for the wxWidgets manuals and can be used |
42 | independently by authors wishing to create on-line and printed manuals from the | |
4514447c FM |
43 | same @e LaTeX source. Please see the separate documentation for Tex2RTF. |
44 | You can find it under @c utils/tex2rtf. | |
45 | ||
46 | @subsection page_utils_utils_helpgen Helpgen | |
47 | ||
48 | Helpgen takes C++ header files and generates a Tex2RTF-compatible | |
49 | documentation file for each class it finds, using comments as appropriate. | |
50 | This is a good way to start a reference for a set of classes. | |
51 | Helpgen can be found in @c utils/HelpGen. | |
52 | ||
53 | @subsection page_utils_utils_emulator Emulator | |
54 | ||
55 | Xnest-based display emulator for X11-based PDA applications. | |
56 | On some systems, the Xnest window does not synchronise with the | |
57 | 'skin' window. This program can be found in @c utils/emulator. | |
58 | ||
59 | ||
60 | ||
61 | ||
62 | @section page_utils_samples Samples | |
3c4f71cc | 63 | |
4514447c FM |
64 | Probably the best way to learn wxWidgets is by reading the source of some 50+ |
65 | samples provided with it. Many aspects of wxWidgets programming can be learnt | |
66 | from them, but sometimes it is not simple to just choose the right sample to | |
67 | look at. This overview aims at describing what each sample does/demonstrates to | |
68 | make it easier to find the relevant one if a simple grep through all sources | |
69 | didn't help. They also provide some notes about using the samples and what | |
70 | features of wxWidgets are they supposed to test. | |
3c4f71cc | 71 | |
4514447c FM |
72 | There are currently more than 50 different samples as part of wxWidgets and |
73 | this list is not complete. You should start your tour of wxWidgets with the | |
74 | minimal sample which is the wxWidgets version of | |
75 | "Hello, world!". It shows the basic structure of wxWidgets program and is the | |
76 | most commented sample of all - looking at its source code is recommended. | |
3c4f71cc | 77 | |
4514447c FM |
78 | The next most useful samples are probably widgets |
79 | and controls which show many of wxWidgets native and | |
80 | generic controls, such as buttons, listboxes, checkboxes, comboboxes etc. | |
3c4f71cc | 81 | |
4514447c FM |
82 | Other, more complicated controls, have their own samples. In this category you |
83 | may find the following samples showing the corresponding controls: | |
3c4f71cc | 84 | |
4514447c FM |
85 | @li wxCalendarCtrl: @ref page_utils_samples_calendar |
86 | @li wxListCtrl: @ref page_utils_samples_listctrl | |
87 | @li wxTreeCtrl: @ref page_utils_samples_treectrl | |
88 | @li wxGrid: @ref page_utils_samples_grid | |
3c4f71cc | 89 | |
4514447c FM |
90 | Finally, it might be helpful to do a search in the entire sample directory if |
91 | you can't find the sample showing the control you are interested in by | |
92 | name. Most classes contained in wxWidgets occur in at least one of the samples. | |
3c4f71cc VS |
93 | |
94 | ||
4514447c | 95 | @subsection page_utils_samples_minimal Minimal sample |
3c4f71cc | 96 | |
4514447c FM |
97 | The minimal sample is what most people will know under the term Hello World, |
98 | i.e. a minimal program that doesn't demonstrate anything apart from what is | |
99 | needed to write a program that will display a "hello" dialog. This is usually | |
100 | a good starting point for learning how to use wxWidgets. | |
3c4f71cc VS |
101 | |
102 | ||
4514447c | 103 | @subsection page_utils_samples_animate Animate sample |
3c4f71cc | 104 | |
4514447c FM |
105 | The @c animate sample shows how you can use wxAnimationCtrl |
106 | control and shows concept of a platform-dependent animation encapsulated | |
107 | in wxAnimation. | |
3c4f71cc VS |
108 | |
109 | ||
4514447c | 110 | @subsection page_utils_samples_artprovider Art provider sample |
3c4f71cc | 111 | |
4514447c FM |
112 | The @c artprov sample shows how you can customize the look of standard |
113 | wxWidgets dialogs by replacing default bitmaps/icons with your own versions. | |
114 | It also shows how you can use wxArtProvider to | |
115 | get stock bitmaps for use in your application. | |
3c4f71cc VS |
116 | |
117 | ||
4514447c | 118 | @subsection page_utils_samples_calendar Calendar sample |
3c4f71cc | 119 | |
4514447c FM |
120 | This font shows the calendar control in action. It |
121 | shows how to configure the control (see the different options in the calendar | |
122 | menu) and also how to process the notifications from it. | |
3c4f71cc VS |
123 | |
124 | ||
4514447c | 125 | @subsection page_utils_samples_config Config sample |
3c4f71cc | 126 | |
4514447c FM |
127 | This sample demonstrates the wxConfig classes in a platform |
128 | independent way, i.e. it uses text based files to store a given configuration under | |
129 | Unix and uses the Registry under Windows. | |
3c4f71cc | 130 | |
cd5d1e27 | 131 | See @ref overview_config for the descriptions of all features of this class. |
3c4f71cc VS |
132 | |
133 | ||
4514447c | 134 | @subsection page_utils_samples_controls Controls sample |
3c4f71cc | 135 | |
4514447c FM |
136 | The controls sample is the main test program for most simple controls used in |
137 | wxWidgets. The sample tests their basic functionality, events, placement, | |
138 | modification in terms of colour and font as well as the possibility to change | |
139 | the controls programmatically, such as adding an item to a list box etc. Apart | |
140 | from that, the sample uses a wxNotebook and tests most | |
141 | features of this special control (using bitmap in the tabs, using | |
3c4f71cc | 142 | wxSizer instances and wxLayoutConstraints within notebook pages, advancing pages |
4514447c | 143 | programmatically and vetoing a page change by intercepting the wxNotebookEvent. |
3c4f71cc | 144 | |
4514447c | 145 | The various controls tested are listed here: |
3c4f71cc | 146 | |
4514447c FM |
147 | @li wxButton |
148 | @li wxBitmapButton | |
149 | @li wxCheckBox | |
150 | @li wxChoice | |
151 | @li wxComboBox | |
152 | @li wxGauge | |
153 | @li wxStaticBox | |
154 | @li wxListBox | |
155 | @li wxSpinCtrl | |
156 | @li wxSpinButton | |
157 | @li wxStaticText | |
158 | @li wxStaticBitmap | |
159 | @li wxRadioBox | |
160 | @li wxRadioButton | |
161 | @li wxSlider | |
3c4f71cc VS |
162 | |
163 | ||
4514447c | 164 | @subsection page_utils_samples_debugrpt DebugRpt sample |
3c4f71cc | 165 | |
4514447c FM |
166 | This sample shows how to use wxDebugReport class to |
167 | generate a debug report in case of a program crash or otherwise. On start up, | |
168 | it proposes to either crash itself (by dereferencing a NULL pointer) or | |
169 | generate debug report without doing it. Next it initializes the debug report | |
170 | with standard information adding a custom file to it (just a timestamp) and | |
171 | allows to view the information gathered using | |
172 | wxDebugReportPreview. | |
3c4f71cc | 173 | |
4514447c FM |
174 | For the report processing part of the sample to work you should make available |
175 | a Web server accepting form uploads, otherwise | |
176 | wxDebugReportUpload will report an error. | |
3c4f71cc VS |
177 | |
178 | ||
4514447c | 179 | @subsection page_utils_samples_dialogs Dialogs sample |
3c4f71cc | 180 | |
4514447c | 181 | This sample shows how to use the common dialogs available from wxWidgets. These |
cd5d1e27 | 182 | dialogs are described in detail in the @ref overview_cmndlg. |
3c4f71cc VS |
183 | |
184 | ||
4514447c | 185 | @subsection page_utils_samples_dialup Dialup sample |
3c4f71cc | 186 | |
4514447c FM |
187 | This sample shows the wxDialUpManager |
188 | class. In the status bar, it displays the information gathered through its | |
189 | interface: in particular, the current connection status (online or offline) and | |
190 | whether the connection is permanent (in which case a string `LAN' appears in | |
191 | the third status bar field - but note that you may be on a LAN not | |
192 | connected to the Internet, in which case you will not see this) or not. | |
3c4f71cc | 193 | |
4514447c FM |
194 | Using the menu entries, you may also dial or hang up the line if you have a |
195 | modem attached and (this only makes sense for Windows) list the available | |
196 | connections. | |
3c4f71cc VS |
197 | |
198 | ||
4514447c | 199 | @subsection page_utils_samples_dnd DnD sample |
3c4f71cc | 200 | |
4514447c FM |
201 | This sample shows both clipboard and drag and drop in action. It is quite non |
202 | trivial and may be safely used as a basis for implementing the clipboard and | |
203 | drag and drop operations in a real-life program. | |
3c4f71cc | 204 | |
4514447c FM |
205 | When you run the sample, its screen is split in several parts. On the top, |
206 | there are two listboxes which show the standard derivations of | |
207 | wxDropTarget: | |
208 | wxTextDropTarget and | |
209 | wxFileDropTarget. | |
3c4f71cc | 210 | |
4514447c FM |
211 | The middle of the sample window is taken by the log window which shows what is |
212 | going on (of course, this only works in debug builds) and may be helpful to see | |
213 | the sequence of steps of data transfer. | |
3c4f71cc | 214 | |
4514447c FM |
215 | Finally, the last part is used for dragging text from it to either one of the |
216 | listboxes (only one will accept it) or another application. The last | |
217 | functionality available from the main frame is to paste a bitmap from the | |
218 | clipboard (or, in the case of the Windows version, also a metafile) - it will be | |
219 | shown in a new frame. | |
3c4f71cc | 220 | |
4514447c FM |
221 | So far, everything we mentioned was implemented with minimal amount of code |
222 | using standard wxWidgets classes. The more advanced features are demonstrated | |
223 | if you create a shape frame from the main frame menu. A shape is a geometric | |
224 | object which has a position, size and color. It models some | |
225 | application-specific data in this sample. A shape object supports its own | |
226 | private wxDataFormat which means that you may cut and | |
227 | paste it or drag and drop (between one and the same or different shapes) from | |
228 | one sample instance to another (or the same). However, chances are that no | |
229 | other program supports this format and so shapes can also be rendered as | |
230 | bitmaps which allows them to be pasted/dropped in many other applications | |
231 | (and, under Windows, also as metafiles which are supported by most of Windows | |
232 | programs as well - try Write/Wordpad, for example). | |
3c4f71cc | 233 | |
4514447c FM |
234 | Take a look at DnDShapeDataObject class to see how you may use |
235 | wxDataObject to achieve this. | |
3c4f71cc VS |
236 | |
237 | ||
4514447c | 238 | @subsection page_utils_samples_event Event sample |
3c4f71cc | 239 | |
4514447c FM |
240 | The event sample demonstrates various features of the wxWidgets events. It |
241 | shows using dynamic events and connecting/disconnecting the event handlers | |
242 | during run time and also using | |
243 | PushEventHandler() and | |
244 | PopEventHandler(). | |
3c4f71cc VS |
245 | |
246 | ||
4514447c | 247 | @subsection page_utils_samples_except Except(ions) sample |
3c4f71cc | 248 | |
4514447c FM |
249 | This very simple sample shows how to use C++ exceptions in wxWidgets programs, |
250 | i.e. where to catch the exception which may be thrown by the program code. It | |
251 | doesn't do anything very exciting by itself, you need to study its code to | |
252 | understand what goes on. | |
3c4f71cc | 253 | |
4514447c FM |
254 | You need to build the library with @c wxUSE_EXCEPTIONS being set to @c 1 |
255 | and compile your code with C++ exceptions support to be able to build this | |
256 | sample. | |
3c4f71cc VS |
257 | |
258 | ||
4514447c | 259 | @subsection page_utils_samples_exec Exec sample |
3c4f71cc | 260 | |
4514447c FM |
261 | The exec sample demonstrates the wxExecute and |
262 | wxShell functions. Both of them are used to execute the | |
263 | external programs and the sample shows how to do this synchronously (waiting | |
264 | until the program terminates) or asynchronously (notification will come later). | |
3c4f71cc | 265 | |
4514447c FM |
266 | It also shows how to capture the output of the child process in both |
267 | synchronous and asynchronous cases and how to kill the processes with | |
268 | wxProcess::Kill and test for their existence with | |
269 | wxProcess::Exists. | |
3c4f71cc VS |
270 | |
271 | ||
4514447c | 272 | @subsection page_utils_samples_font Font sample |
3c4f71cc | 273 | |
4514447c FM |
274 | The font sample demonstrates wxFont, |
275 | wxFontEnumerator and | |
276 | wxFontMapper classes. It allows you to see the fonts | |
277 | available (to wxWidgets) on the computer and shows all characters of the | |
278 | chosen font as well. | |
3c4f71cc VS |
279 | |
280 | ||
4514447c | 281 | @subsection page_utils_samples_grid Grid sample |
3c4f71cc | 282 | |
4514447c | 283 | TODO. |
3c4f71cc VS |
284 | |
285 | ||
4514447c | 286 | @subsection page_utils_samples_html HTML samples |
3c4f71cc | 287 | |
4514447c FM |
288 | Eight HTML samples (you can find them in directory @c samples/html) |
289 | cover all features of the HTML sub-library. | |
3c4f71cc | 290 | |
4514447c FM |
291 | @li @b Test demonstrates how to create wxHtmlWindow |
292 | and also shows most supported HTML tags. | |
3c4f71cc | 293 | |
4514447c FM |
294 | @li @b Widget shows how you can embed ordinary controls or windows within an |
295 | HTML page. It also nicely explains how to write new tag handlers and extend | |
296 | the library to work with unsupported tags. | |
3c4f71cc | 297 | |
4514447c | 298 | @li @b About may give you an idea how to write good-looking About boxes. |
3c4f71cc | 299 | |
4514447c FM |
300 | @li @b Zip demonstrates use of virtual file systems in wxHTML. The zip archives |
301 | handler (ships with wxWidgets) allows you to access HTML pages stored | |
302 | in a compressed archive as if they were ordinary files. | |
3c4f71cc | 303 | |
4514447c FM |
304 | @li @b Virtual is yet another virtual file systems demo. This one generates pages at run-time. |
305 | You may find it useful if you need to display some reports in your application. | |
3c4f71cc | 306 | |
4514447c FM |
307 | @li @b Printing explains use of wxHtmlEasyPrinting |
308 | class which serves as as-simple-as-possible interface for printing HTML | |
309 | documents without much work. In fact, only few function calls are sufficient. | |
3c4f71cc | 310 | |
4514447c FM |
311 | @li @b Help and @b Helpview are variations on displaying HTML help |
312 | (compatible with MS HTML Help Workshop). @e Help shows how to embed | |
313 | wxHtmlHelpController in your application | |
314 | while @e Helpview is a simple tool that only pops up the help window and | |
315 | displays help books given at command line. | |
3c4f71cc VS |
316 | |
317 | ||
4514447c | 318 | @subsection page_utils_samples_image Image sample |
3c4f71cc | 319 | |
4514447c FM |
320 | The image sample demonstrates use of the wxImage class |
321 | and shows how to download images in a variety of formats, currently PNG, GIF, | |
322 | TIFF, JPEG, BMP, PNM and PCX. The top of the sample shows two rectangles, one | |
323 | of which is drawn directly in the window, the other one is drawn into a | |
324 | wxBitmap, converted to a wxImage, saved as a PNG image | |
325 | and then reloaded from the PNG file again so that conversions between wxImage | |
326 | and wxBitmap as well as loading and saving PNG files are tested. | |
3c4f71cc | 327 | |
4514447c FM |
328 | At the bottom of the main frame there is a test for using a monochrome bitmap by |
329 | drawing into a wxMemoryDC. The bitmap is then drawn | |
330 | specifying the foreground and background colours with | |
331 | wxDC::SetTextForeground and | |
332 | wxDC::SetTextBackground (on the left). The | |
333 | bitmap is then converted to a wxImage and the foreground colour (black) is | |
334 | replaced with red using wxImage::Replace. | |
3c4f71cc | 335 | |
4514447c FM |
336 | This sample also contains the code for testing the image rotation and resizing |
337 | and using raw bitmap access, see the corresponding menu commands. | |
3c4f71cc VS |
338 | |
339 | ||
4514447c | 340 | @subsection page_utils_samples_internat Internat(ionalization) sample |
3c4f71cc | 341 | |
4514447c FM |
342 | The not very clearly named internat sample demonstrates the wxWidgets |
343 | internationalization (i18n for short from now on) features. To be more | |
344 | precise, it only shows localization support, i.e. support for translating the | |
345 | program messages into another language while true i18n would also involve | |
346 | changing the other aspects of the programs behaviour. | |
3c4f71cc | 347 | |
4514447c | 348 | More information about this sample can be found in the @c readme.txt file in |
a766986f | 349 | its directory. Please also see the @ref overview_i18n. |
3c4f71cc VS |
350 | |
351 | ||
4514447c | 352 | @subsection page_utils_samples_layout Layout sample |
3c4f71cc | 353 | |
4514447c FM |
354 | The layout sample demonstrates the two different layout systems offered |
355 | by wxWidgets. When starting the program, you will see a frame with some | |
356 | controls and some graphics. The controls will change their size whenever | |
357 | you resize the entire frame and the exact behaviour of the size changes | |
358 | is determined using the wxLayoutConstraints | |
359 | class. See also the overview and the | |
360 | wxIndividualLayoutConstraint | |
361 | class for further information. | |
3c4f71cc | 362 | |
4514447c FM |
363 | The menu in this sample offers two more tests, one showing how to use |
364 | a wxBoxSizer in a simple dialog and the other one | |
365 | showing how to use sizers in connection with a wxNotebook | |
366 | class. See also wxSizer. | |
3c4f71cc VS |
367 | |
368 | ||
4514447c | 369 | @subsection page_utils_samples_listctrl Listctrl sample |
3c4f71cc | 370 | |
4514447c FM |
371 | This sample shows the wxListCtrl control. Different modes |
372 | supported by the control (list, icons, small icons, report) may be chosen from | |
373 | the menu. | |
3c4f71cc | 374 | |
4514447c FM |
375 | The sample also provides some timings for adding/deleting/sorting a lot of |
376 | (several thousands) items into the control. | |
3c4f71cc VS |
377 | |
378 | ||
4514447c | 379 | @subsection page_utils_samples_mediaplayer Mediaplayer sample |
3c4f71cc | 380 | |
4514447c FM |
381 | This sample demonstrates how to use all the features of |
382 | wxMediaCtrl and play various types of sound, video, | |
383 | and other files. | |
3c4f71cc | 384 | |
4514447c | 385 | It replaces the old dynamic sample. |
3c4f71cc | 386 | |
4514447c FM |
387 | |
388 | @subsection page_utils_samples_notebook Notebook sample | |
3c4f71cc | 389 | |
4514447c FM |
390 | This samples shows wxBookCtrl family of controls. |
391 | Although initially it was written to demonstrate wxNotebook | |
392 | only, it can now be also used to see wxListbook, | |
393 | wxChoicebook and wxTreebook in action. | |
3c4f71cc | 394 | Test each of the controls, their orientation, images and pages using |
4514447c | 395 | commands through menu. |
3c4f71cc VS |
396 | |
397 | ||
4514447c | 398 | @subsection page_utils_samples_render Render sample |
3c4f71cc | 399 | |
4514447c FM |
400 | This sample shows how to replace the default wxWidgets |
401 | renderer and also how to write a shared library | |
402 | (DLL) implementing a renderer and load and unload it during the run-time. | |
3c4f71cc VS |
403 | |
404 | ||
4514447c | 405 | @subsection page_utils_samples_scrollsub Scroll subwindow sample |
3c4f71cc | 406 | |
4514447c FM |
407 | This sample demonstrates use of the wxScrolledWindow |
408 | class including placing subwindows into it and drawing simple graphics. It uses the | |
409 | SetTargetWindow method and thus the effect | |
410 | of scrolling does not show in the scrolled window itself, but in one of its subwindows. | |
3c4f71cc | 411 | |
4514447c FM |
412 | Additionally, this samples demonstrates how to optimize drawing operations in wxWidgets, |
413 | in particular using the wxWindow::IsExposed method with | |
414 | the aim to prevent unnecessary drawing in the window and thus reducing or removing | |
415 | flicker on screen. | |
3c4f71cc VS |
416 | |
417 | ||
4514447c | 418 | @subsection page_utils_samples_sockets Sockets sample |
3c4f71cc | 419 | |
4514447c FM |
420 | The sockets sample demonstrates how to use the communication facilities |
421 | provided by wxSocket. There are two different | |
422 | applications in this sample: a server, which is implemented using a | |
423 | wxSocketServer object, and a client, which | |
424 | is implemented as a wxSocketClient. | |
3c4f71cc | 425 | |
4514447c FM |
426 | The server binds to the local address, using TCP port number 3000, |
427 | sets up an event handler to be notified of incoming connection requests | |
428 | (@b wxSOCKET_CONNECTION events), and sits there, waiting for clients | |
429 | (@e listening, in socket parlance). For each accepted connection, | |
430 | a new wxSocketBase object is created. These | |
431 | socket objects are independent from the server that created them, so | |
432 | they set up their own event handler, and then request to be notified | |
433 | of @b wxSOCKET_INPUT (incoming data) or @b wxSOCKET_LOST | |
434 | (connection closed at the remote end) events. In the sample, the event | |
435 | handler is the same for all connections; to find out which socket the | |
436 | event is addressed to, the GetSocket function | |
437 | is used. | |
3c4f71cc | 438 | |
4514447c FM |
439 | Although it might take some time to get used to the event-oriented |
440 | system upon which wxSocket is built, the benefits are many. See, for | |
441 | example, that the server application, while being single-threaded | |
442 | (and of course without using fork() or ugly select() loops) can handle | |
443 | an arbitrary number of connections. | |
3c4f71cc | 444 | |
4514447c FM |
445 | The client starts up unconnected, so you can use the Connect... option |
446 | to specify the address of the server you are going to connect to (the | |
447 | TCP port number is hard-coded as 3000). Once connected, a number of | |
448 | tests are possible. Currently, three tests are implemented. They show | |
449 | how to use the basic IO calls in wxSocketBase, | |
450 | such as wxSocketBase::Read, wxSocketBase::Write, | |
451 | wxSocketBase::ReadMsg and wxSocketBase::WriteMsg, | |
452 | and how to set up the correct IO flags depending on what you are going to | |
453 | do. See the comments in the code for more information. Note that because | |
454 | both clients and connection objects in the server set up an event handler | |
455 | to catch @b wxSOCKET_LOST events, each one is immediately notified | |
456 | if the other end closes the connection. | |
3c4f71cc | 457 | |
4514447c FM |
458 | There is also a URL test which shows how to use |
459 | the wxURL class to fetch data from a given URL. | |
3c4f71cc | 460 | |
4514447c | 461 | The sockets sample is work in progress. Some things to do: |
3c4f71cc | 462 | |
4514447c FM |
463 | @li More tests for basic socket functionality. |
464 | @li More tests for protocol classes (wxProtocol and its descendants). | |
465 | @li Tests for the recently added (and still in alpha stage) datagram sockets. | |
466 | @li New samples which actually do something useful (suggestions accepted). | |
3c4f71cc VS |
467 | |
468 | ||
4514447c | 469 | @subsection page_utils_samples_sound Sound sample |
3c4f71cc | 470 | |
4514447c FM |
471 | The @c sound sample shows how to use wxSound for simple |
472 | audio output (e.g. notifications). | |
3c4f71cc VS |
473 | |
474 | ||
4514447c | 475 | @subsection page_utils_samples_statbar Statbar sample |
3c4f71cc | 476 | |
4514447c FM |
477 | This sample shows how to create and use wxStatusBar. Although most of the |
478 | samples have a statusbar, they usually only create a default one and only | |
479 | do it once. | |
3c4f71cc | 480 | |
4514447c FM |
481 | Here you can see how to recreate the statusbar (with possibly different number |
482 | of fields) and how to use it to show icons/bitmaps and/or put arbitrary | |
483 | controls into it. | |
3c4f71cc VS |
484 | |
485 | ||
4514447c | 486 | @subsection page_utils_samples_taborder Tab order sample |
3c4f71cc VS |
487 | |
488 | This sample allows to test keyboard navigation (mostly done using the | |
4514447c | 489 | @c TAB key, hence the sample name) between different controls. |
3c4f71cc | 490 | It shows the use of wxWindow::MoveBeforeInTabOrder() and |
4514447c | 491 | MoveAfterInTabOrder() methods to change |
3c4f71cc | 492 | the default order of the windows in the navigation chain and of |
4514447c FM |
493 | wxWindow::Navigate() for moving focus along this |
494 | chain. | |
3c4f71cc VS |
495 | |
496 | ||
4514447c | 497 | @subsection page_utils_samples_text Text sample |
3c4f71cc | 498 | |
4514447c FM |
499 | This sample demonstrates four features: firstly the use and many variants of |
500 | the wxTextCtrl class (single line, multi line, read only, | |
501 | password, ignoring TAB, ignoring ENTER). | |
3c4f71cc | 502 | |
4514447c FM |
503 | Secondly it shows how to intercept a wxKeyEvent in both |
504 | the raw form using the @c EVT_KEY_UP and @c EVT_KEY_DOWN macros and the | |
505 | higher level from using the @c EVT_CHAR macro. All characters will be logged | |
506 | in a log window at the bottom of the main window. By pressing some of the function | |
507 | keys, you can test some actions in the text ctrl as well as get statistics on the | |
508 | text ctrls, which is useful for testing if these statistics actually are correct. | |
3c4f71cc | 509 | |
4514447c FM |
510 | Thirdly, on platforms which support it, the sample will offer to copy text to the |
511 | wxClipboard and to paste text from it. The GTK version will | |
512 | use the so called PRIMARY SELECTION, which is the pseudo clipboard under X and | |
513 | best known from pasting text to the XTerm program. | |
3c4f71cc | 514 | |
4514447c FM |
515 | Last not least: some of the text controls have tooltips and the sample also shows |
516 | how tooltips can be centrally disabled and their latency controlled. | |
3c4f71cc VS |
517 | |
518 | ||
4514447c | 519 | @subsection page_utils_samples_thread Thread sample |
3c4f71cc | 520 | |
4514447c FM |
521 | This sample demonstrates use of threads in connection with GUI programs. |
522 | There are two fundamentally different ways to use threads in GUI programs and | |
523 | either way has to take care of the fact that the GUI library itself usually | |
524 | is not multi-threading safe, i.e. that it might crash if two threads try to | |
525 | access the GUI class simultaneously. One way to prevent that is have a normal | |
526 | GUI program in the main thread and some worker threads which work in the | |
527 | background. In order to make communication between the main thread and the | |
528 | worker threads possible, wxWidgets offers the wxPostEvent | |
529 | function and this sample makes use of this function. | |
3c4f71cc | 530 | |
4514447c FM |
531 | The other way to use a so called Mutex (such as those offered in the wxMutex |
532 | class) that prevent threads from accessing the GUI classes as long as any other | |
533 | thread accesses them. For this, wxWidgets has the wxMutexGuiEnter | |
534 | and wxMutexGuiLeave functions, both of which are | |
535 | used and tested in the sample as well. | |
3c4f71cc | 536 | |
42efa498 | 537 | See also @ref overview_thread and wxThread. |
3c4f71cc VS |
538 | |
539 | ||
4514447c | 540 | @subsection page_utils_samples_toolbar Toolbar sample |
3c4f71cc | 541 | |
4514447c | 542 | The toolbar sample shows the wxToolBar class in action. |
3c4f71cc | 543 | |
4514447c | 544 | The following things are demonstrated: |
3c4f71cc | 545 | |
4514447c FM |
546 | @li Creating the toolbar using wxToolBar::AddTool and wxToolBar::AddControl: see |
547 | MyApp::InitToolbar in the sample. | |
548 | @li Using @c EVT_UPDATE_UI handler for automatically enabling/disabling | |
549 | toolbar buttons without having to explicitly call EnableTool. This is done | |
550 | in MyFrame::OnUpdateCopyAndCut. | |
551 | @li Using wxToolBar::DeleteTool and wxToolBar::InsertTool to dynamically update the | |
552 | toolbar. | |
3c4f71cc | 553 | |
4514447c FM |
554 | Some buttons in the main toolbar are check buttons, i.e. they stay checked when |
555 | pressed. On the platforms which support it, the sample also adds a combobox | |
556 | to the toolbar showing how you can use arbitrary controls and not only buttons | |
557 | in it. | |
3c4f71cc | 558 | |
4514447c FM |
559 | If you toggle another toolbar in the sample (using @c Ctrl-A) you will also |
560 | see the radio toolbar buttons in action: the first three buttons form a radio | |
561 | group, i.e. checking any of them automatically unchecks the previously | |
562 | checked one. | |
3c4f71cc VS |
563 | |
564 | ||
4514447c | 565 | @subsection page_utils_samples_treectrl Treectrl sample |
3c4f71cc | 566 | |
4514447c FM |
567 | This sample demonstrates using the wxTreeCtrl class. Here |
568 | you may see how to process various notification messages sent by this control | |
569 | and also when they occur (by looking at the messages in the text control in | |
570 | the bottom part of the frame). | |
3c4f71cc | 571 | |
4514447c FM |
572 | Adding, inserting and deleting items and branches from the tree as well as |
573 | sorting (in default alphabetical order as well as in custom one) is | |
574 | demonstrated here as well - try the corresponding menu entries. | |
3c4f71cc VS |
575 | |
576 | ||
4514447c | 577 | @subsection page_utils_samples_widgets Widgets sample |
3c4f71cc | 578 | |
4514447c FM |
579 | The widgets sample is the main presentation program for most simple and advanced |
580 | native controls and complex generic widgets provided by wxWidgets. | |
581 | The sample tests their basic functionality, events, placement, modification | |
582 | in terms of colour and font as well as the possibility to change | |
583 | the controls programmatically, such as adding an item to a list box etc. | |
584 | All widgets are categorized for easy browsing. | |
3c4f71cc | 585 | |
4514447c FM |
586 | |
587 | @subsection page_utils_samples_wizard Wizard sample | |
3c4f71cc | 588 | |
4514447c FM |
589 | This sample shows the so-called wizard dialog (implemented using |
590 | wxWizard and related classes). It shows almost all | |
591 | features supported: | |
3c4f71cc | 592 | |
4514447c FM |
593 | @li Using bitmaps with the wizard and changing them depending on the page |
594 | shown (notice that wxValidationPage in the sample has a different image from | |
595 | the other ones) | |
596 | @li Using TransferDataFromWindow | |
597 | to verify that the data entered is correct before passing to the next page | |
598 | (done in wxValidationPage which forces the user to check a checkbox before | |
599 | continuing). | |
600 | @li Using more elaborated techniques to allow returning to the previous | |
601 | page, but not continuing to the next one or vice versa (in wxRadioboxPage) | |
602 | @li This (wxRadioboxPage) page also shows how the page may process the | |
603 | @e Cancel button itself instead of relying on the wizard parent to do it. | |
604 | @li Normally, the order of the pages in the wizard is known at compile-time, | |
605 | but sometimes it depends on the user choices: wxCheckboxPage shows how to | |
606 | dynamically decide which page to display next (see also | |
607 | wxWizardPage) | |
608 | ||
609 | */ |