From c5071aaa2d6d00310b26683d75fe83f9fdaab6e6 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Fri, 4 May 2001 20:16:37 +0000 Subject: [PATCH] *** empty log message *** --- Common/Options.cpp | 4 ++-- Fltk/Callbacks.cpp | 7 ++++++- Fltk/Callbacks.h | 1 + Fltk/GUI.cpp | 32 +++++++++++++++++++------------- Fltk/Socket.cpp | 4 ++-- Fltk/Solvers.h | 2 +- 6 files changed, 31 insertions(+), 19 deletions(-) diff --git a/Common/Options.cpp b/Common/Options.cpp index 6e868fc3fc..a83c107343 100644 --- a/Common/Options.cpp +++ b/Common/Options.cpp @@ -1,4 +1,4 @@ -// $Id: Options.cpp,v 1.15 2001-05-04 13:42:09 geuzaine Exp $ +// $Id: Options.cpp,v 1.16 2001-05-04 20:16:37 geuzaine Exp $ #include "Gmsh.h" #include "GmshUI.h" @@ -458,7 +458,7 @@ char * opt_general_editor(OPT_ARGS_STR){ } char * opt_solver_getdp_command(OPT_ARGS_STR){ - if(action & GMSH_SET) GetDP_Info.command = val; + if(action & GMSH_SET) strcpy(GetDP_Info.command, val); #ifdef _FLTK if(WID && (action & GMSH_GUI)) WID->getdp_input[0]->value(GetDP_Info.command); diff --git a/Fltk/Callbacks.cpp b/Fltk/Callbacks.cpp index 38451994b9..d074bb2196 100644 --- a/Fltk/Callbacks.cpp +++ b/Fltk/Callbacks.cpp @@ -1,4 +1,4 @@ -// $Id: Callbacks.cpp,v 1.49 2001-05-04 13:39:34 geuzaine Exp $ +// $Id: Callbacks.cpp,v 1.50 2001-05-04 20:16:37 geuzaine Exp $ #include <map> #include "Gmsh.h" @@ -1372,6 +1372,11 @@ void getdp_post_cb(CALLBACK_ARGS){ GetDP_Info.postop[WID->getdp_choice[1]->value()]); GetDP(arg); } +void getdp_choose_command_cb(CALLBACK_ARGS){ + char *newfile; + newfile = fl_file_chooser("Choose executable", "*", NULL); + if (newfile != NULL) WID->getdp_input[0]->value(newfile); +} void getdp_ok_cb(CALLBACK_ARGS){ opt_solver_getdp_popupmessages(0, GMSH_SET, WID->getdp_butt[0]->value()); opt_solver_getdp_mergeviews(0, GMSH_SET, WID->getdp_butt[1]->value()); diff --git a/Fltk/Callbacks.h b/Fltk/Callbacks.h index 3daef2575d..bdf822681e 100644 --- a/Fltk/Callbacks.h +++ b/Fltk/Callbacks.h @@ -190,6 +190,7 @@ void getdp_choose_mesh_cb(CALLBACK_ARGS); void getdp_pre_cb(CALLBACK_ARGS); void getdp_cal_cb(CALLBACK_ARGS); void getdp_post_cb(CALLBACK_ARGS); +void getdp_choose_command_cb(CALLBACK_ARGS); void getdp_ok_cb(CALLBACK_ARGS); // Dynamic post menus diff --git a/Fltk/GUI.cpp b/Fltk/GUI.cpp index 7bb203ae88..91d9491c85 100644 --- a/Fltk/GUI.cpp +++ b/Fltk/GUI.cpp @@ -1,4 +1,4 @@ -// $Id: GUI.cpp,v 1.67 2001-05-04 13:42:09 geuzaine Exp $ +// $Id: GUI.cpp,v 1.68 2001-05-04 20:16:37 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. @@ -2360,19 +2360,19 @@ void GUI::create_getdp_window(){ g[0] = new Fl_Group(WB, WB+BH, width-2*WB, height-3*WB-2*BH, "General"); g[0]->labelsize(CTX.fontsize); - getdp_value[0] = new Fl_Output(8*CTX.fontsize, 2*WB+1*BH, BW, BH, "Problem"); - Fl_Button *b1 = new Fl_Button(8*CTX.fontsize+BW-2*BB-WB, 3*WB+2*BH, BB, BH, "Edit"); - b1->callback(getdp_file_edit_cb); + getdp_value[0] = new Fl_Output(2*WB, 2*WB+1*BH, BW, BH, "Problem"); + Fl_Button *b1 = new Fl_Button(2*WB, 3*WB+2*BH, BB, BH, "Choose"); + b1->callback(getdp_file_open_cb); b1->labelsize(CTX.fontsize); - Fl_Button *b2 = new Fl_Button(8*CTX.fontsize+BW-BB, 3*WB+2*BH, BB, BH, "Choose"); - b2->callback(getdp_file_open_cb); + Fl_Button *b2 = new Fl_Button(3*WB+BB, 3*WB+2*BH, BB, BH, "Edit"); + b2->callback(getdp_file_edit_cb); b2->labelsize(CTX.fontsize); - getdp_choice[0] = new Fl_Choice(8*CTX.fontsize, 4*WB+3*BH, BW, BH,"Resolution"); - getdp_choice[1] = new Fl_Choice(8*CTX.fontsize, 5*WB+4*BH, BW, BH,"PostOperation"); + getdp_choice[0] = new Fl_Choice(2*WB, 4*WB+3*BH, BW, BH,"Resolution"); + getdp_choice[1] = new Fl_Choice(2*WB, 5*WB+4*BH, BW, BH,"PostOperation"); - getdp_value[1] = new Fl_Output(8*CTX.fontsize, 6*WB+5*BH, BW, BH, "Mesh"); - Fl_Button *b3 = new Fl_Button(8*CTX.fontsize+BW-BB, 7*WB+6*BH, BB, BH, "Choose"); + getdp_value[1] = new Fl_Output(2*WB, 6*WB+5*BH, BW, BH, "Mesh"); + Fl_Button *b3 = new Fl_Button(2*WB, 7*WB+6*BH, BB, BH, "Choose"); b3->callback(getdp_choose_mesh_cb); b3->labelsize(CTX.fontsize); @@ -2380,12 +2380,13 @@ void GUI::create_getdp_window(){ getdp_value[i]->labelsize(CTX.fontsize); getdp_value[i]->textsize(CTX.fontsize); getdp_value[i]->type(FL_HORIZONTAL); - getdp_value[i]->align(FL_ALIGN_LEFT); + getdp_value[i]->align(FL_ALIGN_RIGHT); getdp_value[i]->value(0); } for(i=0 ; i<2 ; i++){ getdp_choice[i]->textsize(CTX.fontsize); getdp_choice[i]->labelsize(CTX.fontsize); + getdp_choice[i]->align(FL_ALIGN_RIGHT); } g[0]->end(); @@ -2398,9 +2399,14 @@ void GUI::create_getdp_window(){ getdp_input[0]->labelsize(CTX.fontsize); getdp_input[0]->textsize(CTX.fontsize); getdp_input[0]->align(FL_ALIGN_RIGHT); + Fl_Button *b = new Fl_Button(2*WB, 3*WB+2*BH, BB, BH, "Choose"); + b->callback(getdp_choose_command_cb); + b->labelsize(CTX.fontsize); - getdp_butt[0] = new Fl_Check_Button(2*WB, 2*WB+2*BH, BW, BH, "Popup message window"); - getdp_butt[1] = new Fl_Check_Button(2*WB, 2*WB+3*BH, BW, BH, "Open post-processing views"); + getdp_butt[0] = new Fl_Check_Button(2*WB, 4*WB+3*BH, BW, BH, + "Automatic message display"); + getdp_butt[1] = new Fl_Check_Button(2*WB, 4*WB+4*BH, BW, BH, + "Automatic view merge"); for(i=0 ; i<2 ; i++){ getdp_butt[i]->type(FL_TOGGLE_BUTTON); getdp_butt[i]->down_box(FL_DOWN_BOX); diff --git a/Fltk/Socket.cpp b/Fltk/Socket.cpp index b1ab0b913c..e37b672e88 100644 --- a/Fltk/Socket.cpp +++ b/Fltk/Socket.cpp @@ -1,4 +1,4 @@ -/* $Id: Socket.cpp,v 1.5 2001-05-04 11:53:01 geuzaine Exp $ */ +/* $Id: Socket.cpp,v 1.6 2001-05-04 20:16:37 geuzaine Exp $ */ #include <stdio.h> #include <stdlib.h> @@ -168,7 +168,7 @@ int Socket_Connect(char *sockname){ int len, sock; int tries; - /* slight delay to be sure that the socket gets created by the + /* slight delay to be sure that the socket is bind by the server before we attempt to connect to it... */ Socket_Idle(0.1); diff --git a/Fltk/Solvers.h b/Fltk/Solvers.h index f717733657..9b7743dbc3 100644 --- a/Fltk/Solvers.h +++ b/Fltk/Solvers.h @@ -11,7 +11,7 @@ #define GETDP_LOAD_VIEW 5 typedef struct{ - char *command; + char command[256]; int popupmessages, mergeviews; int nbres, nbpostop; char res[100][100]; -- GitLab