From 1c8f6fc7e193b5fadf11b55e82119a8666bd7a07 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Tue, 9 Jan 2001 09:52:17 +0000 Subject: [PATCH] *** empty log message *** --- Fltk/GUI.cpp | 23 +++++++++++++++++++---- Fltk/Main.cpp | 11 +---------- Fltk/Message.cpp | 39 +++++++++++++-------------------------- Parser/OpenFile.cpp | 4 ++-- 4 files changed, 35 insertions(+), 42 deletions(-) diff --git a/Fltk/GUI.cpp b/Fltk/GUI.cpp index b39dd7671d..09b96dd415 100644 --- a/Fltk/GUI.cpp +++ b/Fltk/GUI.cpp @@ -15,6 +15,7 @@ #include "GUI.h" #include "Callbacks.h" #include "Bitmaps.h" +#include "GetOptions.h" extern Context_T CTX; extern List_T *Post_ViewList; @@ -353,8 +354,8 @@ GUI::GUI() { } g_status_label[0] = new Fl_Box(x,502,(700-x)/3,16); - g_status_label[1] = new Fl_Box(x+(700-x)/3,5022,(700-x)/3,16); - g_status_label[2] = new Fl_Box(x+2*(700-x)/3,5022,(700-x)/3-2,16); + g_status_label[1] = new Fl_Box(x+(700-x)/3,502,(700-x)/3,16); + g_status_label[2] = new Fl_Box(x+2*(700-x)/3,502,(700-x)/3-2,16); for(i = 0 ; i<3 ; i++){ g_status_label[i]->box(FL_FLAT_BOX); g_status_label[i]->labelsize(CTX.fontsize); @@ -390,6 +391,13 @@ void GUI::set_anim(int mode){ } } +// Set the status messages + +void GUI::set_status(char *msg, int num){ + g_status_label[num]->label(msg); + g_status_label[num]->redraw(); +} + // Draw the opengl window void GUI::draw_gl(){ @@ -996,7 +1004,6 @@ void GUI::help_short(){ void GUI::help_about(){ static int init_help_about = 0; - extern char TextAbout[1024]; if(!init_help_about){ init_help_about = 1 ; @@ -1012,7 +1019,15 @@ void GUI::help_about(){ about_bmp->label(o); Fl_Button *o2 = new Fl_Button(WB+80, WB, width-2*WB-80, height-2*WB); - o2->label(TextAbout); + + // Text for about window + static char buffer[1024]; + sprintf(buffer, " %s\n \n %s%.2f\n %s\n %s\n %s\n %s\n %s\n %s\n \n %s" + "\n \n Type 'gmsh -help' for command line options", + gmsh_progname, gmsh_version, GMSH_VERSION, + gmsh_os, gmsh_date, gmsh_host, gmsh_packager, + gmsh_url, gmsh_email, gmsh_copyright); + o2->label(buffer); o2->box(FL_FLAT_BOX); o2->labelsize(CTX.fontsize); o2->labelfont(FL_COURIER); diff --git a/Fltk/Main.cpp b/Fltk/Main.cpp index c2d4391707..1e589749fa 100644 --- a/Fltk/Main.cpp +++ b/Fltk/Main.cpp @@ -1,4 +1,4 @@ -// $Id: Main.cpp,v 1.3 2001-01-09 08:58:38 geuzaine Exp $ +// $Id: Main.cpp,v 1.4 2001-01-09 09:52:16 geuzaine Exp $ #include <signal.h> @@ -25,7 +25,6 @@ GUI *WID ; int main(int argc, char *argv[]){ int i, nbf; - extern char TextAbout[1024]; // Gmsh default context options @@ -90,14 +89,6 @@ int main(int argc, char *argv[]){ CTX.interactive = -1 ; // The GUI is not ready yet for interactivity - // Text for about window - - sprintf(TextAbout, " %s\n \n %s%.2f\n %s\n %s\n %s\n %s\n %s\n %s\n \n %s" - "\n \n Type 'gmsh -help' for command line options", - gmsh_progname, gmsh_version, GMSH_VERSION, - gmsh_os, gmsh_date, gmsh_host, gmsh_packager, - gmsh_url, gmsh_email, gmsh_copyright); - // Create the GUI WID = new GUI(); diff --git a/Fltk/Message.cpp b/Fltk/Message.cpp index 1d004cee87..cde787be9a 100644 --- a/Fltk/Message.cpp +++ b/Fltk/Message.cpp @@ -1,4 +1,4 @@ -// $Id: Message.cpp,v 1.1 2001-01-08 08:16:27 geuzaine Exp $ +// $Id: Message.cpp,v 1.2 2001-01-09 09:52:16 geuzaine Exp $ #include <signal.h> #include <sys/resource.h> @@ -7,8 +7,10 @@ #include "GmshUI.h" #include "Version.h" #include "Context.h" +#include "GUI.h" -extern Context_T CTX; +extern GUI *WID; +extern Context_T CTX; /* ------------------------------------------------------------------------ */ /* S i g n a l */ @@ -41,13 +43,10 @@ void Signal (int sig_num){ /* M s g */ /* ------------------------------------------------------------------------ */ -char *TextBuffer, TextAbout[1024]; - #define PUT_IN_COMMAND_WIN \ vfprintf(stderr, fmt, args); \ fprintf(stderr, "\n"); - void Msg(int level, char *fmt, ...){ va_list args; int abort=0; @@ -108,13 +107,9 @@ void Msg(int level, char *fmt, ...){ } } else{ - PUT_IN_COMMAND_WIN ; - /* - vsprintf(TextBuffer, fmt, args); - XtVaSetValues(WID.G.infoLabel, XmNlabelString, - XmStringCreateSimple(TextBuffer), NULL); - XmUpdateDisplay(WID.G.infoLabel); - */ + static char buffer[128]; + vsprintf(buffer, fmt, args); + WID->set_status(buffer, 1) ; } break; case SELECT : @@ -126,13 +121,9 @@ void Msg(int level, char *fmt, ...){ } } else{ - PUT_IN_COMMAND_WIN ; - /* - vsprintf(TextBuffer, fmt, args); - XtVaSetValues(WID.G.selectLabel, XmNlabelString, - XmStringCreateSimple(TextBuffer), NULL); - XmUpdateDisplay(WID.G.selectLabel); - */ + static char buffer[128]; + vsprintf(buffer, fmt, args); + WID->set_status(buffer, 0) ; } break; case STATUS : @@ -144,13 +135,9 @@ void Msg(int level, char *fmt, ...){ } } else{ - PUT_IN_COMMAND_WIN ; - /* - vsprintf(TextBuffer, fmt, args); - XtVaSetValues(WID.G.statusLabel, XmNlabelString, - XmStringCreateSimple(TextBuffer), NULL); - XmUpdateDisplay(WID.G.statusLabel); - */ + static char buffer[128]; + vsprintf(buffer, fmt, args); + WID->set_status(buffer, 2) ; } break; case PARSER_ERROR : diff --git a/Parser/OpenFile.cpp b/Parser/OpenFile.cpp index 61b7b16e77..d8cf5da1bd 100644 --- a/Parser/OpenFile.cpp +++ b/Parser/OpenFile.cpp @@ -1,4 +1,4 @@ -// $Id: OpenFile.cpp,v 1.1 2001-01-08 08:08:47 geuzaine Exp $ +// $Id: OpenFile.cpp,v 1.2 2001-01-09 09:52:17 geuzaine Exp $ #include "Gmsh.h" #include "Const.h" #include "Context.h" @@ -33,7 +33,7 @@ void ParseFile(char *f){ yylineno=1; if(!(yyin = fopen(yyname,"r"))){ - Msg(INFO, "File '%s' Does not Exist", f); + //Msg(INFO, "File '%s' Does not Exist", f); return; } -- GitLab