toolbar.h 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: toolbar.h
  3. // Purpose: topic overview
  4. // Author: wxWidgets team
  5. // Licence: wxWindows licence
  6. /////////////////////////////////////////////////////////////////////////////
  7. /**
  8. @page overview_toolbar Toolbar Overview
  9. @tableofcontents
  10. The toolbar family of classes allows an application to use toolbars in a
  11. variety of configurations and styles.
  12. The toolbar is a popular user interface component and contains a set of bitmap
  13. buttons or toggles. A toolbar gives faster access to an application's
  14. facilities than menus, which have to be popped up and selected rather
  15. laboriously.
  16. Instead of supplying one toolbar class with a number of different
  17. implementations depending on platform, wxWidgets separates out the classes.
  18. This is because there are a number of different toolbar styles that you may
  19. wish to use simultaneously, and also, future toolbar implementations will
  20. emerge which cannot all be shoe-horned into the one class.
  21. For each platform, the symbol wxToolBar is defined to be one of the specific
  22. toolbar classes.
  23. The following is a summary of the toolbar classes and their differences:
  24. @li wxToolBarBase: This is a base class with pure virtual functions, and should
  25. not be used directly.
  26. @li wxToolBarSimple: A simple toolbar class written entirely with generic
  27. wxWidgets functionality. A simple 3D effect for buttons is possible, but it
  28. is not consistent with the Windows look and feel. This toolbar can scroll,
  29. and you can have arbitrary numbers of rows and columns.
  30. @li wxToolBarMSW: This class implements an old-style Windows toolbar, only on
  31. Windows. There are small, three-dimensional buttons, which do not
  32. (currently) reflect the current Windows colour settings: the buttons are
  33. grey. This is the default wxToolBar on 16-bit windows.
  34. @li wxToolBar95: Uses the native Windows 95 toolbar class. It dynamically
  35. adjusts it's background and button colours according to user colour
  36. settings. CreateTools must be called after the tools have been added. No
  37. absolute positioning is supported but you can specify the number of rows,
  38. and add tool separators with @c AddSeparator. Tooltips are supported.
  39. @c OnRightClick is not supported. This is the default wxToolBar on Windows
  40. 95, Windows NT 4 and above. With the style wxTB_FLAT, the flat toolbar look
  41. is used, with a border that is highlighted when the cursor moves over the
  42. buttons.
  43. A toolbar might appear as a single row of images under the menubar, or it might
  44. be in a separate frame layout in several rows and columns. The class handles
  45. the layout of the images, unless explicit positioning is requested.
  46. A tool is a bitmap which can either be a button (there is no 'state', it just
  47. generates an event when clicked) or it can be a toggle. If a toggle, a second
  48. bitmap can be provided to depict the 'on' state; if the second bitmap is
  49. omitted, either the inverse of the first bitmap will be used (for monochrome
  50. displays) or a thick border is drawn around the bitmap (for colour displays
  51. where inverting will not have the desired result).
  52. The Windows-specific toolbar classes expect 16-colour bitmaps that are 16
  53. pixels wide and 15 pixels high. If you want to use a different size, call
  54. @c SetToolBitmapSize as the demo shows, before adding tools to the button bar.
  55. Don't supply more than one bitmap for each tool, because the toolbar generates
  56. all three images (normal, depressed, and checked) from the single bitmap you
  57. give it.
  58. @section overview_toolbar_library Using the Toolbar Library
  59. Include @c "wx/toolbar.h", or if using a class directly, one of:
  60. - @c "wx/msw/tbarmsw.h" for wxToolBarMSW
  61. - @c "wx/msw/tbar95.h" for wxToolBar95
  62. - @c "wx/tbarsmpl.h" for wxToolBarSimple
  63. An example of using a toolbar is given in the "toolbar" sample.
  64. */