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