diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h index 943799a9f1069f283c75e7df156b28e9ba8da615..8036820d8122e54088ff5c537af264c5df089850 100644 --- a/Common/DefaultOptions.h +++ b/Common/DefaultOptions.h @@ -120,8 +120,8 @@ StringXString SolverOptions_String[] = { { F|O, "Name0" , opt_solver_name0 , "GetDP" , "Name of solver 0" }, { F|O, "Help0" , opt_solver_help0 , - "A General environment for the treatment of\nDiscrete Problems\n\n" - "Copyright (C) 1997-2009\nPatrick Dular and Christophe Geuzaine\n\n" + "A General environment for the treatment of Discrete Problems\n\n" + "Copyright (C) 1997-2009 Patrick Dular and Christophe Geuzaine\n\n" "Visit http://www.geuz.org/getdp/ for more info", "Help string for solver 0" }, { F|O, "Executable0" , opt_solver_executable0 , diff --git a/Fltk/FlGui.cpp b/Fltk/FlGui.cpp index de9c4529e476b048adcfa7546664cdb6963469e7..288717e2f0d532bf1a76f9994c4e1e53b2194ab9 100644 --- a/Fltk/FlGui.cpp +++ b/Fltk/FlGui.cpp @@ -860,31 +860,3 @@ void window_cb(Fl_Widget *w, void *data) } } -void add_multiline_in_browser(Fl_Browser *o, const char *prefix, - const char *str, int wrap) -{ - int start = 0, len; - if(!str || !strlen(str) || !strcmp(str, "\n")) { - o->add(" "); - return; - } - for(int i = 0; i < (int)strlen(str); i++) { - if(i == (int)strlen(str) - 1 || str[i] == '\n' || - (wrap > 0 && i - start == wrap)) { - if(wrap > 0 && i - start == wrap){ //line is longer than wrap - while(str[i] != ' ' && i > start) //go back to the previous space - i--; - if(i == start) //no space in this line, cut the word - i += wrap; - } - len = i - start + (str[i] == '\n' ? 0 : 1); - char *buff = new char[len + strlen(prefix) + 2]; - strcpy(buff, prefix); - strncat(buff, &str[start], len); - buff[len + strlen(prefix)] = '\0'; - o->add(buff); - start = i + 1; - delete [] buff; - } - } -} diff --git a/Fltk/FlGui.h b/Fltk/FlGui.h index 5cd7469a4fb8216ceab06c976982aadb8c792fc4..df54a9b5fc274a4111393eaeed8e97e2ecdc6ebe 100644 --- a/Fltk/FlGui.h +++ b/Fltk/FlGui.h @@ -111,8 +111,4 @@ class FlGui{ void redraw_cb(Fl_Widget *w, void *data); void window_cb(Fl_Widget *w, void *data); -class Fl_Browser; -void add_multiline_in_browser(Fl_Browser *o, const char *prefix, - const char *str, int wrap=0); - #endif diff --git a/Fltk/solverWindow.cpp b/Fltk/solverWindow.cpp index 22a79d7cbf1cd3fee8e91cf7d31c44f355a204a1..dbaa815d5a1e5b96c1bfede89d5fc37ad4a4a5aa 100644 --- a/Fltk/solverWindow.cpp +++ b/Fltk/solverWindow.cpp @@ -7,7 +7,7 @@ #include <FL/Fl_Tabs.H> #include <FL/Fl_Box.H> #include <FL/Fl_Return_Button.H> -#include <FL/Fl_Browser.H> +#include <FL/Fl_Help_View.H> #include "GmshMessage.h" #include "GmshSocket.h" #include "ConnectionManager.h" @@ -510,14 +510,15 @@ solverWindow::solverWindow(int num, int deltaFontSize) Fl_Group *g = new Fl_Group (WB, WB + BH, width - 2 * WB, height - 2 * WB, "About"); - Fl_Browser *o = new Fl_Browser + Fl_Help_View *o = new Fl_Help_View (2 * WB, 2 * WB + 1 * BH, width - 4 * WB, height - 4 * WB - BH); - o->add(" "); - add_multiline_in_browser - (o, "@c@b@.", ConnectionManager::get(num)->name.c_str(), false); - o->add(" "); - add_multiline_in_browser - (o, "@c@. ", ConnectionManager::get(num)->help.c_str(), false); + o->textfont(FL_HELVETICA); + o->textsize(FL_NORMAL_SIZE); + std::string help = ConnectionManager::get(num)->help; + ConvertToHTML(help); + help = std::string("<h3>") + ConnectionManager::get(num)->name + + "</h3><p>" + help; + o->value(help.c_str()); g->end(); }