diff --git a/Common/GmshUI.h b/Common/GmshUI.h index a1329ce7485e943b9be16926c83f9dd5d9a85b4d..401b36cfd6fc6a32130e533c137480b61f698aeb 100644 --- a/Common/GmshUI.h +++ b/Common/GmshUI.h @@ -8,15 +8,8 @@ #if defined(HAVE_FLTK) # include <FL/Fl.H> -# if (FL_MAJOR_VERSION == 1) && (FL_MINOR_VERSION == 1) -# if (FL_PATCH_VERSION >= 6) -# define HAVE_FLTK_1_1_6_OR_ABOVE -# endif -# if (FL_PATCH_VERSION >= 5) -# define HAVE_FLTK_1_1_5_OR_ABOVE -# endif -# else -# error "Gmsh requires FLTK 1.1.x" +# if (FL_MAJOR_VERSION != 1) || (FL_MINOR_VERSION != 1) || (FL_PATCH_VERSION < 7) +# error "Gmsh requires FLTK 1.1.7 or above" # endif # include <FL/gl.h> # if defined(__APPLE__) diff --git a/Common/Options.cpp b/Common/Options.cpp index 65f265eb54faa59b5f9768a7e2d9d0219f821ecb..3389da0605927ac6927d299adef0f2a0c86aa200 100644 --- a/Common/Options.cpp +++ b/Common/Options.cpp @@ -1968,7 +1968,7 @@ const char *opt_view_name(OPT_ARGS_STR) data->setName(val); #if defined(HAVE_FLTK) if(WID && num >= 0 && num < (int)WID->m_toggle_butt.size()) { - WID->m_toggle_butt[num]->label(data->getName().c_str()); + WID->m_toggle_butt[num]->copy_label(data->getName().c_str()); WID->m_toggle_butt[num]->redraw(); } #endif diff --git a/Fltk/GUI.cpp b/Fltk/GUI.cpp index c0bd5070eb389aef9ca6b4a1a8eb66f5cad4516b..d4b8e55e107aff74145e448ae6ffa62f17a89142 100644 --- a/Fltk/GUI.cpp +++ b/Fltk/GUI.cpp @@ -83,7 +83,7 @@ Fl_Menu_Item m_menubar_table[] = { // shortcuts: they would cause spurious menu items to appear on the // menu window; removed File->Quit) -#if defined(__APPLE__) && defined(HAVE_FLTK_1_1_5_OR_ABOVE) +#if defined(__APPLE__) // random changes in fltk are driving me nuts sometimes #if (FL_MAJOR_VERSION == 1) && (FL_MINOR_VERSION == 1) && (FL_PATCH_VERSION <= 6) @@ -922,7 +922,7 @@ GUI::GUI(int argc, char **argv) // add callback to respond to the Mac Finder (when you click on a // document) -#if defined(__APPLE__) && defined(HAVE_FLTK_1_1_5_OR_ABOVE) +#if defined(__APPLE__) fl_open_callback(OpenProjectMacFinder); #endif @@ -1027,14 +1027,14 @@ void GUI::create_menu_window() int width = 14 * fontsize; // this is the initial height: no dynamic button is shown! -#if defined(__APPLE__) && defined(HAVE_FLTK_1_1_5_OR_ABOVE) +#if defined(__APPLE__) 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__) && defined(HAVE_FLTK_1_1_5_OR_ABOVE) +#if defined(__APPLE__) } #endif @@ -1042,7 +1042,7 @@ void GUI::create_menu_window() m_window->box(GMSH_WINDOW_BOX); m_window->callback(file_quit_cb); -#if defined(__APPLE__) && defined(HAVE_FLTK_1_1_5_OR_ABOVE) +#if defined(__APPLE__) if(CTX.system_menu_bar){ // the system menubar is kind of a hack in fltk < 1.1.7: it still // creates a real (invisible) menubar. To avoid spurious mouse @@ -1064,7 +1064,7 @@ void GUI::create_menu_window() Fl_Box *o = new Fl_Box(0, BH, width, BH + 6); o->box(FL_UP_BOX); y = BH + 3; -#if defined(__APPLE__) && defined(HAVE_FLTK_1_1_5_OR_ABOVE) +#if defined(__APPLE__) } #endif @@ -1175,52 +1175,26 @@ void GUI::set_context(Context_Item * menu_asked, int flag) Msg::StatusBar(1, false, menu[0].label + 1); - // Remove all the children (m_push*, m_toggle*, m_pop*). FLTK <= - // 1.1.4 should be OK with this. FLTK 1.1.5 may crash as it may - // access a widget's data after its callback is executed (we call - // set_context in the button callbacks!). FLTK 1.1.6 introduced a - // fix (Fl::delete_widget) to delay the deletion until the next - // Fl::wait call. In any case, we cannot use m_scroll->clear() - // (broken in < 1.1.5, potential crasher in >= 1.1.5). + // cannot use m_scroll->clear() in fltk 1.1 (should be fixed in 1.3) for(unsigned int i = 0; i < m_push_butt.size(); i++){ m_scroll->remove(m_push_butt[i]); -#if defined(HAVE_FLTK_1_1_6_OR_ABOVE) Fl::delete_widget(m_push_butt[i]); -#else - delete m_push_butt[i]; -#endif } for(unsigned int i = 0; i < m_toggle_butt.size(); i++){ m_scroll->remove(m_toggle_butt[i]); -#if defined(HAVE_FLTK_1_1_6_OR_ABOVE) Fl::delete_widget(m_toggle_butt[i]); -#else - delete m_toggle_butt[i]; -#endif } for(unsigned int i = 0; i < m_toggle2_butt.size(); i++){ m_scroll->remove(m_toggle2_butt[i]); -#if defined(HAVE_FLTK_1_1_6_OR_ABOVE) Fl::delete_widget(m_toggle2_butt[i]); -#else - delete m_toggle2_butt[i]; -#endif } for(unsigned int i = 0; i < m_popup_butt.size(); i++){ m_scroll->remove(m_popup_butt[i]); -#if defined(HAVE_FLTK_1_1_6_OR_ABOVE) Fl::delete_widget(m_popup_butt[i]); -#else - delete m_popup_butt[i]; -#endif } for(unsigned int i = 0; i < m_popup2_butt.size(); i++){ m_scroll->remove(m_popup2_butt[i]); -#if defined(HAVE_FLTK_1_1_6_OR_ABOVE) Fl::delete_widget(m_popup2_butt[i]); -#else - delete m_popup2_butt[i]; -#endif } // reset the vectors @@ -1247,7 +1221,7 @@ void GUI::set_context(Context_Item * menu_asked, int flag) b1->callback(view_toggle_cb, (void *)nb); b1->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE | FL_ALIGN_CLIP); b1->value(opt->Visible); - b1->label(data->getName().c_str()); + b1->copy_label(data->getName().c_str()); b1->tooltip(data->getFileName().c_str()); char *tmp = new char[32]; @@ -1341,7 +1315,7 @@ void GUI::set_context(Context_Item * menu_asked, int flag) else{ // geometry, mesh and solver contexts while(menu[nb + 1].label) { Fl_Button *b = new Fl_Button(0, MH + nb * BH, width, BH); - b->label(menu[nb + 1].label); + b->copy_label(menu[nb + 1].label); b->callback(menu[nb + 1].callback, menu[nb + 1].arg); m_push_butt.push_back(b); m_scroll->add(b); @@ -1574,6 +1548,7 @@ void GUI::set_size(int new_w, int new_h) void GUI::set_title(const char *str) { + // FIXME shoud use copy_label, but broken for Fl_Windows in fltk 1.1.7 g_window->label(str); } diff --git a/Fltk/GUI.h b/Fltk/GUI.h index 7f44a933798b6b66a603007a277632bcf92341db..2c507ca3b12ef9cef7cf4c59ea90538076af137b 100644 --- a/Fltk/GUI.h +++ b/Fltk/GUI.h @@ -35,7 +35,7 @@ #include <FL/Fl_Tooltip.H> #include <FL/Fl_Shared_Image.H> #include <FL/Fl_File_Icon.H> -#if defined(__APPLE__) && defined(HAVE_FLTK_1_1_5_OR_ABOVE) +#if defined(__APPLE__) #include <FL/Fl_Sys_Menu_Bar.H> #endif @@ -142,7 +142,7 @@ public: // menu window Fl_Window *m_window; -#if defined(__APPLE__) && defined(HAVE_FLTK_1_1_5_OR_ABOVE) +#if defined(__APPLE__) Fl_Sys_Menu_Bar *m_sys_menu_bar; #endif Fl_Menu_Bar *m_menu_bar; diff --git a/Fltk/GUI_Extras.cpp b/Fltk/GUI_Extras.cpp index be5eb30762adf630641fd3b21cd35124986c9de4..b76ce92bb4cf07c22109aa6635334c2b5d3c90bd 100644 --- a/Fltk/GUI_Extras.cpp +++ b/Fltk/GUI_Extras.cpp @@ -26,6 +26,9 @@ #include <FL/Fl_Round_Button.H> #include <errno.h> +// FIXME we shoud use copy_label everywhere, but it's broken for +// Fl_Windows in fltk 1.1.7 + #if defined(HAVE_NATIVE_FILE_CHOOSER) #include <FL/Fl_Native_File_Chooser.H> static Fl_Native_File_Chooser *fc = 0; diff --git a/README b/README index bce463fcd44526a9181fcaa627b0b4b0acf6c024..9502091079b03e6a8670f1d65d7a57cae6400c96 100644 --- a/README +++ b/README @@ -7,12 +7,12 @@ To install Gmsh, type make make install -This requires GSL 1.2 or higher (freely available from -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_PREFIX and GSL_PREFIX environment variables) if the libraries -are not installed in their default locations. +This requires GSL 1.2 or above (freely available from +http://sources.redhat.com/gsl/) and FLTK 1.1.7 or above (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_PREFIX and GSL_PREFIX environment variables) if +the libraries are not installed in their default locations. To install a non-graphical version of Gmsh (that does not require FLTK nor OpenGL), type diff --git a/doc/README.msvc b/doc/README.msvc index 4eb9070124f2496b55541601188d7f3aac2f90ef..643365eeef76e896a155e0fcdd1a6e2d1f81e899 100644 --- a/doc/README.msvc +++ b/doc/README.msvc @@ -7,7 +7,8 @@ To compile Gmsh with Microsoft Visual C++ 4) rename "utils\misc\variables.msvc" into "variables" (in the root of the gmsh source directory) -5) edit "variables" to match your local installation of Visual C++ +5) edit "variables" to match your local installation of gmsh and + Visual C++ (and to configure which optional gmsh features to build) 6) type "utils\misc\gmake.exe" diff --git a/doc/gmsh.html b/doc/gmsh.html index c5addecb3e05902267f042a6f37fe24eba7db887..8950669ad7c6c48e54f819c0eabdd909fa79b969 100644 --- a/doc/gmsh.html +++ b/doc/gmsh.html @@ -267,21 +267,19 @@ graphical user interface. </form> <hr> -<a name="opengl-footnote"></a><a -href="#opengl-footmark"><sup>1</sup></a>You need the OpenGL libraries -installed on your system (and in the path of the library loader). A -free replacement for OpenGL can be found at <a -href="http://mesa3d.sourceforge.net/">http://mesa3d.sourceforge.net</a>. +<a name="opengl-footnote"></a><a href="#opengl-footmark"><sup>1</sup></a>You +need the OpenGL libraries installed on your system (and in the path of +the library loader). A free replacement for OpenGL can be found +at <a href="http://mesa3d.sourceforge.net/">http://mesa3d.sourceforge.net</a>. Remember that you may have to reconfigure the loader (ldconfig under Linux) or modify the LD_LIBRARY_PATH/SHLIB_PATH/etc. environment variable in order for Gmsh to find the libraries. <p> -<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.x)</a> libraries properly -installed on your system in order to compile Gmsh. Non-graphical -versions can be compiled without FLTK. +<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.7)</a> libraries +properly installed on your system in order to compile +Gmsh. Non-graphical versions can be compiled without FLTK. <p> Back to <a href="/">geuz.org</a>