Fl_Sys_Menu_Bar.H 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. //
  2. // "$Id: Fl_Sys_Menu_Bar.H 9637 2012-07-24 04:37:22Z 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. Distribution and use rights are outlined in
  9. // the file "COPYING" which should have been included with this file. If this
  10. // file is missing or damaged, see the license at:
  11. //
  12. // http://www.fltk.org/COPYING.php
  13. //
  14. // Please report all bugs and problems on the following page:
  15. //
  16. // http://www.fltk.org/str.php
  17. //
  18. #ifndef Fl_Sys_Menu_Bar_H
  19. #define Fl_Sys_Menu_Bar_H
  20. #include "Fl_Menu_Bar.H"
  21. #include "x.H"
  22. #if defined(__APPLE__) || defined(FL_DOXYGEN)
  23. /**
  24. @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.
  25. *
  26. * On other than Mac OS X platforms, Fl_Sys_Menu_Bar is a synonym of class Fl_Menu_Bar.
  27. *
  28. * You can configure a callback for the 'About' menu item to invoke your own code with fl_mac_set_about().
  29. *
  30. */
  31. class FL_EXPORT Fl_Sys_Menu_Bar : public Fl_Menu_Bar {
  32. protected:
  33. void draw();
  34. public:
  35. /**
  36. @brief The constructor.
  37. *
  38. * On Mac OS X, all arguments are unused. On other platforms they are used as by Fl_Menu_Bar::Fl_Menu_Bar().
  39. */
  40. Fl_Sys_Menu_Bar(int x,int y,int w,int h,const char *l=0);
  41. const Fl_Menu_Item *menu() const {return Fl_Menu_::menu();}
  42. void menu(const Fl_Menu_Item *m);
  43. int add(const char* label, int shortcut, Fl_Callback*, void *user_data=0, int flags=0);
  44. int insert(int index, const char* label, int shortcut, Fl_Callback *cb, void *user_data=0, int flags=0);
  45. void remove(int n);
  46. void replace(int rank, const char *name);
  47. void clear();
  48. int clear_submenu(int index);
  49. #if ! defined(FL_DOXYGEN)
  50. enum menuOrItemOperation { itemAtIndex, setKeyEquivalent, setKeyEquivalentModifierMask, setState, initWithTitle,
  51. numberOfItems, setSubmenu, setEnabled, addSeparatorItem, setTitle, removeItem, addNewItem };
  52. // function doMenuOrItemOperation is in file Fl_cocoa.mm because it contains objective-c code
  53. static void *doMenuOrItemOperation( menuOrItemOperation operation, ...);
  54. #endif
  55. };
  56. #else
  57. typedef Fl_Menu_Bar Fl_Sys_Menu_Bar;
  58. #endif // defined(__APPLE__) || defined(FL_DOXYGEN)
  59. #endif // Fl_Sys_Menu_Bar_H
  60. //
  61. // End of "$Id: Fl_Sys_Menu_Bar.H 9637 2012-07-24 04:37:22Z matt $".
  62. //