• Main Page
  • Related Pages
  • Modules
  • Classes
  • Files
  • File List
  • File Members

Fl_Sys_Menu_Bar.H

00001 //
00002 // "$Id$"
00003 //
00004 // MacOS system menu bar header file for the Fast Light Tool Kit (FLTK).
00005 //
00006 // Copyright 1998-2010 by Bill Spitzak and others.
00007 //
00008 // This library is free software. Distribution and use rights are outlined in
00009 // the file "COPYING" which should have been included with this file.  If this
00010 // file is missing or damaged, see the license at:
00011 //
00012 //     http://www.fltk.org/COPYING.php
00013 //
00014 // Please report all bugs and problems on the following page:
00015 //
00016 //     http://www.fltk.org/str.php
00017 //
00018 
00019 #ifndef Fl_Sys_Menu_Bar_H
00020 #define Fl_Sys_Menu_Bar_H
00021 
00022 #include "Fl_Menu_Bar.H"
00023 #include "x.H"
00024 
00025 #if defined(__APPLE__) || defined(FL_DOXYGEN)
00026 
00048 class FL_EXPORT Fl_Sys_Menu_Bar : public Fl_Menu_Bar {
00049 
00050 #if FLTK_ABI_VERSION >= 10304
00051   // NEW -- update() public (STR#3317)
00052 public:
00053   void update();
00054 protected:
00055   void draw();
00056 #else
00057   // OLD -- update() protected
00058 protected:
00059   void update();
00060   void draw();
00061 #endif
00062 
00063 public:
00064   Fl_Sys_Menu_Bar(int x,int y,int w,int h,const char *l=0);
00065   ~Fl_Sys_Menu_Bar();
00068   const Fl_Menu_Item *menu() const {return Fl_Menu_::menu();}
00069   void menu(const Fl_Menu_Item *m);
00070   int add(const char* label, int shortcut, Fl_Callback*, void *user_data=0, int flags=0);
00074   int add(const char* label, const char* shortcut, Fl_Callback* cb, void *user_data=0, int flags=0) {
00075     return add(label, fl_old_shortcut(shortcut), cb, user_data, flags);
00076     }
00077   int add(const char* str);
00078   int insert(int index, const char* label, int shortcut, Fl_Callback *cb, void *user_data=0, int flags=0);
00082   int insert(int index, const char* label, const char* shortcut, Fl_Callback *cb, void *user_data=0, int flags=0) {
00083     return insert(index, label, fl_old_shortcut(shortcut), cb, user_data, flags);
00084     }
00085   void remove(int n);
00086   void replace(int index, const char *name);
00090   void clear();
00094   int clear_submenu(int index);
00097   void global() {};
00100   void  mode (int i, int fl) {
00101     Fl_Menu_::mode(i, fl);
00102     update();
00103     }
00106   int mode(int i) const { return Fl_Menu_::mode(i); }
00109   void shortcut (int i, int s) { Fl_Menu_::shortcut(i, s); update(); }
00111   void setonly (Fl_Menu_Item *item) { Fl_Menu_::setonly(item); update(); }
00112 };
00113 
00114 #else
00115 
00116 #if FLTK_ABI_VERSION >= 10304
00117 // NEW -- small class for update()
00118 class FL_EXPORT Fl_Sys_Menu_Bar : public Fl_Menu_Bar {
00119 public:
00120   Fl_Sys_Menu_Bar(int x,int y,int w,int h,const char *l=0) : Fl_Menu_Bar(x,y,w,h,l) {}
00121   inline void update() {}
00122 };
00123 #else
00124 // OLD -- simple typedef
00125 typedef Fl_Menu_Bar Fl_Sys_Menu_Bar;
00126 #endif
00127 
00128 #endif // defined(__APPLE__) || defined(FL_DOXYGEN)
00129 
00130 #endif // Fl_Sys_Menu_Bar_H
00131 
00132 //
00133 // End of "$Id$".
00134 //
  • © 1998-2016 by Bill Spitzak and others.     FLTK

  • © 1998-2016 by Bill Spitzak and others.     FLTK

    Permission is granted to reproduce this manual or any portion for any purpose, provided this copyright and permission notice are preserved.