Skip to content
Snippets Groups Projects
Commit ecc5aa6f authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

use help_view in about win

parent 2a481f1c
No related branches found
No related tags found
No related merge requests found
...@@ -3,10 +3,8 @@ ...@@ -3,10 +3,8 @@
// See the LICENSE.txt file for license information. Please report all // See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>. // bugs and problems to <gmsh@geuz.org>.
#include <stdio.h> #include <sstream>
#include <FL/Fl_Browser.H> #include <FL/Fl_Help_View.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Button.H>
#include "FlGui.h" #include "FlGui.h"
#include "aboutWindow.h" #include "aboutWindow.h"
#include "paletteWindow.h" #include "paletteWindow.h"
...@@ -15,88 +13,48 @@ ...@@ -15,88 +13,48 @@
#include "OS.h" #include "OS.h"
#include "Context.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); std::string prog = FixWindowsPath(CTX::instance()->webBrowser);
SystemCall(ReplacePercentS(prog, "http://geuz.org/gmsh/doc/LICENSE.txt")); SystemCall(ReplacePercentS(prog, uri));
} return 0;
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();
} }
aboutWindow::aboutWindow() aboutWindow::aboutWindow()
{ {
char buffer[1024]; int width = 26 * FL_NORMAL_SIZE;
int width = 28 * FL_NORMAL_SIZE; int height = 16 * BH;
int height = 17 * BH;
win = new paletteWindow win = new paletteWindow
(width, height, CTX::instance()->nonModalWindows ? true : false, "About Gmsh"); (width, height, CTX::instance()->nonModalWindows ? true : false, "About Gmsh");
win->box(GMSH_WINDOW_BOX); win->box(GMSH_WINDOW_BOX);
{ Fl_Help_View *o = new Fl_Help_View(0, 0, width, height);
Fl_Browser *o = new Fl_Browser(0, 0, width, height - 2 * WB - BH); o->box(FL_FLAT_BOX);
o->box(FL_FLAT_BOX); std::ostringstream sstream;
o->has_scrollbar(0); // no scrollbars sstream << "<center><h3>Gmsh</h3><br>version " << GetGmshVersion()
o->add(" "); << "<p>Copyright (C) 1997-2009"
o->add("@c@b@.Gmsh"); << "<br>Christophe Geuzaine and Jean-Fran&ccedil;ois Remacle"
o->add("@c@.A three-dimensional finite element mesh generator"); << "<p><a href=\"http://geuz.org/gmsh/doc/CREDITS.txt\">Credits</a> "
o->add("@c@.with built-in pre- and post-processing facilities"); << "and <a href=\"http://geuz.org/gmsh/doc/LICENSE.txt\">licensing "
o->add(" "); << "information</a>"
o->add("@c@.Copyright (C) 1997-2009"); << "<p>Please send all questions and bug reports to "
o->add("@c@.Christophe Geuzaine and Jean-Francois Remacle"); << "<a href=\"mailto:gmsh@geuz.org\">gmsh@geuz.org</a></center>"
o->add(" "); << "<font color=#888888><ul>"
o->add("@c@.Please send all questions and bug reports to"); << "<li><i>GUI toolkit:</i> FLTK "
o->add("@c@b@.gmsh@geuz.org"); << FL_MAJOR_VERSION << "." << FL_MINOR_VERSION << "." << FL_PATCH_VERSION
o->add(" "); << "<li><i>Build OS:</i> " << GetGmshBuildOS()
sprintf(buffer, "@c@.Version: %s", GetGmshVersion()); << "<li><i>Build date:</i> " << GetGmshBuildDate()
o->add(buffer); << "<li><i>Build host:</i> " << GetGmshBuildHost()
sprintf(buffer, "@c@.License: %s", GetGmshShortLicense()); << "<li><i>Packaged by:</i> " << GetGmshPackager()
o->add(buffer); << "<li><i>Build options:</i>" << GetGmshBuildOptions()
sprintf(buffer, "@c@.Graphical user interface toolkit: FLTK %d.%d.%d", << "</ul></font><center>"
FL_MAJOR_VERSION, FL_MINOR_VERSION, FL_PATCH_VERSION); << "Visit <a href=\"http://geuz.org/gmsh/\">http://geuz.org/gmsh/</a> "
o->add(buffer); << "for more information</center>";
sprintf(buffer, "@c@.Build OS: %s", GetGmshBuildOS()); o->value(sstream.str().c_str());
o->add(buffer); o->link(help_link);
sprintf(buffer, "@c@.Build date: %s", GetGmshBuildDate()); o->textfont(FL_HELVETICA);
o->add(buffer); o->textsize(FL_NORMAL_SIZE);
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);
}
win->position(Fl::x() + Fl::w()/2 - width / 2, win->position(Fl::x() + Fl::w()/2 - width / 2,
Fl::y() + Fl::h()/2 - height / 2); Fl::y() + Fl::h()/2 - height / 2);
......
...@@ -348,8 +348,7 @@ pluginWindow::pluginWindow(int deltaFontSize) ...@@ -348,8 +348,7 @@ pluginWindow::pluginWindow(int deltaFontSize)
record->type(FL_TOGGLE_BUTTON); record->type(FL_TOGGLE_BUTTON);
record->tooltip("Append scripting command to file options when plugin is run"); 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(new Fl_Box(L1 + L2 + 2 * BH, height - 4 * BH, 10, 10));
win->resizable(resize_box);
win->size_range(width0, height0); win->size_range(width0, height0);
win->position(CTX::instance()->pluginPosition[0], CTX::instance()->pluginPosition[1]); win->position(CTX::instance()->pluginPosition[0], CTX::instance()->pluginPosition[1]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment