diff --git a/Fltk/GUI.cpp b/Fltk/GUI.cpp index 56f22c1c70f15de893794a5788e69baf4c14c5f6..8ff60dacf2d6bb2fa9bb034c2918be079691282c 100644 --- a/Fltk/GUI.cpp +++ b/Fltk/GUI.cpp @@ -1,4 +1,4 @@ -// $Id: GUI.cpp,v 1.98 2001-07-31 14:06:16 geuzaine Exp $ +// $Id: GUI.cpp,v 1.99 2001-07-31 18:07:57 geuzaine Exp $ // To make the interface as visually consistent as possible, please: // - use the BH, BW, WB, IW values for button heights/widths, window borders, etc. @@ -1688,14 +1688,32 @@ void GUI::set_statistics(){ sprintf(label[22], "%g/%g", p[8],p[4]); stat_value[22]->value(label[22]); } -/* - A plugin has n options, we also show infos about - the plugin on the top of the window -*/ + +//*********************** Create the window for the plugins ************************* + +void GUI::add_multiline_in_browser(Fl_Browser *o, char* prefix, char *str){ + int start = 0, len; + char *buff; + if(!strlen(str) || !strcmp(str, "\n")){ + o->add(""); + return; + } + for(unsigned int i=0 ; i<strlen(str) ; i++){ + if(i==strlen(str)-1 || str[i]=='\n'){ + len = i-start+(str[i]=='\n'?0:1); + 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; + } + } +} PluginDialogBox * GUI::create_plugin_window(GMSH_Plugin *p, int iView){ char buffer[1024],namep[1024],copyright[256],author[256],help[1024]; - + // get plugin info int n = p->getNbOptions(); @@ -1706,7 +1724,7 @@ PluginDialogBox * GUI::create_plugin_window(GMSH_Plugin *p, int iView){ // create window int width = 20*CTX.fontsize; - int height = (n+2)*BH + 5*WB; + int height = ((n>5?n:5)+2)*BH + 5*WB; PluginDialogBox *pdb = new PluginDialogBox; pdb->main_window = new Fl_Window(width,height); @@ -1742,15 +1760,18 @@ PluginDialogBox * GUI::create_plugin_window(GMSH_Plugin *p, int iView){ g->labelsize(CTX.fontsize); Fl_Browser *o = new Fl_Browser(2*WB, 2*WB+1*BH, width-4*WB, height-5*WB-2*BH); + o->add(""); - o->add(namep); + add_multiline_in_browser(o, "@c@b@.", namep); o->add(""); - o->add(help); + add_multiline_in_browser(o, "", help); o->add(""); - o->add(author); - o->add(copyright); + add_multiline_in_browser(o, "Author(s): ", author); + add_multiline_in_browser(o, "Copyright: ", copyright); o->textsize(CTX.fontsize); + pdb->main_window->resizable(o); + g->end(); } o->end(); diff --git a/Fltk/GUI.h b/Fltk/GUI.h index e269d2647eb21d0db4d8ff1b2329d1975064b231..95a534549e2068f7628b9fc99f1e323a7fed95f4 100644 --- a/Fltk/GUI.h +++ b/Fltk/GUI.h @@ -84,6 +84,7 @@ class GUI{ // Bitmaps Fl_Bitmap *abort_bmp, *start_bmp, *stop_bmp, *about_bmp ; void add_post_plugins ( Fl_Menu_Button *button , int iView); + void add_multiline_in_browser(Fl_Browser *o, char* prefix, char *str); public: diff --git a/Plugin/CutMap.cpp b/Plugin/CutMap.cpp index c9dc37c13be3b0faf02b5d96a4f01970dcd87374..5db2eb0860335fe86778377076ad9755166c1030 100644 --- a/Plugin/CutMap.cpp +++ b/Plugin/CutMap.cpp @@ -1,4 +1,4 @@ -// $Id: CutMap.cpp,v 1.11 2001-07-31 11:13:16 geuzaine Exp $ +// $Id: CutMap.cpp,v 1.12 2001-07-31 18:07:57 geuzaine Exp $ #include "CutMap.h" #include "List.h" @@ -32,7 +32,9 @@ void GMSH_CutMapPlugin::getInfos(char *author, char *copyright, char *help_text) { strcpy(author, "J.-F. Remacle (remacle@scorec.rpi.edu)"); strcpy(copyright, "DGR (www.multiphysics.com)"); - strcpy(help_text, "This Plugins extracts the isovalue surface of value 'Value'"); + strcpy(help_text, + "Extracts the isovalue surface of value 'Value' from a\n" + "3D scalar map. Script name: Plugin(CutMap)."); } int GMSH_CutMapPlugin::getNbOptions() const diff --git a/Plugin/CutPlane.cpp b/Plugin/CutPlane.cpp index b91222a3deeef4096b59448fccfd180e5f1c9735..22c942fa8b34d6aadced1439526be57c136bf910 100644 --- a/Plugin/CutPlane.cpp +++ b/Plugin/CutPlane.cpp @@ -1,4 +1,4 @@ -// $Id: CutPlane.cpp,v 1.9 2001-07-31 11:13:16 geuzaine Exp $ +// $Id: CutPlane.cpp,v 1.10 2001-07-31 18:07:57 geuzaine Exp $ #include "CutPlane.h" #include "List.h" @@ -37,7 +37,10 @@ void GMSH_CutPlanePlugin::getInfos(char *author, char *copyright, char *help_tex { strcpy(author,"J.-F. Remacle (remacle@scorec.rpi.edu)"); strcpy(copyright,"DGR (www.multiphysics.com)"); - strcpy(help_text,"This Plugins cuts a view with a plane a x + b y + c z + d = 0"); + strcpy(help_text, + "Cuts a 3D scalar view view with the plane\n" + "A*X + B*Y + C*Z + D = 0.\n" + "Script name: Plugin(CutPlane)."); } int GMSH_CutPlanePlugin::getNbOptions() const diff --git a/Plugin/CutSphere.cpp b/Plugin/CutSphere.cpp index 4a52991f8adf284ac7630c241998f9c87439b519..152832c89b0f95cf39736175c4c8cea135e5b433 100644 --- a/Plugin/CutSphere.cpp +++ b/Plugin/CutSphere.cpp @@ -1,4 +1,4 @@ -// $Id: CutSphere.cpp,v 1.8 2001-07-31 11:13:16 geuzaine Exp $ +// $Id: CutSphere.cpp,v 1.9 2001-07-31 18:07:57 geuzaine Exp $ #include <string.h> #include "CutSphere.h" @@ -38,8 +38,10 @@ void GMSH_CutSpherePlugin::getInfos(char *author, char *copyright, char *help_te { strcpy(author,"J.-F. Remacle (remacle@scorec.rpi.edu)"); strcpy(copyright,"DGR (www.multiphysics.com)"); - strcpy(help_text, "This Plugins cuts a view with the sphere " - " (x-xc)^2 + (y-yc)^2 + (z-zc)^2 = r^20"); + strcpy(help_text, + "Cuts a 3D scalar view with the sphere\n" + "(X-Xc)^2 + (Y-Yc)^2 + (Z-Zc)^2 = R^2.\n" + "Script name: Plugin(CutSphere)."); } int GMSH_CutSpherePlugin::getNbOptions() const