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