roughguide.h 2.6 KB

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