diff --git a/Unix/CbFile.cpp b/Unix/CbFile.cpp index ba6b75f68f8b0f382d3598dae0803e9eb4978d9b..8caca2e8cd87bf98273dd1d31680ffbf5f2311b1 100644 --- a/Unix/CbFile.cpp +++ b/Unix/CbFile.cpp @@ -1,4 +1,4 @@ -/* $Id: CbFile.cpp,v 1.9 2000-12-08 10:56:51 geuzaine Exp $ */ +/* $Id: CbFile.cpp,v 1.10 2000-12-08 11:16:55 geuzaine Exp $ */ #include <unistd.h> @@ -147,6 +147,7 @@ void FileCb(Widget w, XtPointer client_data, XtPointer call_data){ case FILE_LOAD_GEOM : OpenProblem(c); Init(); Draw(); break; case FILE_LOAD_POST : MergeProblem(c); ColorBarRedraw(); Init(); Draw(); break; case FILE_SAVE_MESH_AS : Print_Mesh(&M, c, CTX.mesh.format); break; + case FILE_SAVE_OPTIONS_AS : Print_Context(c); break; case FILE_CANCEL : WARNING_OVERRIDE = 0; break; case FILE_PRINT : if(CTX.print.format == FORMAT_GEO) diff --git a/Unix/CbFile.h b/Unix/CbFile.h index 4a79c28fb4d7b8ec4b4a2635aa0d6f697872d98f..9e5d247db93a0a567da8203bba8965ddbd016d24 100644 --- a/Unix/CbFile.h +++ b/Unix/CbFile.h @@ -1,4 +1,4 @@ -/* $Id: CbFile.h,v 1.4 2000-12-08 10:56:51 geuzaine Exp $ */ +/* $Id: CbFile.h,v 1.5 2000-12-08 11:16:55 geuzaine Exp $ */ #ifndef _CB_FILE_H_ #define _CB_FILE_H_ @@ -6,6 +6,7 @@ #define FILE_LOAD_POST 302 #define FILE_SAVE_MESH 304 #define FILE_SAVE_MESH_AS 305 +#define FILE_SAVE_OPTIONS_AS 306 #define FILE_PRINT 307 #define FILE_CANCEL 308 diff --git a/Unix/CbInput.cpp b/Unix/CbInput.cpp index 9267ff88ac1a8d55fd4e491bd38f3f27212981b0..61fee9cc34c62c6a178f593dcfa007ceef2198ff 100644 --- a/Unix/CbInput.cpp +++ b/Unix/CbInput.cpp @@ -1,4 +1,4 @@ -/* $Id: CbInput.cpp,v 1.10 2000-12-05 18:38:11 geuzaine Exp $ */ +/* $Id: CbInput.cpp,v 1.11 2000-12-08 11:16:55 geuzaine Exp $ */ #include "Gmsh.h" #include "GmshUI.h" @@ -155,7 +155,7 @@ void KeyboardAccel(XEvent *event){ break; case XK_S : Modifier = 0 ; - ManageCb(NULL,(XtPointer)WID.FD.saveAsDialog,NULL); + ManageCb(NULL,(XtPointer)WID.FD.saveMeshAsDialog,NULL); break ; case XK_o : case XK_O : Modifier = 0 ; diff --git a/Unix/CbOptions.cpp b/Unix/CbOptions.cpp index c8026d5f695e3696897d355eca2d600b544f96ed..8f37a7fc4a313a2798a91a3e9c8ec32f3f2c0691 100644 --- a/Unix/CbOptions.cpp +++ b/Unix/CbOptions.cpp @@ -1,4 +1,4 @@ -/* $Id: CbOptions.cpp,v 1.11 2000-12-05 19:03:21 geuzaine Exp $ */ +/* $Id: CbOptions.cpp,v 1.12 2000-12-08 11:16:55 geuzaine Exp $ */ #include "Gmsh.h" #include "GmshUI.h" @@ -126,7 +126,7 @@ void OptionsCb (Widget w, XtPointer client_data, XtPointer call_data){ CTX.r[0],CTX.r[1],CTX.r[2], CTX.t[0],CTX.t[1],CTX.t[2], CTX.s[0],CTX.s[1],CTX.s[2]); - Print_Context(stderr); + Print_Context(NULL); break ; /* print */ diff --git a/Unix/Geometry.cpp b/Unix/Geometry.cpp index 7e4e70e77edc7978c330ec7fb51cabcc393a668c..3bb6fb20b5f805c7ef44d8bb89e911fe6f14d016 100644 --- a/Unix/Geometry.cpp +++ b/Unix/Geometry.cpp @@ -1,4 +1,4 @@ -/* $Id: Geometry.cpp,v 1.4 2000-12-08 10:56:51 geuzaine Exp $ */ +/* $Id: Geometry.cpp,v 1.5 2000-12-08 11:16:55 geuzaine Exp $ */ #include "Gmsh.h" #include "GmshUI.h" @@ -261,25 +261,30 @@ void ForceGeometry_FD (Widgets_T *w){ XmNmarginWidth, DIALOG_W, NULL); - XtVaSetValues(w->FD.saveAsDialog, + XtVaSetValues(w->FD.saveMeshAsDialog, XmNmarginHeight, DIALOG_H, XmNmarginWidth, DIALOG_W, NULL); - XtVaSetValues(w->FD.saveAsFrame[0], + XtVaSetValues(w->FD.saveMeshAsFrame[0], XmNshadowType, IN_FRAME_TYPE, XmNshadowThickness, IN_FRAME_SHADOW, NULL); - XtVaSetValues(w->FD.saveAsFrame[1], + XtVaSetValues(w->FD.saveMeshAsFrame[1], XmNchildHorizontalSpacing, TITLE_SPACE, XmNchildVerticalAlignment, TITLE_ALIGN, NULL); - XtVaSetValues(w->FD.saveAsRowCol, + XtVaSetValues(w->FD.saveMeshAsRowCol, XmNmarginWidth, 0, NULL); + XtVaSetValues(w->FD.saveOptionsAsDialog, + XmNmarginHeight, DIALOG_H, + XmNmarginWidth, DIALOG_W, + NULL); + XtVaSetValues(w->FD.printDialog, XmNmarginHeight, DIALOG_H, XmNmarginWidth, DIALOG_W, diff --git a/Unix/Main.cpp b/Unix/Main.cpp index ca86c0292829e0ad340694f7856660a25a5c66d8..88f29c302bff97eb5904fc6623eff29791fef82c 100644 --- a/Unix/Main.cpp +++ b/Unix/Main.cpp @@ -1,4 +1,4 @@ -/* $Id: Main.cpp,v 1.22 2000-12-08 10:56:51 geuzaine Exp $ */ +/* $Id: Main.cpp,v 1.23 2000-12-08 11:16:55 geuzaine Exp $ */ #include <signal.h> @@ -43,7 +43,7 @@ char gmsh_email[] = "E-Mail : Christophe.Geuzaine@ulg.ac.be\n" char gmsh_help[] = "Usage: %s [options] [files]\n" "Geometry options:\n" - " -0 output current options, flattened geometry and exit\n" + " -0 output flattened geometry and exit\n" "Mesh options:\n" " -1, -2, -3 perform batch 1D, 2D and 3D mesh generation\n" " -script gmsh in script mode\n" diff --git a/Unix/Register.cpp b/Unix/Register.cpp index 02ce88ff7ba9f65af2637b1297813e3a35ea5086..c0d1645fb65713eb3e43da1fe89da1363656580c 100644 --- a/Unix/Register.cpp +++ b/Unix/Register.cpp @@ -1,4 +1,4 @@ -/* $Id: Register.cpp,v 1.11 2000-12-08 10:56:51 geuzaine Exp $ */ +/* $Id: Register.cpp,v 1.12 2000-12-08 11:16:55 geuzaine Exp $ */ #include "Gmsh.h" #include "GmshUI.h" @@ -23,11 +23,12 @@ void RegisterCallbacks_M(Widgets_T *w){ register_activate_cb (w->M.fileButt[0], ManageCb, w->FD.openDialog); register_activate_cb (w->M.fileButt[1], ManageCb, w->FD.mergeDialog); register_activate_cb (w->M.fileButt[2], FileCb, FILE_SAVE_MESH); - register_activate_cb (w->M.fileButt[3], ManageCb, w->FD.saveAsDialog); - register_activate_cb (w->M.fileButt[4], ManageCb, w->FD.printDialog); - register_activate_cb (w->M.fileButt[5], ReloadAllViewsCb, NULL); - register_activate_cb (w->M.fileButt[6], RemoveAllViewsCb, NULL); - register_activate_cb (w->M.fileButt[7], ExitCb, NULL); + register_activate_cb (w->M.fileButt[3], ManageCb, w->FD.saveMeshAsDialog); + register_activate_cb (w->M.fileButt[4], ManageCb, w->FD.saveOptionsAsDialog); + register_activate_cb (w->M.fileButt[5], ManageCb, w->FD.printDialog); + register_activate_cb (w->M.fileButt[6], ReloadAllViewsCb, NULL); + register_activate_cb (w->M.fileButt[7], RemoveAllViewsCb, NULL); + register_activate_cb (w->M.fileButt[8], ExitCb, NULL); register_activate_cb (w->M.moduleButt[0], ActualizeContextCb, CONTEXT_GEOM); register_activate_cb (w->M.moduleButt[1], ActualizeContextCb, CONTEXT_MESH); @@ -135,11 +136,14 @@ void RegisterCallbacks_FD(Widgets_T *w){ register_ok_cb (w->FD.mergeDialog, FileCb, FILE_LOAD_POST); register_cancel_cb (w->FD.mergeDialog, ManageCb, w->FD.mergeDialog); - register_ok_cb (w->FD.saveAsDialog, FileCb, FILE_SAVE_MESH_AS); - register_cancel_cb (w->FD.saveAsDialog, ManageCb, w->FD.saveAsDialog); - register_activate_cb (w->FD.saveAsButt[0], OptionsCb, OPTIONS_MESH_FORMAT_MSH); - register_activate_cb (w->FD.saveAsButt[1], OptionsCb, OPTIONS_MESH_FORMAT_UNV); - register_activate_cb (w->FD.saveAsButt[2], OptionsCb, OPTIONS_MESH_FORMAT_GREF); + register_ok_cb (w->FD.saveMeshAsDialog, FileCb, FILE_SAVE_MESH_AS); + register_cancel_cb (w->FD.saveMeshAsDialog, ManageCb, w->FD.saveMeshAsDialog); + register_activate_cb (w->FD.saveMeshAsButt[0], OptionsCb, OPTIONS_MESH_FORMAT_MSH); + register_activate_cb (w->FD.saveMeshAsButt[1], OptionsCb, OPTIONS_MESH_FORMAT_UNV); + register_activate_cb (w->FD.saveMeshAsButt[2], OptionsCb, OPTIONS_MESH_FORMAT_GREF); + + register_ok_cb (w->FD.saveOptionsAsDialog, FileCb, FILE_SAVE_OPTIONS_AS); + register_cancel_cb (w->FD.saveOptionsAsDialog, ManageCb, w->FD.saveOptionsAsDialog); register_ok_cb (w->FD.printDialog, FileCb, FILE_PRINT); register_cancel_cb (w->FD.printDialog, ManageCb, w->FD.printDialog); diff --git a/Unix/Widgets.cpp b/Unix/Widgets.cpp index 6762d0f2450f72f51d00c723590d63c02dad2c14..950eb6897b05e8b0368cf10a596b367e92066195 100644 --- a/Unix/Widgets.cpp +++ b/Unix/Widgets.cpp @@ -1,4 +1,4 @@ -/* $Id: Widgets.cpp,v 1.16 2000-12-08 10:56:51 geuzaine Exp $ */ +/* $Id: Widgets.cpp,v 1.17 2000-12-08 11:16:55 geuzaine Exp $ */ #include "Gmsh.h" #include "GmshUI.h" @@ -92,12 +92,17 @@ void CreateWidgets_M(Widgets_T *w){ w->M.fileButt[3] = XmCreatePushButton(w->M.filePane, "MfileButt3", arg, i); XtManageChild(w->M.fileButt[3]); + i=0; + XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Save Options as")); i++; + w->M.fileButt[4] = XmCreatePushButton(w->M.filePane, "MfileButt4", arg, i); + XtManageChild(w->M.fileButt[4]); + i=0; XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Print")); i++; XtSetArg(arg[i], XmNacceleratorText, XmStringCreateSimple("(C-p)")); i++; XtSetArg(arg[i], XmNaccelerator, "Ctrl<Key>p:"); i++; - w->M.fileButt[4] = XmCreatePushButton(w->M.filePane, "MfileButt4", arg, i); - XtManageChild(w->M.fileButt[4]); + w->M.fileButt[5] = XmCreatePushButton(w->M.filePane, "MfileButt5", arg, i); + XtManageChild(w->M.fileButt[5]); i=0; w->M.fileSep[1] = XmCreateSeparator(w->M.filePane, "MfileSep1", arg, i); @@ -107,15 +112,15 @@ void CreateWidgets_M(Widgets_T *w){ XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Reload All Views")); i++; XtSetArg(arg[i], XmNacceleratorText, XmStringCreateSimple("(C-l)")); i++; XtSetArg(arg[i], XmNaccelerator, "Ctrl<Key>l:"); i++; - w->M.fileButt[5] = XmCreatePushButton(w->M.filePane, "MfileButt5", arg, i); - XtManageChild(w->M.fileButt[5]); + w->M.fileButt[6] = XmCreatePushButton(w->M.filePane, "MfileButt6", arg, i); + XtManageChild(w->M.fileButt[6]); i=0; XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Remove All Views")); i++; XtSetArg(arg[i], XmNacceleratorText, XmStringCreateSimple("(C-r)")); i++; XtSetArg(arg[i], XmNaccelerator, "Ctrl<Key>r:"); i++; - w->M.fileButt[6] = XmCreatePushButton(w->M.filePane, "MfileButt6", arg, i); - XtManageChild(w->M.fileButt[6]); + w->M.fileButt[7] = XmCreatePushButton(w->M.filePane, "MfileButt7", arg, i); + XtManageChild(w->M.fileButt[7]); i=0; w->M.fileSep[2] = XmCreateSeparator(w->M.filePane, "MfileSep2", arg, i); @@ -125,8 +130,8 @@ void CreateWidgets_M(Widgets_T *w){ XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Quit")); i++; XtSetArg(arg[i], XmNacceleratorText, XmStringCreateSimple("(C-q)")); i++; XtSetArg(arg[i], XmNaccelerator, "Ctrl<Key>q:"); i++; - w->M.fileButt[7] = XmCreatePushButton(w->M.filePane, "MfileButt7", arg, i); - XtManageChild(w->M.fileButt[7]); + w->M.fileButt[8] = XmCreatePushButton(w->M.filePane, "MfileButt8", arg, i); + XtManageChild(w->M.fileButt[8]); i=0; XtSetArg(arg[i], XmNsubMenuId, w->M.filePane); i++; @@ -594,50 +599,59 @@ void CreateWidgets_FD(Widgets_T *w){ w->FD.mergeDialog = XmCreateFileSelectionDialog(w->M.shell, "FDmergeDialog", arg, i); XtUnmanageChild(w->FD.mergeDialog); - /* save as */ + /* save mesh as */ i=0 ; XtSetArg(arg[i], XmNdialogTitle, XmStringCreateSimple("Save")); i++; XtSetArg(arg[i], XmNnoMatchString, XmStringCreateSimple("[ NONE ]")); i++; XtSetArg(arg[i], XmNdirMask, XmStringCreateSimple("*")); i++; XtSetArg(arg[i], XmNautoUnmanage, True); i++; - w->FD.saveAsDialog = XmCreateFileSelectionDialog(w->M.shell, "FDsaveAsDialog", arg, i); - XtUnmanageChild(w->FD.saveAsDialog); + w->FD.saveMeshAsDialog = XmCreateFileSelectionDialog(w->M.shell, "FDsaveMeshAsDialog", arg, i); + XtUnmanageChild(w->FD.saveMeshAsDialog); i=0; - w->FD.saveAsFrame[0] = XmCreateFrame(w->FD.saveAsDialog, "FDsaveFrame0", arg, i); - XtManageChild(w->FD.saveAsFrame[0]); + w->FD.saveMeshAsFrame[0] = XmCreateFrame(w->FD.saveMeshAsDialog, "FDsaveFrame0", arg, i); + XtManageChild(w->FD.saveMeshAsFrame[0]); i=0; XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Format")); i++; XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->FD.saveAsFrame[1] = XmCreateLabel(w->FD.saveAsFrame[0], "FDsaveAsFrame1", arg, i); - XtManageChild(w->FD.saveAsFrame[1]); + w->FD.saveMeshAsFrame[1] = XmCreateLabel(w->FD.saveMeshAsFrame[0], "FDsaveMeshAsFrame1", arg, i); + XtManageChild(w->FD.saveMeshAsFrame[1]); i=0 ; XtSetArg(arg[i], XmNorientation, XmHORIZONTAL); i++; XtSetArg(arg[i], XmNspacing, 0); i++; - w->FD.saveAsRowCol = XmCreateRowColumn(w->FD.saveAsFrame[0], "FDsaveAsRowCol", arg, i); - XtManageChild(w->FD.saveAsRowCol); + w->FD.saveMeshAsRowCol = XmCreateRowColumn(w->FD.saveMeshAsFrame[0], "FDsaveMeshAsRowCol", arg, i); + XtManageChild(w->FD.saveMeshAsRowCol); i=0; - w->FD.saveAsPane = XmCreatePulldownMenu(w->FD.saveAsRowCol, "FDsaveAsPane", arg, i); + w->FD.saveMeshAsPane = XmCreatePulldownMenu(w->FD.saveMeshAsRowCol, "FDsaveMeshAsPane", arg, i); i=0; XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Gmsh [.msh]")); i++; - w->FD.saveAsButt[0] = XmCreatePushButton(w->FD.saveAsPane, "MsaveAsButt0", arg, i); - XtManageChild(w->FD.saveAsButt[0]); + w->FD.saveMeshAsButt[0] = XmCreatePushButton(w->FD.saveMeshAsPane, "MsaveMeshAsButt0", arg, i); + XtManageChild(w->FD.saveMeshAsButt[0]); i=0; XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Ideas universal [.unv]")); i++; - w->FD.saveAsButt[1] = XmCreatePushButton(w->FD.saveAsPane, "MsaveAsButt1", arg, i); - XtManageChild(w->FD.saveAsButt[1]); + w->FD.saveMeshAsButt[1] = XmCreatePushButton(w->FD.saveMeshAsPane, "MsaveMeshAsButt1", arg, i); + XtManageChild(w->FD.saveMeshAsButt[1]); i=0; XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Gref [.Gref]")); i++; - w->FD.saveAsButt[2] = XmCreatePushButton(w->FD.saveAsPane, "MsaveAsButt2", arg, i); - XtManageChild(w->FD.saveAsButt[2]); + w->FD.saveMeshAsButt[2] = XmCreatePushButton(w->FD.saveMeshAsPane, "MsaveMeshAsButt2", arg, i); + XtManageChild(w->FD.saveMeshAsButt[2]); i=0; - XtSetArg(arg[i], XmNsubMenuId, w->FD.saveAsPane); i++; + XtSetArg(arg[i], XmNsubMenuId, w->FD.saveMeshAsPane); i++; XtSetArg(arg[i], XmNspacing, 0); i++; - w->FD.saveAsMenu = XmCreateOptionMenu(w->FD.saveAsRowCol, "FDsaveAsMenu", arg, i); - XtManageChild(w->FD.saveAsMenu); + w->FD.saveMeshAsMenu = XmCreateOptionMenu(w->FD.saveMeshAsRowCol, "FDsaveMeshAsMenu", arg, i); + XtManageChild(w->FD.saveMeshAsMenu); + + /* save options as */ + i=0 ; + XtSetArg(arg[i], XmNdialogTitle, XmStringCreateSimple("Save Options")); i++; + XtSetArg(arg[i], XmNnoMatchString, XmStringCreateSimple("[ NONE ]")); i++; + XtSetArg(arg[i], XmNdirMask, XmStringCreateSimple("*.[gp][eo][os]")); i++; + XtSetArg(arg[i], XmNautoUnmanage, True); i++; + w->FD.saveOptionsAsDialog = XmCreateFileSelectionDialog(w->M.shell, "FDsaveOptionsAsDialog", arg, i); + XtUnmanageChild(w->FD.saveOptionsAsDialog); /* print */ i=0 ; @@ -699,7 +713,9 @@ void CreateWidgets_FD(Widgets_T *w){ XtUnmanageChild(tmp); tmp = XmFileSelectionBoxGetChild(w->FD.mergeDialog, XmDIALOG_HELP_BUTTON); XtUnmanageChild(tmp); - tmp = XmFileSelectionBoxGetChild(w->FD.saveAsDialog, XmDIALOG_HELP_BUTTON); + tmp = XmFileSelectionBoxGetChild(w->FD.saveMeshAsDialog, XmDIALOG_HELP_BUTTON); + XtUnmanageChild(tmp); + tmp = XmFileSelectionBoxGetChild(w->FD.saveOptionsAsDialog, XmDIALOG_HELP_BUTTON); XtUnmanageChild(tmp); tmp = XmFileSelectionBoxGetChild(w->FD.printDialog, XmDIALOG_HELP_BUTTON); XtUnmanageChild(tmp); diff --git a/Unix/Widgets.h b/Unix/Widgets.h index 0dc951466888e83803a8bce25f7025bd84bed02b..54106ae7893c13924fccd7169ee3a7e73f4e81fc 100644 --- a/Unix/Widgets.h +++ b/Unix/Widgets.h @@ -1,4 +1,4 @@ -/* $Id: Widgets.h,v 1.7 2000-12-08 10:56:51 geuzaine Exp $ */ +/* $Id: Widgets.h,v 1.8 2000-12-08 11:16:55 geuzaine Exp $ */ #ifndef _WIDGETS_H_ #define _WIDGETS_H_ @@ -19,7 +19,7 @@ typedef struct { struct { Widget shell, containerWin ; Widget menuBar ; - Widget fileCascade, filePane, fileButt[8], fileSep[3] ; + Widget fileCascade, filePane, fileButt[10], fileSep[3] ; Widget moduleCascade, modulePane, moduleButt[3] ; Widget optionCascade, optionPane, optionButt[6], optionSep[2] ; Widget helpCascade, helpPane, helpButt[2], helpSep[1] ; @@ -75,9 +75,10 @@ typedef struct { struct { Widget openDialog ; Widget mergeDialog ; - Widget saveAsDialog ; - Widget saveAsFrame[2], saveAsRowCol ; - Widget saveAsPane, saveAsButt[3], saveAsMenu ; + Widget saveMeshAsDialog ; + Widget saveMeshAsFrame[2], saveMeshAsRowCol ; + Widget saveMeshAsPane, saveMeshAsButt[3], saveMeshAsMenu ; + Widget saveOptionsAsDialog ; Widget printDialog ; Widget printFrame[2], printRowCol ; Widget printPane[3], printButt[13], printMenu[3] ;