diff --git a/Fltk/aboutWindow.cpp b/Fltk/aboutWindow.cpp index f8cb8aad424584d03b3eca4384fd3f949e771ed2..09e967ae52c78c06e29f81e07e9753b9fbfca40a 100644 --- a/Fltk/aboutWindow.cpp +++ b/Fltk/aboutWindow.cpp @@ -3,10 +3,8 @@ // See the LICENSE.txt file for license information. Please report all // bugs and problems to <gmsh@geuz.org>. -#include <stdio.h> -#include <FL/Fl_Browser.H> -#include <FL/Fl_Box.H> -#include <FL/Fl_Button.H> +#include <sstream> +#include <FL/Fl_Help_View.H> #include "FlGui.h" #include "aboutWindow.h" #include "paletteWindow.h" @@ -15,88 +13,48 @@ #include "OS.h" #include "Context.h" -static void help_license_cb(Fl_Widget *w, void *data) +static const char *help_link(Fl_Widget *w, const char *uri) { std::string prog = FixWindowsPath(CTX::instance()->webBrowser); - SystemCall(ReplacePercentS(prog, "http://geuz.org/gmsh/doc/LICENSE.txt")); -} - -static void help_credits_cb(Fl_Widget *w, void *data) -{ - std::string prog = FixWindowsPath(CTX::instance()->webBrowser); - SystemCall(ReplacePercentS(prog, "http://geuz.org/gmsh/doc/CREDITS.txt")); -} - -static void help_hide_cb(Fl_Widget *w, void *data) -{ - ((Fl_Window*)data)->hide(); + SystemCall(ReplacePercentS(prog, uri)); + return 0; } aboutWindow::aboutWindow() { - char buffer[1024]; - int width = 28 * FL_NORMAL_SIZE; - int height = 17 * BH; + int width = 26 * FL_NORMAL_SIZE; + int height = 16 * BH; win = new paletteWindow (width, height, CTX::instance()->nonModalWindows ? true : false, "About Gmsh"); win->box(GMSH_WINDOW_BOX); - { - Fl_Browser *o = new Fl_Browser(0, 0, width, height - 2 * WB - BH); - o->box(FL_FLAT_BOX); - o->has_scrollbar(0); // no scrollbars - o->add(" "); - o->add("@c@b@.Gmsh"); - o->add("@c@.A three-dimensional finite element mesh generator"); - o->add("@c@.with built-in pre- and post-processing facilities"); - o->add(" "); - o->add("@c@.Copyright (C) 1997-2009"); - o->add("@c@.Christophe Geuzaine and Jean-Francois Remacle"); - o->add(" "); - o->add("@c@.Please send all questions and bug reports to"); - o->add("@c@b@.gmsh@geuz.org"); - o->add(" "); - sprintf(buffer, "@c@.Version: %s", GetGmshVersion()); - o->add(buffer); - sprintf(buffer, "@c@.License: %s", GetGmshShortLicense()); - o->add(buffer); - sprintf(buffer, "@c@.Graphical user interface toolkit: FLTK %d.%d.%d", - FL_MAJOR_VERSION, FL_MINOR_VERSION, FL_PATCH_VERSION); - o->add(buffer); - sprintf(buffer, "@c@.Build OS: %s", GetGmshBuildOS()); - o->add(buffer); - sprintf(buffer, "@c@.Build date: %s", GetGmshBuildDate()); - o->add(buffer); - sprintf(buffer, "@c@.Build host: %s", GetGmshBuildHost()); - o->add(buffer); - std::vector<std::string> lines = SplitWhiteSpace(GetGmshBuildOptions(), 30); - for(unsigned int i = 0; i < lines.size(); i++){ - if(!i) - sprintf(buffer, "@c@.Build options:%s", lines[i].c_str()); - else - sprintf(buffer, "@c@.%s", lines[i].c_str()); - o->add(buffer); - } - sprintf(buffer, "@c@.Packaged by: %s", GetGmshPackager()); - o->add(buffer); - o->add(" "); - o->add("@c@.Visit http://www.geuz.org/gmsh/ for more information"); - o->add(" "); - o->callback(help_hide_cb, (void*)win); - } - - { - Fl_Button *o = new Fl_Button - (width/2 - BB - WB/2, height - BH - WB, BB, BH, "License"); - o->callback(help_license_cb); - } - - { - Fl_Button *o = new Fl_Button - (width/2 + WB/2, height - BH - WB, BB, BH, "Credits"); - o->callback(help_credits_cb); - } + Fl_Help_View *o = new Fl_Help_View(0, 0, width, height); + o->box(FL_FLAT_BOX); + std::ostringstream sstream; + sstream << "<center><h3>Gmsh</h3><br>version " << GetGmshVersion() + << "<p>Copyright (C) 1997-2009" + << "<br>Christophe Geuzaine and Jean-François Remacle" + << "<p><a href=\"http://geuz.org/gmsh/doc/CREDITS.txt\">Credits</a> " + << "and <a href=\"http://geuz.org/gmsh/doc/LICENSE.txt\">licensing " + << "information</a>" + << "<p>Please send all questions and bug reports to " + << "<a href=\"mailto:gmsh@geuz.org\">gmsh@geuz.org</a></center>" + << "<font color=#888888><ul>" + << "<li><i>GUI toolkit:</i> FLTK " + << FL_MAJOR_VERSION << "." << FL_MINOR_VERSION << "." << FL_PATCH_VERSION + << "<li><i>Build OS:</i> " << GetGmshBuildOS() + << "<li><i>Build date:</i> " << GetGmshBuildDate() + << "<li><i>Build host:</i> " << GetGmshBuildHost() + << "<li><i>Packaged by:</i> " << GetGmshPackager() + << "<li><i>Build options:</i>" << GetGmshBuildOptions() + << "</ul></font><center>" + << "Visit <a href=\"http://geuz.org/gmsh/\">http://geuz.org/gmsh/</a> " + << "for more information</center>"; + o->value(sstream.str().c_str()); + o->link(help_link); + o->textfont(FL_HELVETICA); + o->textsize(FL_NORMAL_SIZE); win->position(Fl::x() + Fl::w()/2 - width / 2, Fl::y() + Fl::h()/2 - height / 2); diff --git a/Fltk/pluginWindow.cpp b/Fltk/pluginWindow.cpp index 9aa6c61aad8da91b1219db623facd2e11778c8bc..040f0a3fc24999c89952df036257e5779944d5eb 100644 --- a/Fltk/pluginWindow.cpp +++ b/Fltk/pluginWindow.cpp @@ -348,8 +348,7 @@ pluginWindow::pluginWindow(int deltaFontSize) record->type(FL_TOGGLE_BUTTON); record->tooltip("Append scripting command to file options when plugin is run"); - Fl_Box *resize_box = new Fl_Box(L1 + L2 + 2 * BH, height - 4 * BH, 1, 1); - win->resizable(resize_box); + win->resizable(new Fl_Box(L1 + L2 + 2 * BH, height - 4 * BH, 10, 10)); win->size_range(width0, height0); win->position(CTX::instance()->pluginPosition[0], CTX::instance()->pluginPosition[1]);