2008-02-18 19:04:03 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: roughguide
|
|
|
|
// Purpose: topic overview
|
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Licence: wxWindows license
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/*!
|
2008-02-19 08:28:24 -05:00
|
|
|
|
2008-02-26 04:29:48 -05:00
|
|
|
@page overview_roughguide Writing a wxWidgets Application: A Rough Guide
|
2008-02-19 08:28:24 -05:00
|
|
|
|
2008-02-26 13:37:50 -05:00
|
|
|
To set a wxWidgets application going, you will need to derive a wxApp class and
|
|
|
|
override wxApp::OnInit.
|
2008-02-26 04:29:48 -05:00
|
|
|
|
2008-02-26 13:37:50 -05:00
|
|
|
An application must have a top-level wxFrame or wxDialog window. Each frame may
|
|
|
|
contain one or more instances of classes such as wxPanel, wxSplitterWindow or
|
|
|
|
other windows and controls.
|
2008-02-26 04:29:48 -05:00
|
|
|
|
2008-02-26 13:37:50 -05:00
|
|
|
A frame can have a wxMenuBar, a wxToolBar, a wxStatusBar, and a wxIcon for when
|
|
|
|
the frame is iconized.
|
2008-02-26 04:29:48 -05:00
|
|
|
|
2008-02-26 13:37:50 -05:00
|
|
|
A wxPanel is used to place controls (classes derived from wxControl) which are
|
|
|
|
used for user interaction. Examples of controls are wxButton, wxCheckBox,
|
|
|
|
wxChoice, wxListBox, wxRadioBox, and wxSlider.
|
2008-02-26 04:29:48 -05:00
|
|
|
|
2008-02-26 13:37:50 -05:00
|
|
|
Instances of wxDialog can also be used for controls and they have the advantage
|
|
|
|
of not requiring a separate frame.
|
2008-02-26 04:29:48 -05:00
|
|
|
|
|
|
|
Instead of creating a dialog box and populating it with items, it is possible
|
2008-02-26 13:37:50 -05:00
|
|
|
to choose one of the convenient common dialog classes, such as wxMessageDialog
|
|
|
|
and wxFileDialog.
|
2008-02-26 04:29:48 -05:00
|
|
|
|
|
|
|
You never draw directly onto a window - you use a <em>device context</em> (DC).
|
2008-02-26 13:37:50 -05:00
|
|
|
wxDC is the base for wxClientDC, wxPaintDC, wxMemoryDC, wxPostScriptDC,
|
|
|
|
wxMemoryDC, wxMetafileDC and wxPrinterDC. If your drawing functions have wxDC
|
|
|
|
as a parameter, you can pass any of these DCs to the function, and thus use the
|
|
|
|
same code to draw to several different devices. You can draw using the member
|
|
|
|
functions of wxDC, such as wxDC::DrawLine and wxDC::DrawText. Control colour on
|
|
|
|
a window (wxColour) with brushes (wxBrush) and pens (wxPen).
|
2008-02-26 04:29:48 -05:00
|
|
|
|
|
|
|
To intercept events, you add a DECLARE_EVENT_TABLE macro to the window class
|
|
|
|
declaration, and put a BEGIN_EVENT_TABLE ... END_EVENT_TABLE block in the
|
|
|
|
implementation file. Between these macros, you add event macros which map the
|
|
|
|
event (such as a mouse click) to a member function. These might override
|
2008-02-26 13:37:50 -05:00
|
|
|
predefined event handlers such as for wxKeyEvent and wxMouseEvent.
|
2008-02-26 04:29:48 -05:00
|
|
|
|
|
|
|
Most modern applications will have an on-line, hypertext help system; for this,
|
2008-02-26 13:37:50 -05:00
|
|
|
you need wxHelp and the wxHelpController class to control wxHelp.
|
2008-02-26 04:29:48 -05:00
|
|
|
|
|
|
|
GUI applications aren't all graphical wizardry. List and hash table needs are
|
2008-02-26 13:37:50 -05:00
|
|
|
catered for by wxList and wxHashMap. You will undoubtedly need some
|
2008-02-26 04:29:48 -05:00
|
|
|
platform-independent @ref functions_file, and you may find it handy to
|
2008-02-26 13:37:50 -05:00
|
|
|
maintain and search a list of paths using wxPathList. There's many
|
2008-02-26 04:29:48 -05:00
|
|
|
@ref functions_miscellany of operating system methods and other functions.
|
|
|
|
|
|
|
|
@seealso
|
|
|
|
|
2008-02-26 13:37:50 -05:00
|
|
|
@li @ref page_categories
|
2008-02-26 04:29:48 -05:00
|
|
|
|
|
|
|
*/
|
2008-02-19 08:28:24 -05:00
|
|
|
|