]> git.saurik.com Git - wxWidgets.git/blob - docs/doxygen/mainpages/samples.h
90f8776afb68ce3f0fca4f0a9daf1f466ff0068f
[wxWidgets.git] / docs / doxygen / mainpages / samples.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: samples.h
3 // Purpose: Samples page of the Doxygen manual
4 // Author: wxWidgets team
5 // RCS-ID: $Id: utilities.h 52634 2008-03-20 13:45:17Z VS $
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
8
9 /**
10
11 @page page_samples Included Samples
12
13 Probably the best way to learn wxWidgets is by reading the source of some 80+
14 samples provided with it. Many aspects of wxWidgets programming can be learnt
15 from them, but sometimes it is not simple to just choose the right sample to
16 look at. This overview aims at describing what each sample does/demonstrates to
17 make it easier to find the relevant one if a simple grep through all sources
18 didn't help. They also provide some notes about using the samples and what
19 features of wxWidgets are they supposed to test.
20
21 There are currently more than 80 different samples as part of wxWidgets:
22 the list in this page is not complete!
23 You should start your tour of wxWidgets with the @ref page_samples_minimal
24 which is the wxWidgets version of "Hello, world!".
25 It shows the basic structure of wxWidgets program and is the most commented
26 sample of all - looking at its source code is recommended.
27
28 The next most useful samples are probably @ref page_samples_widgets and
29 @ref page_samples_controls which show many of wxWidgets native and
30 generic controls, such as buttons, listboxes, checkboxes, comboboxes etc.
31
32 Other, more complicated controls, have their own samples. In this category you
33 may find the following samples showing the corresponding controls:
34
35 @li wxCalendarCtrl: @ref page_samples_calendar
36 @li wxListCtrl: @ref page_samples_listctrl
37 @li wxTreeCtrl: @ref page_samples_treectrl
38 @li wxGrid: @ref page_samples_grid
39
40 Finally, it might be helpful to do a search in the entire sample directory if
41 you can't find the sample showing the control you are interested in by
42 name. Most classes contained in wxWidgets occur in at least one of the samples.
43
44 <!--
45 The following sample list is generated by executing command
46
47 ls | egrep '[a-z]+' | egrep '^[a-z]+$' | sed 's/^/@li @sample\{/' | sed 's/$/\}/'
48
49 in wxWidgets/samples
50
51 TODO: Organize them in a more human-readable way.
52 -->
53
54 @beginInvisibleTable
55 <tr><td>
56 @li @sample{access}
57 @li @sample{animate}
58 @li @sample{artprov}
59 @li @sample{aui}
60 @li @sample{calendar}
61 @li @sample{caret}
62 @li @sample{collpane}
63 @li @sample{combo}
64 @li @sample{config}
65 @li @sample{console}
66 @li @sample{controls}
67 @li @sample{dataview}
68 @li @sample{debugrpt}
69 @li @sample{dialogs}
70 @li @sample{dialup}
71 @li @sample{display}
72 @li @sample{dnd}
73 @li @sample{docview}
74 @li @sample{dragimag}
75 @li @sample{drawing}
76 @li @sample{editlbox}
77 @li @sample{erase}
78 @li @sample{event}
79 @li @sample{except}
80 @li @sample{exec}
81 @li @sample{font}
82 </td><td>
83 @li @sample{grid}
84 @li @sample{help}
85 @li @sample{htlbox}
86 @li @sample{html}
87 @li @sample{image}
88 @li @sample{internat}
89 @li @sample{ipc}
90 @li @sample{joytest}
91 @li @sample{keyboard}
92 @li @sample{layout}
93 @li @sample{listctrl}
94 @li @sample{mdi}
95 @li @sample{mediaplayer}
96 @li @sample{memcheck}
97 @li @sample{menu}
98 @li @sample{mfc}
99 @li @sample{minimal}
100 @li @sample{mobile}
101 @li @sample{nativdlg}
102 @li @sample{notebook}
103 @li @sample{oleauto}
104 @li @sample{opengl}
105 @li @sample{ownerdrw}
106 @li @sample{popup}
107 @li @sample{power}
108 @li @sample{printing}
109 @li @sample{propgrid}
110 </td><td>
111 @li @sample{regtest}
112 @li @sample{render}
113 @li @sample{richtext}
114 @li @sample{sashtest}
115 @li @sample{scroll}
116 @li @sample{shaped}
117 @li @sample{sockets}
118 @li @sample{sound}
119 @li @sample{splash}
120 @li @sample{splitter}
121 @li @sample{statbar}
122 @li @sample{stc}
123 @li @sample{svg}
124 @li @sample{taborder}
125 @li @sample{taskbar}
126 @li @sample{text}
127 @li @sample{thread}
128 @li @sample{toolbar}
129 @li @sample{treectrl}
130 @li @sample{typetest}
131 @li @sample{validate}
132 @li @sample{vscroll}
133 @li @sample{widgets}
134 @li @sample{wizard}
135 @li @sample{wrapsizer}
136 @li @sample{xrc}
137 </td></tr>
138 @endTable
139
140 @todo Write descriptions for the samples who description started with
141 "This sample demonstrates", they are semi-auto generated.
142 <hr>
143
144 @section page_samples_access Accessibility Sample
145
146 This sample shows how you can use the wxAccessible classes in a
147 simple GUI program.
148
149 @buildwith{wxUSE_ACCESSIBILITY}
150
151 @sampledir{access}
152
153 @section page_samples_animate Animation Sample
154
155 This sample shows how you can use wxAnimationCtrl
156 control and shows concept of a platform-dependent animation encapsulated
157 in wxAnimation.
158
159 @sampledir{animate}
160
161 @section page_samples_artprov Art Provider Sample
162
163 This sample shows how you can customize the look of standard
164 wxWidgets dialogs by replacing default bitmaps/icons with your own versions.
165 It also shows how you can use wxArtProvider to
166 get stock bitmaps for use in your application.
167
168 @sampledir{artprov}
169
170 @section page_samples_aui Advanced User Interface Sample
171
172 @sampleabout{@ref overview_aui "AUI classes"}
173
174 @sampledir{aui}
175
176 @section page_samples_calendar Calendar Sample
177
178 This sample shows the calendar control in action. It
179 shows how to configure the control (see the different options in the calendar
180 menu) and also how to process the notifications from it.
181
182 @sampledir{calendar}
183
184 @section page_samples_caret Caret Sample
185
186 @sampleabout{wxCaret}
187
188 @sampledir{caret}
189
190 @section page_samples_collpane Collapsible Pane Sample
191
192 @sampleabout{wxCollapsiblePane}
193
194 @sampledir{collpane}
195
196 @section page_samples_combo Combo Sample
197
198 @sampleabout{wxComboBox\, wxComboCtrl and wxOwnerDrawnComboBox etc}
199
200 @sampledir{combo}
201
202 @section page_samples_config Configuration Sample
203
204 This sample demonstrates the wxConfig classes in a platform
205 independent way, i.e. it uses text based files to store a given configuration under
206 Unix and uses the Registry under Windows.
207
208 See @ref overview_config for the descriptions of all features of this class.
209
210 @sampledir{config}
211
212 @section page_samples_console Console Program Sample
213
214 @sampleabout{a console program}
215
216 @sampledir{console}
217
218 @section page_samples_controls Controls Sample
219
220 The controls sample is the main test program for most simple controls used in
221 wxWidgets. The sample tests their basic functionality, events, placement,
222 modification in terms of colour and font as well as the possibility to change
223 the controls programmatically, such as adding an item to a list box etc. Apart
224 from that, the sample uses a wxNotebook and tests most
225 features of this special control (using bitmap in the tabs, using
226 wxSizer instances and wxLayoutConstraints within notebook pages, advancing pages
227 programmatically and vetoing a page change by intercepting the wxNotebookEvent.
228
229 The various controls tested are listed here:
230
231 @li wxButton
232 @li wxBitmapButton
233 @li wxCheckBox
234 @li wxChoice
235 @li wxComboBox
236 @li wxGauge
237 @li wxStaticBox
238 @li wxListBox
239 @li wxSpinCtrl
240 @li wxSpinButton
241 @li wxStaticText
242 @li wxStaticBitmap
243 @li wxRadioBox
244 @li wxRadioButton
245 @li wxSlider
246
247 @sampledir{controls}
248
249 @section page_samples_dataview wxDataViewCtrl Sample
250
251 @sampleabout{wxDataViewCtrl}
252
253 @sampledir{dataview}
254
255 @section page_samples_debugrpt Debug Reporter Sample
256
257 This sample shows how to use wxDebugReport class to
258 generate a debug report in case of a program crash or otherwise. On start up,
259 it proposes to either crash itself (by dereferencing a NULL pointer) or
260 generate debug report without doing it. Next it initializes the debug report
261 with standard information adding a custom file to it (just a timestamp) and
262 allows to view the information gathered using
263 wxDebugReportPreview.
264
265 For the report processing part of the sample to work you should make available
266 a Web server accepting form uploads, otherwise
267 wxDebugReportUpload will report an error.
268
269 @buildwith{wxUSE_DEBUGREPORT, wxUSE_ON_FATAL_EXCEPTION}
270
271 @sampledir{debugrpt}
272
273 @section page_samples_dialogs Dialogs Sample
274
275 This sample shows how to use the common dialogs available from wxWidgets. These
276 dialogs are described in detail in the @ref overview_cmndlg.
277
278 @sampledir{dialogs}
279
280 @section page_samples_dialup Dialup Sample
281
282 This sample shows the wxDialUpManager
283 class. In the status bar, it displays the information gathered through its
284 interface: in particular, the current connection status (online or offline) and
285 whether the connection is permanent (in which case a string `LAN' appears in
286 the third status bar field - but note that you may be on a LAN not
287 connected to the Internet, in which case you will not see this) or not.
288
289 Using the menu entries, you may also dial or hang up the line if you have a
290 modem attached and (this only makes sense for Windows) list the available
291 connections.
292
293 @sampledir{dialup}
294
295 @section page_samples_display Display Sample
296
297 @sampleabout{wxDisplay}
298
299 @sampledir{display}
300
301 @section page_samples_dnd Drag & Drop Sample
302
303 This sample shows both clipboard and drag and drop in action. It is quite non
304 trivial and may be safely used as a basis for implementing the clipboard and
305 drag and drop operations in a real-life program.
306
307 When you run the sample, its screen is split in several parts. On the top,
308 there are two listboxes which show the standard derivations of
309 wxDropTarget:
310 wxTextDropTarget and
311 wxFileDropTarget.
312
313 The middle of the sample window is taken by the log window which shows what is
314 going on (of course, this only works in debug builds) and may be helpful to see
315 the sequence of steps of data transfer.
316
317 Finally, the last part is used for dragging text from it to either one of the
318 listboxes (only one will accept it) or another application. The last
319 functionality available from the main frame is to paste a bitmap from the
320 clipboard (or, in the case of the Windows version, also a metafile) - it will be
321 shown in a new frame.
322
323 So far, everything we mentioned was implemented with minimal amount of code
324 using standard wxWidgets classes. The more advanced features are demonstrated
325 if you create a shape frame from the main frame menu. A shape is a geometric
326 object which has a position, size and color. It models some
327 application-specific data in this sample. A shape object supports its own
328 private wxDataFormat which means that you may cut and
329 paste it or drag and drop (between one and the same or different shapes) from
330 one sample instance to another (or the same). However, chances are that no
331 other program supports this format and so shapes can also be rendered as
332 bitmaps which allows them to be pasted/dropped in many other applications
333 (and, under Windows, also as metafiles which are supported by most of Windows
334 programs as well - try Write/Wordpad, for example).
335
336 Take a look at DnDShapeDataObject class to see how you may use
337 wxDataObject to achieve this.
338
339 @sampledir{dnd}
340
341 @section page_samples_docview Document/View Sample
342
343 @sampleabout{@ref overview_docview}
344
345 @sampledir{docview}
346
347 @see @sample{mdi}
348
349 @section page_samples_dragimag Drag Image Sample
350
351 @sampleabout{wxDragImage}
352
353 @sampledir{dragimag}
354
355 @section page_samples_drawing Drawing Sample
356
357 @sampleabout{the drawing ability of wxDC}
358
359 @sampledir{drawing}
360
361 @section page_samples_editlbox Editable List Box Sample
362
363 @sampleabout{wxEditableListBox}
364
365 @sampledir{editlbox}
366
367 @section page_samples_erase Erase Event Sample
368
369 @sampleabout{wxEraseEvent}
370
371 @sampledir{erase}
372
373 @section page_samples_event Event Sample
374
375 This sample demonstrates various features of the wxWidgets events. It
376 shows how to dynamic events and connecting/disconnecting the event handlers
377 during run time by using wxEvtHandler::Connect() and wxEvtHandler::Disconnect(),
378 and also how to use wxWindow::PushEventHandler() and wxWindow::PopEventHandler().
379
380 @sampledir{event}
381
382 @section page_samples_except Exception Sample
383
384 This very simple sample shows how to use C++ exceptions in wxWidgets programs,
385 i.e. where to catch the exception which may be thrown by the program code. It
386 doesn't do anything very exciting by itself, you need to study its code to
387 understand what goes on.
388
389 <b>Build Note:</b>
390 You need to build the library with @c wxUSE_EXCEPTIONS being set to @c 1
391 and compile your code with C++ exceptions support to be able to build this
392 sample.
393
394 @sampledir{except}
395
396 @section page_samples_exec External Program Execution Sample
397
398 The exec sample demonstrates the wxExecute and
399 wxShell functions. Both of them are used to execute the
400 external programs and the sample shows how to do this synchronously (waiting
401 until the program terminates) or asynchronously (notification will come later).
402
403 It also shows how to capture the output of the child process in both
404 synchronous and asynchronous cases and how to kill the processes with
405 wxProcess::Kill() and test for their existence with
406 wxProcess::Exists().
407
408 @sampledir{exec}
409
410 @section page_samples_font Font Sample
411
412 The font sample demonstrates wxFont,
413 wxFontEnumerator and
414 wxFontMapper classes. It allows you to see the fonts
415 available (to wxWidgets) on the computer and shows all characters of the
416 chosen font as well.
417
418 @sampledir{font}
419
420 @section page_samples_grid Grid Sample
421
422 @sampleabout{wxGrid}
423
424 @sampledir{grid}
425
426 @section page_samples_help Help Sample
427
428 @sampleabout{wxHelpController}
429
430 @sampledir{help}
431
432 @section page_samples_html HTML Sample
433
434 Eight HTML samples cover all features of the HTML sub-library.
435
436 @li @b Test demonstrates how to create wxHtmlWindow
437 and also shows most supported HTML tags.
438
439 @li @b Widget shows how you can embed ordinary controls or windows within an
440 HTML page. It also nicely explains how to write new tag handlers and extend
441 the library to work with unsupported tags.
442
443 @li @b About may give you an idea how to write good-looking About boxes.
444
445 @li @b Zip demonstrates use of virtual file systems in wxHTML. The zip archives
446 handler (ships with wxWidgets) allows you to access HTML pages stored
447 in a compressed archive as if they were ordinary files.
448
449 @li @b Virtual is yet another virtual file systems demo. This one generates pages at run-time.
450 You may find it useful if you need to display some reports in your application.
451
452 @li @b Printing explains use of wxHtmlEasyPrinting
453 class which serves as as-simple-as-possible interface for printing HTML
454 documents without much work. In fact, only few function calls are sufficient.
455
456 @li @b Help and @b Helpview are variations on displaying HTML help
457 (compatible with MS HTML Help Workshop). @e Help shows how to embed
458 wxHtmlHelpController in your application
459 while @e Helpview is a simple tool that only pops up the help window and
460 displays help books given at command line.
461
462 @sampledir{html}
463
464 @section page_samples_htlbox HTML List Box Sample
465
466 @sampleabout{wxHtmlListBox}
467
468 @sampledir{htlbox}
469
470 @section page_samples_image Image Sample
471
472 The image sample demonstrates use of the wxImage class
473 and shows how to download images in a variety of formats, currently PNG, GIF,
474 TIFF, JPEG, BMP, PNM and PCX. The top of the sample shows two rectangles, one
475 of which is drawn directly in the window, the other one is drawn into a
476 wxBitmap, converted to a wxImage, saved as a PNG image
477 and then reloaded from the PNG file again so that conversions between wxImage
478 and wxBitmap as well as loading and saving PNG files are tested.
479
480 At the bottom of the main frame there is a test for using a monochrome bitmap by
481 drawing into a wxMemoryDC. The bitmap is then drawn
482 specifying the foreground and background colours with
483 wxDC::SetTextForeground() and
484 wxDC::SetTextBackground() (on the left). The
485 bitmap is then converted to a wxImage and the foreground colour (black) is
486 replaced with red using wxImage::Replace().
487
488 This sample also contains the code for testing the image rotation and resizing
489 and using raw bitmap access, see the corresponding menu commands.
490
491 @sampledir{image}
492
493 @section page_samples_internat Internationalization Sample
494
495 The not very clearly named internat sample demonstrates the wxWidgets
496 internationalization (i18n for short from now on) features. To be more
497 precise, it only shows localization support, i.e. support for translating the
498 program messages into another language while true i18n would also involve
499 changing the other aspects of the programs behaviour.
500
501 More information about this sample can be found in the @c readme.txt file in
502 its directory. Please also see the @ref overview_i18n.
503
504 @sampledir{internat}
505
506 @section page_samples_ipc Connection Sample
507
508 @sampleabout{wxConnection}
509
510 @sampledir{ipc}
511
512 @section page_samples_joytest Joystick Sample
513
514 @sampleabout{wxJoystick}
515
516 @sampledir{joytest}
517
518 @section page_samples_keyboard Key Event Sample
519
520 @sampleabout{wxKeyEvent}
521
522 @sampledir{keyboard}
523
524 @section page_samples_layout Layout Sample
525
526 The layout sample demonstrates the two different layout systems offered
527 by wxWidgets. When starting the program, you will see a frame with some
528 controls and some graphics. The controls will change their size whenever
529 you resize the entire frame and the exact behaviour of the size changes
530 is determined using the wxLayoutConstraints
531 class. See also the overview and the
532 wxIndividualLayoutConstraint
533 class for further information.
534
535 The menu in this sample offers two more tests, one showing how to use
536 a wxBoxSizer in a simple dialog and the other one
537 showing how to use sizers in connection with a wxNotebook
538 class. See also wxSizer.
539
540 @sampledir{layout}
541
542 @section page_samples_listctrl List Control Sample
543
544 This sample shows the wxListCtrl control. Different modes
545 supported by the control (list, icons, small icons, report) may be chosen from
546 the menu.
547
548 The sample also provides some timings for adding/deleting/sorting a lot of
549 (several thousands) items into the control.
550
551 @sampledir{listctrl}
552
553 @section page_samples_mdi MDI Sample
554
555 @sampleabout{MDI}
556
557 @see @sample{docview}
558
559 @sampledir{mdi}
560
561 @section page_samples_mediaplayer Mediaplayer Sample
562
563 This sample demonstrates how to use all the features of
564 wxMediaCtrl and play various types of sound, video,
565 and other files.
566
567 It replaces the old @c dynamic sample.
568
569 @sampledir{mediaplayer}
570
571 @section page_samples_memcheck Memory Checking Sample
572
573 @sampleabout{memory tracing using wxDebugContext}
574
575 @sampledir{memcheck}
576
577 @buildwith{wxUSE_MEMORY_TRACING, wxUSE_DEBUG_CONTEXT}
578
579 @section page_samples_menu Menu Sample
580
581 @sampleabout{wxMenu classes}
582
583 @sampledir{menu}
584
585 @section page_samples_mfc MFC Sample
586
587 @sampleabout{how to mix MFC and wxWidgets code}
588 It pops up an initial wxWidgets frame, with a menu item
589 that allows a new MFC window to be created.
590
591 For build instructions please read IMPORTANT NOTES in @c mfctest.cpp.
592
593 @onlyfor{wxmsw}
594
595 @sampledir{mfc}
596
597 @section page_samples_minimal Minimal Sample
598
599 The minimal sample is what most people will know under the term Hello World,
600 i.e. a minimal program that doesn't demonstrate anything apart from what is
601 needed to write a program that will display a "hello" dialog. This is usually
602 a good starting point for learning how to use wxWidgets.
603
604 @sampledir{minimal}
605
606 @section page_samples_mobile Mobile Sample
607
608 @todo Figure out what this sample is written for, maybe remove it from samples,
609 since it seems to an incomplete test program (for mobile phone?)
610
611 @sampledir{mobile}
612
613 @section page_samples_nativdlg Native Windows Dialog Sample
614
615 @sampleabout{native windows dialog}
616
617 @onlyfor{wxmsw}
618
619 @sampledir{nativdlg}
620
621 @section page_samples_notebook Notebook Sample
622
623 This samples shows wxBookCtrl family of controls.
624 Although initially it was written to demonstrate wxNotebook
625 only, it can now be also used to see wxListbook,
626 wxChoicebook and wxTreebook in action.
627 Test each of the controls, their orientation, images and pages using
628 commands through menu.
629
630 @sampledir{notebook}
631
632 @section page_samples_oleauto OLE Automation Sample
633
634 @sampleabout{OLE automation using wxAutomationObject}
635
636 @onlyfor{wxmsw}
637
638 @sampledir{oleauto}
639
640 @section page_samples_opengl OpenGL Sample
641
642 @sampleabout{wxGLCanvas}
643
644 @li @b cube Draws only a cube to demonstrate how to write a basic wxWidgets OpenGL program.
645 @li @b isosurf Draws a surface by reading coordinates from a dat file.
646 @li @b penguin Draws a rotatable penguin by reading data from a dxf file.
647
648 @sampledir{opengl}
649
650 @section page_samples_ownerdrw Owner-drawn Sample
651
652 @sampleabout{owner-drawn wxMenuItem\, wxCheckList and wxListBox}
653
654 <!--It's weird that it doesn't need <wx/ownerdrw.h> and class wxOwnerDrawn!-->
655
656 @sampledir{ownerdrw}
657
658 @section page_samples_popup Popup Transient Window Sample
659
660 @sampleabout{wxPopupTransientWindow}
661
662 @sampledir{popup}
663
664 @section page_samples_power Power Management Sample
665
666 @sampleabout{wxWidgets power management}
667
668 @see wxPowerEvent
669
670 @sampledir{power}
671
672 @section page_samples_printing Printing Sample
673
674 @sampleabout{printing}
675
676 @see @ref overview_printing, @ref overview_unixprinting
677
678 @buildwith{wxUSE_PRINTING_ARCHITECTURE}
679
680 @sampledir{printing}
681
682 @section page_samples_propgrid wxPropertyGrid Sample
683
684 Sample application has following additional examples of custom properties:
685 - wxFontDataProperty ( edits wxFontData )
686 - wxPointProperty ( edits wxPoint )
687 - wxSizeProperty ( edits wxSize )
688 - wxAdvImageFileProperty ( like wxImageFileProperty, but also has a drop-down
689 for recent image selection )
690 - wxDirsProperty ( edits a wxArrayString consisting of directory strings)
691 - wxArrayDoubleProperty ( edits wxArrayDouble )
692
693 @sampleabout{wxPropertyGrid}
694
695 @sampledir{propgrid}
696
697 @section page_samples_regtest Registry Sample
698
699 @sampleabout{wxRegKey}
700
701 <!--Its directory name doesn't seem to be proper.-->
702
703 @onlyfor{wxmsw}
704
705 @sampledir{regtest}
706
707 @section page_samples_render Render Sample
708
709 This sample shows how to replace the default wxWidgets
710 renderer and also how to write a shared library
711 (DLL) implementing a renderer and load and unload it during the run-time.
712
713 @sampledir{render}
714
715 @section page_samples_richtext wxRichTextCtrl Sample
716
717 @sampleabout{wxRichTextCtrl}
718
719 @sampledir{richtext}
720
721 @section page_samples_sashtest Sash Sample
722
723 @sampleabout{wxSashWindow classes}
724
725 @sampledir{sashtest}
726
727 @section page_samples_scroll Scroll Window Sample
728
729 @sampleabout{wxScrolledWindow}
730
731 This sample demonstrates use of the ::wxScrolledWindow
732 class including placing subwindows into it and drawing simple graphics. It uses
733 the SetTargetWindow method and thus the effect of scrolling does not show in
734 the scrolled window itself, but in one of its subwindows.
735
736 Additionally, this samples demonstrates how to optimize drawing operations in
737 wxWidgets, in particular using the wxWindow::IsExposed() method with the aim to
738 prevent unnecessary drawing in the window and thus reducing or removing flicker
739 on screen.
740
741 @sampledir{scroll}
742
743 @section page_samples_shaped Shaped Window Sample
744
745 @sampleabout{how to implement a shaped or transparent window\, and a window showing/hiding with effect}
746
747 @see wxTopLevelWindow::SetShape(), wxTopLevelWindow::SetTransparent(),
748 wxWindow::ShowWithEffect(), wxWindow::HideWithEffect()
749
750 @sampledir{shaped}
751
752 @section page_samples_sockets Sockets Sample
753
754 The sockets sample demonstrates how to use the communication facilities
755 provided by wxSocket. There are two different
756 applications in this sample: a server, which is implemented using a
757 wxSocketServer object, and a client, which
758 is implemented as a wxSocketClient.
759
760 The server binds to the local address, using TCP port number 3000,
761 sets up an event handler to be notified of incoming connection requests
762 (@b wxSOCKET_CONNECTION events), and sits there, waiting for clients
763 (@e listening, in socket parlance). For each accepted connection,
764 a new wxSocketBase object is created. These
765 socket objects are independent from the server that created them, so
766 they set up their own event handler, and then request to be notified
767 of @b wxSOCKET_INPUT (incoming data) or @b wxSOCKET_LOST
768 (connection closed at the remote end) events. In the sample, the event
769 handler is the same for all connections; to find out which socket the
770 event is addressed to, the GetSocket function
771 is used.
772
773 Although it might take some time to get used to the event-oriented
774 system upon which wxSocket is built, the benefits are many. See, for
775 example, that the server application, while being single-threaded
776 (and of course without using fork() or ugly select() loops) can handle
777 an arbitrary number of connections.
778
779 The client starts up unconnected, so you can use the Connect... option
780 to specify the address of the server you are going to connect to (the
781 TCP port number is hard-coded as 3000). Once connected, a number of
782 tests are possible. Currently, three tests are implemented. They show
783 how to use the basic IO calls in wxSocketBase,
784 such as wxSocketBase::Read(), wxSocketBase::Write(),
785 wxSocketBase::ReadMsg() and wxSocketBase::WriteMsg(),
786 and how to set up the correct IO flags depending on what you are going to
787 do. See the comments in the code for more information. Note that because
788 both clients and connection objects in the server set up an event handler
789 to catch @b wxSOCKET_LOST events, each one is immediately notified
790 if the other end closes the connection.
791
792 There is also a URL test which shows how to use
793 the wxURL class to fetch data from a given URL.
794
795 The sockets sample is work in progress. Some things to do:
796
797 @li More tests for basic socket functionality.
798 @li More tests for protocol classes (wxProtocol and its descendants).
799 @li Tests for the recently added (and still in alpha stage) datagram sockets.
800 @li New samples which actually do something useful (suggestions accepted).
801
802 @sampledir{sockets}
803
804 @section page_samples_sound Sound Sample
805
806 The @c sound sample shows how to use wxSound for simple
807 audio output (e.g. notifications).
808
809 @sampledir{sound}
810
811 @section page_samples_splash Splash Screen Sample
812
813 @sampleabout{wxSplashScreen}
814
815 @sampledir{splash}
816
817 @section page_samples_splitter Splitter Window Sample
818
819 @sampleabout{wxSplitterWindow}
820
821 @sampledir{splitter}
822
823 @section page_samples_statbar Status Bar Sample
824
825 This sample shows how to create and use wxStatusBar. Although most of the
826 samples have a statusbar, they usually only create a default one and only
827 do it once.
828
829 Here you can see how to recreate the statusbar (with possibly different number
830 of fields) and how to use it to show icons/bitmaps and/or put arbitrary
831 controls into it.
832
833 @sampledir{statbar}
834
835 @section page_samples_stc wxStyledTextCtrl Sample
836
837 @sampleabout{wxStyledTextCtrl}
838
839 @sampledir{stc}
840
841 @section page_samples_svg SVG Sample
842
843 @sampleabout{wxSVGFileDC}
844
845 @sampledir{svg}
846
847 @section page_samples_taborder Tab Order Sample
848
849 This sample allows to test keyboard navigation (mostly done using the
850 @c TAB key, hence the sample name) between different controls.
851 It shows the use of wxWindow::MoveBeforeInTabOrder() and
852 MoveAfterInTabOrder() methods to change
853 the default order of the windows in the navigation chain and of
854 wxWindow::Navigate() for moving focus along this
855 chain.
856
857 @sampledir{taborder}
858
859 @section page_samples_taskbar Task Bar Icon Sample
860
861 @sampleabout{wxTaskBarIcon}
862
863 @sampledir{taskbar}
864
865 @section page_samples_text Text Sample
866
867 This sample demonstrates four features: firstly the use and many variants of
868 the wxTextCtrl class (single line, multi line, read only,
869 password, ignoring TAB, ignoring ENTER).
870
871 Secondly it shows how to intercept a wxKeyEvent in both
872 the raw form using the @c EVT_KEY_UP and @c EVT_KEY_DOWN macros and the
873 higher level from using the @c EVT_CHAR macro. All characters will be logged
874 in a log window at the bottom of the main window. By pressing some of the function
875 keys, you can test some actions in the text ctrl as well as get statistics on the
876 text ctrls, which is useful for testing if these statistics actually are correct.
877
878 Thirdly, on platforms which support it, the sample will offer to copy text to the
879 wxClipboard and to paste text from it. The GTK version will
880 use the so called PRIMARY SELECTION, which is the pseudo clipboard under X and
881 best known from pasting text to the XTerm program.
882
883 Last not least: some of the text controls have tooltips and the sample also shows
884 how tooltips can be centrally disabled and their latency controlled.
885
886 @sampledir{text}
887
888 @section page_samples_thread Thread Sample
889
890 This sample demonstrates use of threads in connection with GUI programs.
891
892 There are two fundamentally different ways to use threads in GUI programs and
893 either way has to take care of the fact that the GUI library itself usually
894 is not multi-threading safe, i.e. that it might crash if two threads try to
895 access the GUI class simultaneously.
896
897 One way to prevent that is have a normal GUI program in the main thread and some
898 worker threads which work in the background. In order to make communication between
899 the main thread and the worker threads possible, wxWidgets offers the ::wxQueueEvent
900 function and this sample demonstrates its usage.
901
902 The other way is to use a ::wxMutexGuiEnter and ::wxMutexGuiLeave functions, but
903 this is not currently shown in the sample.
904
905 See also @ref overview_thread and wxThread.
906
907 @sampledir{thread}
908
909 @section page_samples_toolbar Tool Bar Sample
910
911 The toolbar sample shows the wxToolBar class in action.
912
913 The following things are demonstrated:
914
915 @li Creating the toolbar using wxToolBar::AddTool() and wxToolBar::AddControl(): see
916 MyApp::InitToolbar() in the sample.
917 @li Using @c EVT_UPDATE_UI handler for automatically enabling/disabling
918 toolbar buttons without having to explicitly call EnableTool. This is done
919 in MyFrame::OnUpdateCopyAndCut().
920 @li Using wxToolBar::DeleteTool() and wxToolBar::InsertTool() to dynamically update the
921 toolbar.
922
923 Some buttons in the main toolbar are check buttons, i.e. they stay checked when
924 pressed. On the platforms which support it, the sample also adds a combobox
925 to the toolbar showing how you can use arbitrary controls and not only buttons
926 in it.
927
928 If you toggle another toolbar in the sample (using @c Ctrl-A) you will also
929 see the radio toolbar buttons in action: the first three buttons form a radio
930 group, i.e. checking any of them automatically unchecks the previously
931 checked one.
932
933 @sampledir{toolbar}
934
935 @section page_samples_treectrl wxTreeCtrl Sample
936
937 This sample demonstrates using the wxTreeCtrl class. Here
938 you may see how to process various notification messages sent by this control
939 and also when they occur (by looking at the messages in the text control in
940 the bottom part of the frame).
941
942 Adding, inserting and deleting items and branches from the tree as well as
943 sorting (in default alphabetical order as well as in custom one) is
944 demonstrated here as well - try the corresponding menu entries.
945
946 @sampledir{treectrl}
947
948 @section page_samples_typetest Types Sample
949
950 @sampleabout{wxWidgets types}
951
952 @todo Rewrite its description ASAP.
953
954 @sampledir{typetest}
955
956 @section page_samples_validate Validator Sample
957
958 @sampleabout{wxValidator}
959
960 @sampledir{validate}
961
962 @section page_samples_vscroll VScrolled Window Sample
963
964 @sampleabout{wxVScrolledWindow}
965
966 @sampledir{vscroll}
967
968 @section page_samples_widgets Widgets Sample
969
970 The widgets sample is the main presentation program for most simple and advanced
971 native controls and complex generic widgets provided by wxWidgets.
972 The sample tests their basic functionality, events, placement, modification
973 in terms of colour and font as well as the possibility to change
974 the controls programmatically, such as adding an item to a list box etc.
975 All widgets are categorized for easy browsing.
976
977 @sampledir{widgets}
978
979 @section page_samples_wizard Wizard Sample
980
981 This sample shows the so-called wizard dialog (implemented using
982 wxWizard and related classes). It shows almost all
983 features supported:
984
985 @li Using bitmaps with the wizard and changing them depending on the page
986 shown (notice that wxValidationPage in the sample has a different image from
987 the other ones)
988 @li Using TransferDataFromWindow
989 to verify that the data entered is correct before passing to the next page
990 (done in wxValidationPage which forces the user to check a checkbox before
991 continuing).
992 @li Using more elaborated techniques to allow returning to the previous
993 page, but not continuing to the next one or vice versa (in wxRadioboxPage)
994 @li This (wxRadioboxPage) page also shows how the page may process the
995 @e Cancel button itself instead of relying on the wizard parent to do it.
996 @li Normally, the order of the pages in the wizard is known at compile-time,
997 but sometimes it depends on the user choices: wxCheckboxPage shows how to
998 dynamically decide which page to display next (see also
999 wxWizardPage)
1000
1001 @sampledir{wizard}
1002
1003 @section page_samples_wrapsizer wxWrapSizer Sample
1004
1005 @sampleabout{wxWrapSizer}
1006
1007 @sampledir{wrapsizer}
1008
1009 @section page_samples_xrc XRC Sample
1010
1011 @sampleabout{@ref overview_xrc}
1012
1013 @sampledir{xrc}
1014
1015 */
1016