diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h index 476eb9d09976bdf3aff927e3034e636fcb2c79af..e08befb646d7079ece51e384aa9d20702e498306 100644 --- a/Common/DefaultOptions.h +++ b/Common/DefaultOptions.h @@ -347,7 +347,7 @@ StringXNumber GeneralOptions_Number[] = { { F|O, "AlphaBlending" , opt_general_alpha_blending , 1. , "Enable alpha blending (transparency) in post-processing views" }, { F|S, "AppleMenuBar" , opt_general_apple_menu_bar , 0. , - "Use Apple-style menu bar?" }, + "Use Apple-style menu bar on Mac OS X?" }, { F|O, "Axes" , opt_general_axes , 1. , "Display the axes linked to the model" }, diff --git a/Fltk/GUI.cpp b/Fltk/GUI.cpp index 9767af984e9fcb7408d4e19780ffa0d125e42ef7..043038421cb1c881b415c7099716f4e74b4211e0 100644 --- a/Fltk/GUI.cpp +++ b/Fltk/GUI.cpp @@ -1,4 +1,4 @@ -// $Id: GUI.cpp,v 1.250 2003-11-14 21:43:44 geuzaine Exp $ +// $Id: GUI.cpp,v 1.251 2003-11-18 05:29:24 geuzaine Exp $ // // Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle // @@ -260,8 +260,8 @@ Context_Item menu_geometry[] = { }; Context_Item menu_geometry_elementary_extrude[] = { { "0Geometry Elementary Extrude", NULL } , - { "Translate", (Fl_Callback *)geometry_elementary_extrude_translate_cb } , - { "Rotate", (Fl_Callback *)geometry_elementary_extrude_rotate_cb } , + { "Translate", (Fl_Callback *)geometry_elementary_extrude_translate_cb } , + { "Rotate", (Fl_Callback *)geometry_elementary_extrude_rotate_cb } , { NULL } }; Context_Item menu_geometry_elementary_extrude_translate[] = { @@ -787,31 +787,41 @@ void GUI::create_menu_window(int argc, char **argv) int width = 13 * fontsize - fontsize / 2 - 2; // this is the initial height: no dynamic button is shown! -#if defined(__APPLE__) && defined(APPLE_USE_SYS_MENU) - MH = BH + 6; // the menu bar is not in the application! -#else - MH = BH + BH + 6; +#if defined(__APPLE__) && defined(HAVE_FL_SYS_MENU_BAR) + if(CTX.apple_menu_bar){ + MH = BH + 6; // the menu bar is not in the application! + } + else{ +#endif + MH = BH + BH + 6; +#if defined(__APPLE__) && defined(HAVE_FL_SYS_MENU_BAR) + } #endif m_window = new Fl_Window(width, MH, "Gmsh"); m_window->box(WINDOW_BOX); m_window->callback(file_quit_cb); -#if defined(__APPLE__) && defined(APPLE_USE_SYS_MENU) - m_menu_bar = new Fl_Sys_Menu_Bar(0, 0, width, BH); - m_menu_bar->menu(m_menubar_table); - m_menu_bar->global (); - Fl_Box *o = new Fl_Box(0, 0, width, BH + 6); - o->box(FL_UP_BOX); - y = 3; -#else - m_menu_bar = new Fl_Menu_Bar(0, 0, width, BH); - m_menu_bar->menu(m_menubar_table); - m_menu_bar->box(FL_UP_BOX); - m_menu_bar->global (); - Fl_Box *o = new Fl_Box(0, BH, width, BH + 6); - o->box(FL_UP_BOX); - y = BH + 3; +#if defined(__APPLE__) && defined(HAVE_FL_SYS_MENU_BAR) + if(CTX.apple_menu_bar){ + m_sys_menu_bar = new Fl_Sys_Menu_Bar(0, 0, width, BH); + m_sys_menu_bar->menu(m_menubar_table); + m_sys_menu_bar->global(); + Fl_Box *o = new Fl_Box(0, 0, width, BH + 6); + o->box(FL_UP_BOX); + y = 3; + } + else{ +#endif + m_menu_bar = new Fl_Menu_Bar(0, 0, width, BH); + m_menu_bar->menu(m_menubar_table); + m_menu_bar->box(FL_UP_BOX); + m_menu_bar->global(); + Fl_Box *o = new Fl_Box(0, BH, width, BH + 6); + o->box(FL_UP_BOX); + y = BH + 3; +#if defined(__APPLE__) && defined(HAVE_FL_SYS_MENU_BAR) + } #endif m_navig_butt[0] = new Fl_Button(1, y, 18, BH / 2, "@#<"); diff --git a/Fltk/GUI.h b/Fltk/GUI.h index b4229486ccfd0d6c96d7d1ad08654e09439c8cb2..acec7100a893bba3c3f8b559de506ee825255c10 100644 --- a/Fltk/GUI.h +++ b/Fltk/GUI.h @@ -55,10 +55,7 @@ #define NB_BUTT_MAX 100 #define NB_HISTORY_MAX 1000 -// define this to get a true Mac menu (not inside gmsh as in Window/Unix) -#undef APPLE_USE_SYS_MENU - -#ifdef APPLE_USE_SYS_MENU +#if defined(__APPLE__) && defined(HAVE_FL_SYS_MENU_BAR) #include <FL/Fl_Sys_Menu_Bar.H> #endif @@ -134,11 +131,10 @@ public: // menu window Fl_Window *m_window ; -#if defined(__APPLE__) && defined(APPLE_USE_SYS_MENU) - Fl_Sys_Menu_Bar *m_menu_bar ; -#else - Fl_Menu_Bar *m_menu_bar ; +#if defined(__APPLE__) && defined(HAVE_FL_SYS_MENU_BAR) + Fl_Sys_Menu_Bar *m_sys_menu_bar ; #endif + Fl_Menu_Bar *m_menu_bar ; Fl_Choice *m_module_butt ; Fl_Button *m_navig_butt [2] ; Fl_Button *m_push_butt [NB_BUTT_MAX] ; diff --git a/configure b/configure index 3e9e6a89b44655094de244d83ef2170b178ea451..06f5c8cba1a4874a2259374c883225de1d41cddc 100755 --- a/configure +++ b/configure @@ -849,6 +849,7 @@ Optional Features: --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-gsl use GSL as numerical toolkit (default=yes) --enable-gui build the graphical user interface (default=yes) + --enable-macmenu enable Apple-style menu bar on Mac OS X (default=no) --enable-parallel enable parallel version (default=no) --enable-triangle compile Triangle if available (default=yes) --enable-jpeg enable JPEG support (default=yes) @@ -1336,6 +1337,11 @@ fi; if test "${enable_gui+set}" = set; then enableval="$enable_gui" +fi; +# Check whether --enable-macmenu or --disable-macmenu was given. +if test "${enable_macmenu+set}" = set; then + enableval="$enable_macmenu" + fi; # Check whether --enable-parallel or --disable-parallel was given. if test "${enable_parallel+set}" = set; then @@ -3538,6 +3544,10 @@ if test "x$enable_parallel" = "xyes"; then FLAGS="-DPARALLEL ${FLAGS}" fi +if test "x$enable_macmenu" = "xyes"; then + FLAGS="-DHAVE_FL_SYS_MENU_BAR ${FLAGS}" +fi + LINKER="${CXX}" POSTBUILD="" diff --git a/configure.in b/configure.in index 56b9a54ab48d9451fd205fb7b8b7db44e9e7cabb..d15717e73cc682d60239729838c0763b6aa246f6 100644 --- a/configure.in +++ b/configure.in @@ -1,4 +1,4 @@ -dnl $Id: configure.in,v 1.43 2003-11-11 09:05:43 geuzaine Exp $ +dnl $Id: configure.in,v 1.44 2003-11-18 05:29:24 geuzaine Exp $ dnl dnl Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle dnl @@ -57,6 +57,9 @@ AC_ARG_ENABLE(gsl, AC_ARG_ENABLE(gui, AC_HELP_STRING([--enable-gui], [build the graphical user interface (default=yes)])) +AC_ARG_ENABLE(macmenu, + AC_HELP_STRING([--enable-macmenu], + [enable Apple-style menu bar on Mac OS X (default=no)])) AC_ARG_ENABLE(parallel, AC_HELP_STRING([--enable-parallel], [enable parallel version (default=no)])) @@ -274,6 +277,11 @@ if test "x$enable_parallel" = "xyes"; then FLAGS="-DPARALLEL ${FLAGS}" fi +dnl Check if we should enable the Apple-style menu bar +if test "x$enable_macmenu" = "xyes"; then + FLAGS="-DHAVE_FL_SYS_MENU_BAR ${FLAGS}" +fi + dnl Set default linker and post build action LINKER="${CXX}" POSTBUILD=""