FLTK 1.3.0
|
00001 // 00002 // "$Id: Fl_Sys_Menu_Bar.H 7903 2010-11-28 21:06:39Z matt $" 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; you can redistribute it and/or 00009 // modify it under the terms of the GNU Library General Public 00010 // License as published by the Free Software Foundation; either 00011 // version 2 of the License, or (at your option) any later version. 00012 // 00013 // This library is distributed in the hope that it will be useful, 00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 // Library General Public License for more details. 00017 // 00018 // You should have received a copy of the GNU Library General Public 00019 // License along with this library; if not, write to the Free Software 00020 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00021 // USA. 00022 // 00023 // Please report all bugs and problems on the following page: 00024 // 00025 // http://www.fltk.org/str.php 00026 // 00027 00028 #ifndef Fl_Sys_Menu_Bar_H 00029 #define Fl_Sys_Menu_Bar_H 00030 00031 #include "Fl_Menu_Bar.H" 00032 #include "x.H" 00033 00034 #if defined(__APPLE__) || defined(FL_DOXYGEN) 00035 00041 class FL_EXPORT Fl_Sys_Menu_Bar : public Fl_Menu_Bar { 00042 protected: 00043 void draw(); 00044 public: 00050 Fl_Sys_Menu_Bar(int x,int y,int w,int h,const char *l=0) 00051 : Fl_Menu_Bar(x,y,w,h,l) { 00052 deactivate(); // don't let the old area take events 00053 fl_sys_menu_bar = this; 00054 } 00055 void menu(const Fl_Menu_Item *m); 00056 int add(const char* label, int shortcut, Fl_Callback*, void *user_data=0, int flags=0); 00057 int insert(int index, const char* label, int shortcut, Fl_Callback *cb, void *user_data=0, int flags=0); 00058 void remove(int n); 00059 void replace(int rank, const char *name); 00060 void clear(); 00061 int clear_submenu(int index); 00062 #if ! defined(FL_DOXYGEN) 00063 enum menuOrItemOperation { itemAtIndex, setKeyEquivalent, setKeyEquivalentModifierMask, setState, initWithTitle, 00064 numberOfItems, setSubmenu, setEnabled, addSeparatorItem, setTitle, removeItem, addNewItem, renameItem }; 00065 // function doMenuOrItemOperation is in file Fl_cocoa.mm because it contains objective-c code 00066 static void *doMenuOrItemOperation( menuOrItemOperation operation, ...); 00067 #endif 00068 }; 00069 00070 #else 00071 00072 typedef Fl_Menu_Bar Fl_Sys_Menu_Bar; 00073 00074 #endif // defined(__APPLE__) || defined(FL_DOXYGEN) 00075 00076 #endif // Fl_Sys_Menu_Bar_H 00077 00078 // 00079 // End of "$Id: Fl_Sys_Menu_Bar.H 7903 2010-11-28 21:06:39Z matt $". 00080 //