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