You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

90 lines
3.4KB

  1. //
  2. // "$Id: Fl_Menu_Bar.H 7981 2010-12-08 23:53:04Z greg.ercolano $"
  3. //
  4. // Menu bar header file for the Fast Light Tool Kit (FLTK).
  5. //
  6. // Copyright 1998-2010 by Bill Spitzak and others.
  7. //
  8. // This library is free software; you can redistribute it and/or
  9. // modify it under the terms of the GNU Library General Public
  10. // License as published by the Free Software Foundation; either
  11. // version 2 of the License, or (at your option) any later version.
  12. //
  13. // This library is distributed in the hope that it will be useful,
  14. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. // Library General Public License for more details.
  17. //
  18. // You should have received a copy of the GNU Library General Public
  19. // License along with this library; if not, write to the Free Software
  20. // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
  21. // USA.
  22. //
  23. // Please report all bugs and problems on the following page:
  24. //
  25. // http://www.fltk.org/str.php
  26. //
  27. /* \file
  28. Fl_Menu_Bar widget . */
  29. #ifndef Fl_Menu_Bar_H
  30. #define Fl_Menu_Bar_H
  31. #include "Fl_Menu_.H"
  32. /**
  33. This widget provides a standard menubar interface. Usually you will
  34. put this widget along the top edge of your window. The height of the
  35. widget should be 30 for the menu titles to draw correctly with the
  36. default font.
  37. <P>The items on the bar and the menus they bring up are defined by a
  38. single Fl_Menu_Item
  39. array. Because a Fl_Menu_Item array defines a hierarchy, the
  40. top level menu defines the items in the menubar, while the submenus
  41. define the pull-down menus. Sub-sub menus and lower pop up to the right
  42. of the submenus. </P>
  43. <P ALIGN=CENTER>\image html menubar.png</P>
  44. \image latex menubar.png " menubar" width=12cm
  45. <P>If there is an item in the top menu that is not a title of a
  46. submenu, then it acts like a "button" in the menubar. Clicking on it
  47. will pick it. </P>
  48. <P>When the user picks an item off the menu, the item's callback is
  49. done with the menubar as the Fl_Widget* argument. If the item
  50. does not have a callback the menubar's callback is done instead. </P>
  51. <P>Submenus will also pop up in response to shortcuts indicated by
  52. putting a '&' character in the name field of the menu item. If you put a
  53. '&' character in a top-level "button" then the shortcut picks it. The
  54. '&' character in submenus is ignored until the menu is popped up. </P>
  55. <P>Typing the shortcut() of any of the menu items will cause
  56. callbacks exactly the same as when you pick the item with the mouse.
  57. */
  58. class FL_EXPORT Fl_Menu_Bar : public Fl_Menu_ {
  59. protected:
  60. void draw();
  61. public:
  62. int handle(int);
  63. /**
  64. Creates a new Fl_Menu_Bar widget using the given position,
  65. size, and label string. The default boxtype is FL_UP_BOX.
  66. <P>The constructor sets menu() to NULL. See
  67. Fl_Menu_ for the methods to set or change the menu. </P>
  68. <P>labelsize(), labelfont(), and labelcolor()
  69. are used to control how the menubar items are drawn. They are
  70. initialized from the Fl_Menu static variables, but you can
  71. change them if desired. </P>
  72. <P>label() is ignored unless you change align() to
  73. put it outside the menubar.
  74. <P>The destructor removes the Fl_Menu_Bar widget and all of its
  75. menu items.
  76. */
  77. Fl_Menu_Bar(int X, int Y, int W, int H,const char *l=0)
  78. : Fl_Menu_(X,Y,W,H,l) {}
  79. };
  80. #endif
  81. //
  82. // End of "$Id: Fl_Menu_Bar.H 7981 2010-12-08 23:53:04Z greg.ercolano $".
  83. //