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