/*********************************************************************** * * ***** *** *** * * * * * * * * *** *** * * * * * * * ***** *** *** * * A FREE Finite Elements Analysis Program in ANSI C for the UNIX OS. * * Composed and edited and copyright by * Professor Dr.-Ing. Frank Rieg, University of Bayreuth, Germany * * eMail: * frank.rieg@uni-bayreuth.de * dr.frank.rieg@t-online.de * * V10.1 December 12, 2003 * * Z88 should compile and run under any UNIX OS and Motif 2.0. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. ***********************************************************************/ /*********************************************************************** * ale88o gibt Alert-Boxen aus (1 int) * Fuer UNIX * 2.2.2004 Rieg ***********************************************************************/ /*********************************************************************** * UNIX ***********************************************************************/ #ifdef FR_UNIX #include #include #endif /*********************************************************************** * Functions, speziell fuer X11 ***********************************************************************/ void CB_OK(Widget hcallw,XtPointer data,XmPushButtonCallbackStruct *cbs); /*********************************************************************** * hier beginnt Function ale88o ***********************************************************************/ int ale88o(int ialert) { extern Widget hform; extern FR_INT4 LANG; extern int IBELL; extern char CF_ENTRIES[], CF_BUTTONS[],CF_GRAFICS[]; extern char CO_BACKGR[], CO_FOREGR[], CO_ENTRIES[]; Widget halert; Arg args[40]; Cardinal n; XmString cxstring = NULL; int idiag; char cmess[256]; switch(ialert) { case AL_NOLOG: if(LANG == 1) strcpy(cmess,"Kann Z88O.LOG nicht oeffnen ! STOP !"); if(LANG == 2) strcpy(cmess,"Cannot open Z88O.LOG ! STOP !"); idiag= 1; break; case AL_NODYN: if(LANG == 1) strcpy(cmess,"Kann Z88.DYN nicht oeffnen ! STOP !"); if(LANG == 2) strcpy(cmess,"Cannot open Z88.DYN ! STOP !"); idiag= 1; break; case AL_WRONGDYN: if(LANG == 1) strcpy(cmess,"Z88.DYN ist falsch ! STOP !"); if(LANG == 2) strcpy(cmess,"Z88.DYN is wrong ! STOP !"); idiag= 1; break; case AL_NOMEMY: if(LANG == 1) strcpy(cmess,"Nicht genug dynamischer Speicher ! STOP !\n\ Abhilfe: Eintraege in Z88.DYN erhoehen."); if(LANG == 2) strcpy(cmess,"Dynamic memory exhausted ! STOP !\n\ Recover: increase entries in Z88.DYN ."); idiag= 1; break; case AL_NOSTRFI: if(LANG == 1) strcpy(cmess,"Strukturfile nicht gefunden !\n\ Anderes Strukturfile im Textfeld *Strukturfile* angeben."); if(LANG == 2) strcpy(cmess,"Structure file not found !\n\ Enter a valid filename in textfield *Structure File*."); idiag= 2; break; case AL_NOO2: if(LANG == 1) strcpy(cmess,"Z88O2.TXT nicht gefunden !\n\ Daher keine Anzeige der verformten Struktur.\n\ Zuerst Verformungsrechnung mit Z88F."); if(LANG == 2) strcpy(cmess,"Z88O2.TXT not found !\n\ Thus no view of deflected structure.\n\ Start a solver run with Z88F first."); idiag= 2; break; case AL_NOO8: if(LANG == 1) strcpy(cmess,"Z88O8.TXT nicht gefunden !\n\ Daher keine Anzeige der Vergleichsspannungen.\n\ Zuerst Spannungsberechnung mit Z88D8"); if(LANG == 2) strcpy(cmess,"Z88O8.TXT not found !\n\ Thus no view of von Mises stresses.\n\ Start a stress computation with Z88D"); idiag= 2; break; case AL_EXMAXK: if(LANG == 1) strcpy(cmess,"Speicher fuer Knoten ueberschritten ! STOP !\n\ Abhilfe: MAXK oder MFACCOMMON in Z88.DYN erhoehen."); if(LANG == 2) strcpy(cmess,"Memory for nodes exhausted ! STOP !\n\ Recover: increase MAXK or MFACCOMMON in Z88.DYN ."); idiag= 1; break; case AL_EXMAXE: if(LANG == 1) strcpy(cmess,"Speicher fuer Elemente ueberschritten !\n\ STOP ! Abhilfe: MAXE oder MFACCOMMON in Z88.DYN erhoehen."); if(LANG == 2) strcpy(cmess,"Memory for elements exhausted ! STOP !\n\ Recover: increase MAXE or MFACCOMMON in Z88.DYN ."); idiag= 1; break; case AL_WRONGDIM: if(LANG == 1) strcpy(cmess,"Falsche Dimension im Structurfile ! STOP !\n\ Abhilfe: Im Strukturfile 2 oder 3 fuer Dimension waehlen."); if(LANG == 2) strcpy(cmess,"Wrong dimension in structur file ! STOP !\n\ Recover: enter 2 or 3 for dimension in structure file."); idiag= 1; break; case AL_NO_CF_ENTRIES: if(LANG == 1) sprintf(cmess,"Font <%s> in Z88.FCD\nunbekannt in X ! STOP !\n\ Abhilfe: Einen anderen Font waehlen.",CF_ENTRIES); if(LANG == 2) sprintf(cmess,"Font <%s> in Z88.FCD\nunknown in X ! STOP !\n\ Recover: Choose an existing font.",CF_ENTRIES); idiag= 1; break; case AL_NO_CF_BUTTONS: if(LANG == 1) sprintf(cmess,"Font <%s> in Z88.FCD\nunbekannt in X ! STOP !\n\ Abhilfe: Einen anderen Font waehlen.",CF_BUTTONS); if(LANG == 2) sprintf(cmess,"Font <%s> in Z88.FCD\nunknown in X ! STOP !\n\ Recover: Choose an existing font.",CF_BUTTONS); idiag= 1; break; case AL_NO_CF_GRAFICS: if(LANG == 1) sprintf(cmess,"Font <%s> in Z88.FCD\nunbekannt in X ! STOP !\n\ Abhilfe: Einen anderen Font waehlen.",CF_GRAFICS); if(LANG == 2) sprintf(cmess,"Font <%s> in Z88.FCD\nunknown in X ! STOP !\n\ Recover: Choose an existing font.",CF_GRAFICS); idiag= 1; break; case AL_NO_CO_BACKGR: if(LANG == 1) sprintf(cmess,"Farbe <%s> in Z88.FCD unbekannt in X ! STOP !\n\ Abhilfe: Eine andere Farbe waehlen.",CO_BACKGR); if(LANG == 2) sprintf(cmess,"Color <%s> in Z88.FCD unknown in X ! STOP !\n\ Recover: Choose an existing color.",CO_BACKGR); idiag= 1; break; case AL_NO_CO_FOREGR: if(LANG == 1) sprintf(cmess,"Farbe <%s> in Z88.FCD unbekannt in X ! STOP !\n\ Abhilfe: Eine andere Farbe waehlen.",CO_FOREGR); if(LANG == 2) sprintf(cmess,"Color <%s> in Z88.FCD unknown in X ! STOP !\n\ Recover: Choose an existing color.",CO_FOREGR); idiag= 1; break; case AL_NO_CO_ENTRIES: if(LANG == 1) sprintf(cmess,"Farbe <%s> in Z88.FCD unbekannt in X ! STOP !\n\ Abhilfe: Eine andere Farbe waehlen.",CO_ENTRIES); if(LANG == 2) sprintf(cmess,"Color <%s> in Z88.FCD unknown in X ! STOP !\n\ Recover: Choose an existing color.",CO_ENTRIES); idiag= 1; break; case AL_NO_GLX: if(LANG == 1) strcpy(cmess,"Kann GLX-Grafikkontext nicht oeffnen ! STOP !"); if(LANG == 2) strcpy(cmess,"Cannot open GLX Grafics Context ! STOP !"); idiag= 1; break; } /*---------------------------------------------------------------------- * nun die Questionbox *---------------------------------------------------------------------*/ n = 0; XtSetArg(args[n], XmNautoUnmanage, TRUE); n++; XtSetArg(args[n], XmNdialogStyle, XmDIALOG_FULL_APPLICATION_MODAL); n++; cxstring = XmStringCreateLtoR(cmess, XmFONTLIST_DEFAULT_TAG); XtSetArg(args[n], XmNmessageString, cxstring); n++; if(idiag==1) halert = XmCreateErrorDialog(hform, "z88o", args, n); if(idiag==2) halert = XmCreateQuestionDialog(hform, "z88o", args, n); if(idiag==3) halert = XmCreateInformationDialog(hform, "z88o", args, n); XtUnmanageChild(XmMessageBoxGetChild(halert,XmDIALOG_HELP_BUTTON)); XtUnmanageChild(XmMessageBoxGetChild(halert,XmDIALOG_CANCEL_BUTTON)); XtManageChild(halert); XtAddCallback(halert,XmNokCallback,(XtCallbackProc)CB_OK,(XtPointer)NULL); /* XtPopup(XtParent(halert),XtGrabNone); */ XBell(XtDisplay(halert),IBELL); if(cxstring) XmStringFree(cxstring); return 0; }