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