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