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