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

qques retouches esthetiques

parent c7526466
No related branches found
No related tags found
No related merge requests found
// $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,10 +1688,28 @@ 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];
......@@ -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();
......
......@@ -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:
......
// $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
......
// $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
......
// $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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment