FLTK 1.3.3
Fl_Sys_Menu_Bar.H
1 //
2 // "$Id: Fl_Sys_Menu_Bar.H 10102 2014-02-11 17:59:20Z manolo $"
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 
19 #ifndef Fl_Sys_Menu_Bar_H
20 #define Fl_Sys_Menu_Bar_H
21 
22 #include "Fl_Menu_Bar.H"
23 #include "x.H"
24 
25 #if defined(__APPLE__) || defined(FL_DOXYGEN)
26 
41 class FL_EXPORT Fl_Sys_Menu_Bar : public Fl_Menu_Bar {
42 protected:
43  void update();
44  void draw();
45 public:
46  Fl_Sys_Menu_Bar(int x,int y,int w,int h,const char *l=0);
47  ~Fl_Sys_Menu_Bar();
50  const Fl_Menu_Item *menu() const {return Fl_Menu_::menu();}
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);
56  int add(const char* label, const char* shortcut, Fl_Callback* cb, void *user_data=0, int flags=0) {
57  return add(label, fl_old_shortcut(shortcut), cb, user_data, flags);
58  }
59  int add(const char* str);
60  int insert(int index, const char* label, int shortcut, Fl_Callback *cb, void *user_data=0, int flags=0);
64  int insert(int index, const char* label, const char* shortcut, Fl_Callback *cb, void *user_data=0, int flags=0) {
65  return insert(index, label, fl_old_shortcut(shortcut), cb, user_data, flags);
66  }
67  void remove(int n);
68  void replace(int rank, const char *name);
72  void clear();
76  int clear_submenu(int index);
79  void global() {};
82  void mode (int i, int fl) {
83  Fl_Menu_::mode(i, fl);
84  update();
85  }
88  int mode(int i) const { return Fl_Menu_::mode(i); }
91  void shortcut (int i, int s) { Fl_Menu_::shortcut(i, s); update(); };
92 };
93 
94 #else
95 
97 
98 #endif // defined(__APPLE__) || defined(FL_DOXYGEN)
99 
100 #endif // Fl_Sys_Menu_Bar_H
101 
102 //
103 // End of "$Id: Fl_Sys_Menu_Bar.H 10102 2014-02-11 17:59:20Z manolo $".
104 //