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.

81 lines
2.7KB

  1. //
  2. // "$Id: Fl_Sys_Menu_Bar.H 7903 2010-11-28 21:06:39Z matt $"
  3. //
  4. // MacOS system 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. #ifndef Fl_Sys_Menu_Bar_H
  28. #define Fl_Sys_Menu_Bar_H
  29. #include "Fl_Menu_Bar.H"
  30. #include "x.H"
  31. #if defined(__APPLE__) || defined(FL_DOXYGEN)
  32. /**
  33. @brief A class to create, modify and delete menus that appear on Mac OS X in the menu bar at the top of the screen.
  34. *
  35. * On other than Mac OS X platforms, Fl_Sys_Menu_Bar is a synonym of class Fl_Menu_Bar.
  36. */
  37. class FL_EXPORT Fl_Sys_Menu_Bar : public Fl_Menu_Bar {
  38. protected:
  39. void draw();
  40. public:
  41. /**
  42. @brief The constructor.
  43. *
  44. * On Mac OS X, all arguments are unused. On other platforms they are used as by Fl_Menu_Bar::Fl_Menu_Bar().
  45. */
  46. Fl_Sys_Menu_Bar(int x,int y,int w,int h,const char *l=0)
  47. : Fl_Menu_Bar(x,y,w,h,l) {
  48. deactivate(); // don't let the old area take events
  49. fl_sys_menu_bar = this;
  50. }
  51. void menu(const Fl_Menu_Item *m);
  52. int add(const char* label, int shortcut, Fl_Callback*, void *user_data=0, int flags=0);
  53. int insert(int index, const char* label, int shortcut, Fl_Callback *cb, void *user_data=0, int flags=0);
  54. void remove(int n);
  55. void replace(int rank, const char *name);
  56. void clear();
  57. int clear_submenu(int index);
  58. #if ! defined(FL_DOXYGEN)
  59. enum menuOrItemOperation { itemAtIndex, setKeyEquivalent, setKeyEquivalentModifierMask, setState, initWithTitle,
  60. numberOfItems, setSubmenu, setEnabled, addSeparatorItem, setTitle, removeItem, addNewItem, renameItem };
  61. // function doMenuOrItemOperation is in file Fl_cocoa.mm because it contains objective-c code
  62. static void *doMenuOrItemOperation( menuOrItemOperation operation, ...);
  63. #endif
  64. };
  65. #else
  66. typedef Fl_Menu_Bar Fl_Sys_Menu_Bar;
  67. #endif // defined(__APPLE__) || defined(FL_DOXYGEN)
  68. #endif // Fl_Sys_Menu_Bar_H
  69. //
  70. // End of "$Id: Fl_Sys_Menu_Bar.H 7903 2010-11-28 21:06:39Z matt $".
  71. //