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