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