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