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