]> git.saurik.com Git - wxWidgets.git/blame - docs/doxygen/overviews/roughguide.h
Don't take the previous paragraph style when deleting paragraph marker
[wxWidgets.git] / docs / doxygen / overviews / roughguide.h
CommitLineData
15b6757b
FM
1/////////////////////////////////////////////////////////////////////////////
2// Name: roughguide
3// Purpose: topic overview
4// Author: wxWidgets team
5// RCS-ID: $Id$
6// Licence: wxWindows license
7/////////////////////////////////////////////////////////////////////////////
8
9/*!
36c9828f 10
a2968d85 11@page overview_roughguide Writing a wxWidgets Application: A Rough Guide
36c9828f 12
a2968d85
BP
13To set a wxWidgets application going, you will need to derive a #wxApp class
14and override wxApp::OnInit.
15
16An application must have a top-level #wxFrame or #wxDialog window. Each frame
17may contain one or more instances of classes such as #wxPanel,
18#wxSplitterWindow or other windows and controls.
19
20A frame can have a #wxMenuBar, a #wxToolBar, a status line, and a #wxIcon for
21when the frame is iconized.
22
23A #wxPanel is used to place controls (classes derived from #wxControl) which
24are used for user interaction. Examples of controls are #wxButton, #wxCheckBox,
25#wxChoice, #wxListBox, #wxRadioBox, #wxSlider.
26
27Instances of #wxDialog can also be used for controls and they have the
28advantage of not requiring a separate frame.
29
30Instead of creating a dialog box and populating it with items, it is possible
31to choose one of the convenient common dialog classes, such as #wxMessageDialog
32and #wxFileDialog.
33
34You never draw directly onto a window - you use a <em>device context</em> (DC).
35#wxDC is the base for #wxClientDC, #wxPaintDC, #wxMemoryDC, #wxPostScriptDC,
36#wxMemoryDC, #wxMetafileDC and #wxPrinterDC. If your drawing functions have
37wxDC as a parameter, you can pass any of these DCs to the function, and thus
38use the same code to draw to several different devices. You can draw using the
39member functions of wxDC, such as wxDC::DrawLine and wxDC::DrawText. Control
40colour on a window (#wxColour) with brushes (#wxBrush) and pens (#wxPen).
41
42To intercept events, you add a DECLARE_EVENT_TABLE macro to the window class
43declaration, and put a BEGIN_EVENT_TABLE ... END_EVENT_TABLE block in the
44implementation file. Between these macros, you add event macros which map the
45event (such as a mouse click) to a member function. These might override
46predefined event handlers such as for #wxKeyEvent and #wxMouseEvent.
47
48Most modern applications will have an on-line, hypertext help system; for this,
49you need wxHelp and the #wxHelpController class to control wxHelp.
50
51GUI applications aren't all graphical wizardry. List and hash table needs are
52catered for by #wxList and #wxHashMap. You will undoubtedly need some
53platform-independent @ref functions_file, and you may find it handy to
54maintain and search a list of paths using #wxPathList. There's many
55@ref functions_miscellany of operating system methods and other functions.
56
57@seealso
58
59@li @ref overview_classesbycat
60
61*/
36c9828f 62