diff --git a/Common/GmshUI.h b/Common/GmshUI.h index 721b6c04019b37f1be05cd4c24a559f372d96f29..44f7a45b4876a8a5ca537d46fd6157b8db405c26 100644 --- a/Common/GmshUI.h +++ b/Common/GmshUI.h @@ -21,26 +21,20 @@ // Please report all bugs and problems to <gmsh@geuz.org>. #if defined(HAVE_FLTK) - # include <FL/Fl.H> - -// Gmsh requires FLTK 1.1.5 or above (the new dynamic menus don't -// work with older FLTK versions due to a bug in Fl_Scroll.clear()) # if (FL_MAJOR_VERSION == 1) && (FL_MINOR_VERSION == 1) -# if (FL_PATCH_VERSION < 5) -# error "Gmsh requires FLTK >= 1.1.5" +# if (FL_PATCH_VERSION >= 5) +# define HAVE_FLTK_1_1_5_OR_ABOVE # endif # else # error "Gmsh requires FLTK 1.1.x" # endif - # include <FL/gl.h> # if defined(__APPLE__) # include <OpenGL/glu.h> # else # include <GL/glu.h> # endif - #endif #endif diff --git a/Fltk/GUI.cpp b/Fltk/GUI.cpp index ba899d6e1ba06dfc38af55af4efc8562e100f9b7..75c7e46fbb1d512c173583e1d655439cb752dc09 100644 --- a/Fltk/GUI.cpp +++ b/Fltk/GUI.cpp @@ -1,4 +1,4 @@ -// $Id: GUI.cpp,v 1.354 2004-09-28 17:13:48 geuzaine Exp $ +// $Id: GUI.cpp,v 1.355 2004-09-28 22:45:14 geuzaine Exp $ // // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // @@ -108,7 +108,7 @@ Fl_Menu_Item m_menubar_table[] = { // menu window; removed File->Quit; changed capitalization to match // Apple's guidelines) -#if defined(__APPLE__) +#if defined(__APPLE__) && defined(HAVE_FLTK_1_1_5_OR_ABOVE) Fl_Menu_Item m_sys_menubar_table[] = { {"File", 0, 0, 0, FL_SUBMENU}, {"New...", FL_CTRL+'n', (Fl_Callback *)file_new_cb, 0}, @@ -748,7 +748,7 @@ GUI::GUI(int argc, char **argv) // add callback to respond to the Mac Finder (when you click on a // document) -#if defined(__APPLE__) +#if defined(__APPLE__) && defined(HAVE_FLTK_1_1_5_OR_ABOVE) fl_open_callback(OpenProblemMacFinder); #endif @@ -848,14 +848,14 @@ void GUI::create_menu_window(int argc, char **argv) int width = 14 * fontsize; // this is the initial height: no dynamic button is shown! -#if defined(__APPLE__) +#if defined(__APPLE__) && defined(HAVE_FLTK_1_1_5_OR_ABOVE) if(CTX.system_menu_bar){ MH = BH + 6; // the menu bar is not in the application! } else{ #endif MH = BH + BH + 6; -#if defined(__APPLE__) +#if defined(__APPLE__) && defined(HAVE_FLTK_1_1_5_OR_ABOVE) } #endif @@ -863,7 +863,7 @@ void GUI::create_menu_window(int argc, char **argv) m_window->box(WINDOW_BOX); m_window->callback(file_quit_cb); -#if defined(__APPLE__) +#if defined(__APPLE__) && defined(HAVE_FLTK_1_1_5_OR_ABOVE) if(CTX.system_menu_bar){ // the system menubar is kind of a hack in fltk--it still creates // a real (invisible) menubar. So we make it a 1x1 pixel rectangle @@ -886,7 +886,7 @@ void GUI::create_menu_window(int argc, char **argv) Fl_Box *o = new Fl_Box(0, BH, width, BH + 6); o->box(FL_UP_BOX); y = BH + 3; -#if defined(__APPLE__) +#if defined(__APPLE__) && defined(HAVE_FLTK_1_1_5_OR_ABOVE) } #endif @@ -997,7 +997,31 @@ void GUI::set_context(Context_Item * menu_asked, int flag) Msg(STATUS2N, menu[0].label + 1); // free all the children (m_push*, m_toggle*, m_pop*) +#if defined(HAVE_FLTK_1_1_5_OR_ABOVE) m_scroll->clear(); +#else + for(int i = 0; i < m_push_butt.size(); i++){ + m_scroll->remove(m_push_butt[i]); + delete m_push_butt[i]; + } + for(int i = 0; i < m_toggle_butt.size(); i++){ + m_scroll->remove(m_toggle_butt[i]); + delete m_toggle_butt[i]; + } + for(int i = 0; i < m_toggle2_butt.size(); i++){ + m_scroll->remove(m_toggle2_butt[i]); + delete m_toggle2_butt[i]; + } + for(int i = 0; i < m_popup_butt.size(); i++){ + m_scroll->remove(m_popup_butt[i]); + delete m_popup_butt[i]; + } + for(int i = 0; i < m_popup2_butt.size(); i++){ + m_scroll->remove(m_popup2_butt[i]); + delete m_popup2_butt[i]; + } +#endif + // reset the vectors m_push_butt.clear(); m_toggle_butt.clear(); diff --git a/Fltk/GUI.h b/Fltk/GUI.h index b4a4543fad0029788571368281e92fd9db40ca54..11e2f1ce074e7964b8748af30b307911a0c3b39d 100644 --- a/Fltk/GUI.h +++ b/Fltk/GUI.h @@ -46,7 +46,7 @@ #include <FL/Fl_Color_Chooser.H> #include <FL/fl_ask.H> #include <FL/Fl_Tooltip.H> -#if defined(__APPLE__) +#if defined(__APPLE__) && defined(HAVE_FLTK_1_1_5_OR_ABOVE) #include <FL/Fl_Sys_Menu_Bar.H> #endif @@ -135,7 +135,7 @@ public: // menu window Fl_Window *m_window ; -#if defined(__APPLE__) +#if defined(__APPLE__) && defined(HAVE_FLTK_1_1_5_OR_ABOVE) Fl_Sys_Menu_Bar *m_sys_menu_bar ; #endif Fl_Menu_Bar *m_menu_bar ; diff --git a/Makefile b/Makefile index 59ddc3d7d3851ed3b8a2e719580d23cb65ed646a..358d2655b1c40524369e816fa5567bc1ff70fbb3 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.370 2004-09-28 17:15:19 geuzaine Exp $ +# $Id: Makefile,v 1.371 2004-09-28 22:45:14 geuzaine Exp $ # # Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle # @@ -23,7 +23,7 @@ include variables GMSH_MAJOR_VERSION = 1 GMSH_MINOR_VERSION = 55 -GMSH_PATCH_VERSION = 3 +GMSH_PATCH_VERSION = 4 GMSH_EXTRA_VERSION = "-cvs" GMSH_VERSION = ${GMSH_MAJOR_VERSION}.${GMSH_MINOR_VERSION}.${GMSH_PATCH_VERSION}${GMSH_EXTRA_VERSION} diff --git a/README b/README index 40ea50a5d147306f7cd42932cf4c961c2ac9185d..d3d0fb0cc3181842295b194aaca823a6be9cf92d 100644 --- a/README +++ b/README @@ -9,15 +9,14 @@ make make install This requires GSL 1.2 or higher (freely available from -http://sources.redhat.com/gsl/) and FLTK 1.1.5 or higher (configured -with OpenGL support; freely available from http://www.fltk.org). You -can use the --with-fltk-prefix and --with-gsl-prefix configure options -(or define the FLTK_DIR and GSL_DIR environment variables) if the -libraries are not installed in their default locations. Please note -that compiling the Windows version requires the Cygwin tools (freely -available from http://www.cygwin.com) and a "cygwin-enabled" version -of FLTK (i.e., you have to configure FLTK with "./configure ---enable-cygwin"). +http://sources.redhat.com/gsl/) and FLTK 1.1.x (configured with OpenGL +support; freely available from http://www.fltk.org). You can use the +--with-fltk-prefix and --with-gsl-prefix configure options (or define +the FLTK_DIR and GSL_DIR environment variables) if the libraries are +not installed in their default locations. Please note that compiling +the Windows version requires the Cygwin tools (freely available from +http://www.cygwin.com) and a "cygwin-enabled" version of FLTK (i.e., +you have to configure FLTK with "./configure --enable-cygwin"). To install a non-graphical version of Gmsh (that does not require FLTK nor OpenGL), type diff --git a/doc/gmsh.html b/doc/gmsh.html index e96b285cbcbbcaa5dfdcfd3732cd8412545b8c93..0c5af874184eba11eb03bdf14611ba766100cedb 100644 --- a/doc/gmsh.html +++ b/doc/gmsh.html @@ -277,7 +277,7 @@ variable in order for Gmsh to find the libraries. <a name="build-footnote"></a><a href="#build-footmark"><sup>2</sup></a>You need the <a href="http://sources.redhat.com/gsl/">GSL (>= 1.2)</a> and <a -href="http://www.fltk.org/">FLTK (>= 1.1.5)</a> libraries properly +href="http://www.fltk.org/">FLTK (1.1.x)</a> libraries properly installed on your system in order to compile Gmsh. Non-graphical versions can be compiled without FLTK. Compiling the Windows version requires the <a href="http://www.cygwin.com/">Cygwin</a> tools and