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