/***********************************************************************
* 
*               *****   ***    ***
*                  *   *   *  *   *
*                 *     ***    ***
*                *     *   *  *   *
*               *****   ***    ***
*
* 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
* 
* V11.0  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.
***********************************************************************/ 
/***********************************************************************
* Z88COM fuer X11
* 9.2.2004 Rieg
***********************************************************************/

/***********************************************************************
* Includes
***********************************************************************/
/*----------------------------------------------------------------------
* UNIX
*----------------------------------------------------------------------*/
#ifdef FR_UNIX
#include <z88com.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <Xm/XmAll.h>
#endif

/***********************************************************************
* globale Variable, speziell fuer X11
***********************************************************************/
Widget hmain;     /* das oberste Widget                               */      
Widget hform;     /* Form-Widget, Kind von hmain                      */
Widget hw[68];    /* alle anderen Widgets, Kinder von hform           */

int IBELL;                                       /* Wert XBell        */

int IX_WINDOW,IY_WINDOW,IW_WINDOW,IH_WINDOW;     /* das ganze Z88COM  */
int IX_EDITIN,IY_EDITIN,IW_EDITIN,IH_EDITIN;     /* Edit In -RB       */
int IX_EDITOUT,IY_EDITOUT,IW_EDITOUT,IH_EDITOUT; /* Edit Out -RB      */
int IX_FEA,IY_FEA,IW_FEA,IH_FEA;                 /* FEA-RB            */
int IX_CAD,IY_CAD,IW_CAD,IH_CAD;                 /* CAD-RB            */
int IX_PLOT,IY_PLOT,IW_PLOT,IH_PLOT;             /* PLOT-RB           */
int IX_MAIN,IY_MAIN,IW_MAIN,IH_MAIN;             /* Help-Info-Exit    */
int IX_TITLE,IY_TITLE,IW_TITLE,IH_TITLE;         /* Titel             */
int IX_PROC,IY_PROC,IW_PROC,IH_PROC;             /* Z88N,Z88D,Z88E,V  */
int IX_START,IY_START,IW_START,IH_START;         /* Start Edit, FE .. */
int IX_ITER,IY_ITER,IW_ITER,IH_ITER,NC_ITER;     /* Textfelder Itera  */
int IX_STATUS,IY_STATUS,IW_STATUS,IH_STATUS;     /* Statuszeile       */

char CEDITOR[128], CBROWSER[128], CPREFIX[128];

char CF_FLARGE[128],CF_FSMALL[128],CF_ENTRIES[128];  /*  Fonts Window */

char CO_FOREGR[128],CO_BACKGR[128],CO_ENTRIES[128];  /* Farben Window */

/***********************************************************************
* Functions, speziell fuer X11
***********************************************************************/
Widget WindowProcedure(Widget hmain);

void CB_WER           (Widget hcallw, XtPointer data, 
                              XmPushButtonCallbackStruct *cbs);
void CB_EXIT          (Widget hcallw, XtPointer data, 
                              XmPushButtonCallbackStruct *cbs);
void CB_HELP          (Widget hcallw, XtPointer data, 
                              XmPushButtonCallbackStruct *cbs);
void CB_HELPGEN       (Widget hcallw, XtPointer data, 
                              XmPushButtonCallbackStruct *cbs);
void CB_Z88V          (Widget hcallw, XtPointer data, 
                              XmPushButtonCallbackStruct *cbs);
void CB_Z88N          (Widget hcallw, XtPointer data, 
                              XmPushButtonCallbackStruct *cbs);
void CB_Z88D          (Widget hcallw, XtPointer data, 
                              XmPushButtonCallbackStruct *cbs);
void CB_Z88E          (Widget hcallw, XtPointer data, 
                              XmPushButtonCallbackStruct *cbs);
void CB_Z88G          (Widget hcallw, XtPointer data, 
                              XmPushButtonCallbackStruct *cbs);
void CB_Z88H          (Widget hcallw, XtPointer data, 
                              XmPushButtonCallbackStruct *cbs);
void CB_STARTEDITIN   (Widget hcallw, XtPointer data, 
                              XmPushButtonCallbackStruct *cbs);
void CB_STARTEDITOUT  (Widget hcallw, XtPointer data, 
                              XmPushButtonCallbackStruct *cbs);
void CB_STARTCAD      (Widget hcallw, XtPointer data, 
                              XmPushButtonCallbackStruct *cbs);
void CB_STARTFEA      (Widget hcallw, XtPointer data, 
                              XmPushButtonCallbackStruct *cbs);
void CB_STARTPLOT     (Widget hcallw, XtPointer data, 
                              XmPushButtonCallbackStruct *cbs);
void CB_EDITIN        (Widget hcallw, XtPointer data, 
                              XmToggleButtonCallbackStruct *cbs);
void CB_EDITOUT       (Widget hcallw, XtPointer data, 
                              XmToggleButtonCallbackStruct *cbs);
void CB_Z88X          (Widget hcallw, XtPointer data, 
                              XmToggleButtonCallbackStruct *cbs);
void CB_PLOT          (Widget hcallw, XtPointer data, 
                              XmToggleButtonCallbackStruct *cbs);
void CB_Z88F          (Widget hcallw, XtPointer data, 
                              XmToggleButtonCallbackStruct *cbs);
void CB_NOOFIT        (Widget hcallw, XtPointer data, 
                              XmTextVerifyCallbackStruct *cbs);

/***********************************************************************
*  Function-Declarationen
***********************************************************************/
int ale88c(int);
int rcol88c(void);
int lan88c(void);
int wlog88c(FR_INT4,int);

/***********************************************************************
*  globale Variable
***********************************************************************/
FILE *fdyn,*fwlo;

FR_INT4 LANG= 2;

int ifedin = IDM_Z88I1; 
int ifedout= IDM_Z88O2;
int ifz88x = IDM_IAFX;
int ifplot = IDM_Z88O;
int ifz88f = IDM_Z88FCOM;
int ifhelp = 0;
int icount = 10;
     
int IALERT= 0; /* 1: Gefahr,sperrt CB_PAINT,wird in CB_OK wieder zu 0 */
int IDEATH= 0; /* 1: STOP,wird in CB_OK(Callback von ale88c) geprueft */
  
char  cdyn[12] = "z88.dyn";  
char  clog[12] = "z88com.log";

char count[8]  = "10";

Pixel bg,fg,eg;

/***********************************************************************
* Hauptprogramm
***********************************************************************/
int main(int argc,char **argv)
{
extern Widget hmain;

Widget MainDialog;

XtAppContext app_context;

/*----------------------------------------------------------------------
* Los geht's
*---------------------------------------------------------------------*/
/* XtSetLanguageProc(NULL,NULL,NULL); */

hmain= XtAppInitialize(&app_context,"z88com",NULL,0,&argc,argv,NULL,NULL,0);

MainDialog = WindowProcedure(hmain);

XtManageChild(MainDialog);
XtRealizeWidget(hmain);

XtAppMainLoop(app_context);
}

/***********************************************************************
* Window- Procedure
***********************************************************************/
Widget WindowProcedure(Widget hmain)
{
extern Widget hform;
extern Widget hw[];

extern FR_INT4 LANG;

extern int IX_WINDOW,IY_WINDOW,IW_WINDOW,IH_WINDOW;
extern int IX_EDITIN,IY_EDITIN,IW_EDITIN,IH_EDITIN;
extern int IX_EDITOUT,IY_EDITOUT,IW_EDITOUT,IH_EDITOUT;
extern int IX_FEA,IY_FEA,IW_FEA,IH_FEA;
extern int IX_CAD,IY_CAD,IW_CAD,IH_CAD;
extern int IX_PLOT,IY_PLOT,IW_PLOT,IH_PLOT;
extern int IX_MAIN,IY_MAIN,IW_MAIN,IH_MAIN;
extern int IX_TITLE,IY_TITLE,IW_TITLE,IH_TITLE;
extern int IX_PROC,IY_PROC,IW_PROC,IH_PROC;
extern int IX_START,IY_START,IW_START,IH_START;
extern int IX_ITER,IY_ITER,IW_ITER,IH_ITER,NC_ITER;
extern int IX_STATUS,IY_STATUS,IW_STATUS,IH_STATUS;

extern int icount;

extern int IALERT;

extern char CEDITOR[], CBROWSER[], CPREFIX[];

extern char CF_FLARGE[],CF_FSMALL[],CF_ENTRIES[];

extern char CO_FOREGR[],CO_BACKGR[],CO_ENTRIES[];

extern Pixel fg,bg,eg;

XColor RGBColor, HwColor;

Colormap cmap;

Arg args[40];
Cardinal n;

XmFontListEntry entry1,entry2,entry3;
XmFontList      fontlist;

XmString cxstring = NULL;

int iret;

char cstring[256];

/*----------------------------------------------------------------------
* lan88c starten
* Muss als erstes sein, weil hier Z88COM.LOG geoeffnet wird
*---------------------------------------------------------------------*/
iret= lan88c();

if(iret == AL_NOLOG)
  {
  fprintf(stderr,"Cannot open file Z88COM.LOG ! STOP !\n"); 
  fclose(fwlo);
  exit(1); 
  }
if(iret == AL_NODYN)
  {
  fprintf(stderr,"Cannot open file Z88.DYN ! STOP !\n"); 
  fclose(fwlo);
  exit(1); 
  }
if(iret == AL_WRONGDYN)
  {
  fprintf(stderr,"File Z88.DYN is invalid or wrong! STOP !\n"); 
  fclose(fwlo);
  exit(1); 
  }

/*----------------------------------------------------------------------
* Z88.FCD einlesen. rcol88c nutzt intern wlog88c.
* Muss vor Form- Widget gestartet werden, um Dimensionen zu erhalten
*---------------------------------------------------------------------*/
iret= rcol88c();

if(iret != 0)
  {
  if(LANG == 1)
    fprintf(stderr,"Datei Z88.FCD is ungueltig oder falsch! STOP !\n"); 
  if(LANG == 2)
    fprintf(stderr,"File Z88.FCD is invalid or wrong! STOP !\n");

  fclose(fwlo);
  exit(1);
  }

/*----------------------------------------------------------------------
* Form-Widget, Basis fuer den Rest
*---------------------------------------------------------------------*/
n = 0;

XtSetArg(args[n], XmNx,      IX_WINDOW); n++;
XtSetArg(args[n], XmNy,      IY_WINDOW); n++;
XtSetArg(args[n], XmNwidth,  IW_WINDOW); n++;
XtSetArg(args[n], XmNheight, IH_WINDOW); n++;

hform = XmCreateForm(hmain, "hform", args, n);

XtManageChild(hform);

/*----------------------------------------------------------------------
* Fonts laden
* Hier wird folgender Effekt ausgenutzt: Fuer die Funktion
* XmTextFieldSetString bei den Textfields kann kein Tag angegeben
* werden, weil das keine Compound- Strings sind. Fuer das Widget
* XmCreateTextField kann nur eine Fontlist angeben werden. Anscheinend
* wird dann der erste Eintrag der Fontlist gezogen. Daher keine weitere
* Verwendung von cf_entries
*---------------------------------------------------------------------*/
entry1= XmFontListEntryLoad(
        XtDisplay(hmain),CF_ENTRIES,XmFONT_IS_FONT,"cf_entries");

if(entry1 == NULL) 
  {
  wlog88c(0,LOG_NO_CF_ENTRIES);
  IALERT= 1; 
  IDEATH= 1;
  ale88c(AL_NO_CF_ENTRIES);
  }
  
entry2= XmFontListEntryLoad(
        XtDisplay(hmain),CF_FLARGE,XmFONT_IS_FONT,"cf_flarge");

if(entry2 == NULL)
  {
  wlog88c(0,LOG_NO_CF_FLARGE);
  IALERT= 1; 
  IDEATH= 1;
  ale88c(AL_NO_CF_FLARGE);
  }

entry3= XmFontListEntryLoad(
        XtDisplay(hmain),CF_FSMALL,XmFONT_IS_FONT,"cf_fsmall");

if(entry3 == NULL)
  {
  wlog88c(0,LOG_NO_CF_FSMALL);
  IALERT= 1; 
  IDEATH= 1;
  ale88c(AL_NO_CF_FSMALL);
  }

fontlist= XmFontListAppendEntry(NULL,    entry1);
fontlist= XmFontListAppendEntry(fontlist,entry2);
fontlist= XmFontListAppendEntry(fontlist,entry3);

XmFontListEntryFree(&entry1);
XmFontListEntryFree(&entry2);
XmFontListEntryFree(&entry3);

/*----------------------------------------------------------------------
* Farben laden
*---------------------------------------------------------------------*/
cmap= DefaultColormap(XtDisplay(hmain),DefaultScreen(XtDisplay(hmain)));

if(XAllocNamedColor(XtDisplay(hmain),cmap,CO_BACKGR,&RGBColor,&HwColor))
  bg= HwColor.pixel;
else
  {
  wlog88c(0,LOG_NO_CO_BACKGR);
  IALERT= 1; 
  IDEATH= 1;
  ale88c(     AL_NO_CO_BACKGR);
  }  

if(XAllocNamedColor(XtDisplay(hmain),cmap,CO_FOREGR,&RGBColor,&HwColor))
  fg= HwColor.pixel;
else
  {
  wlog88c(0,LOG_NO_CO_FOREGR);
  IALERT= 1; 
  IDEATH= 1;
  ale88c(    AL_NO_CO_FOREGR);
  }  

if(XAllocNamedColor(XtDisplay(hmain),cmap,CO_ENTRIES,&RGBColor,&HwColor))
  eg= HwColor.pixel;
else
  {
  wlog88c(0,LOG_NO_CO_ENTRIES);
  IALERT= 1; 
  IDEATH= 1;
  ale88c(    AL_NO_CO_ENTRIES);
  }  

/*----------------------------------------------------------------------
* MAIN- Frame
*---------------------------------------------------------------------*/
/*======================================================================
* Frame
*=====================================================================*/
n = 0;

XtSetArg(args[n], XmNleftAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNx, IX_MAIN); n++;
XtSetArg(args[n], XmNtopAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNy, IY_MAIN); n++;
XtSetArg(args[n], XmNrightAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNwidth,  IW_MAIN); n++;
XtSetArg(args[n], XmNbottomAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNheight, IH_MAIN); n++;
XtSetArg(args[n], XmNshadowType, XmSHADOW_IN); n++;

hw[0]= XmCreateFrame(hform, "hw[0]", args, n);

XtManageChild(hw[0]);

/*======================================================================
* RowColumn
*=====================================================================*/
n=0;

XtSetArg(args[n], XmNleftAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNx, IX_MAIN); n++;
XtSetArg(args[n], XmNtopAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNy, IY_MAIN); n++;
XtSetArg(args[n], XmNrightAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNwidth,  IW_MAIN); n++;
XtSetArg(args[n], XmNbottomAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNheight, IH_MAIN); n++;
XtSetArg(args[n], XmNadjustLast, FALSE); n++;
XtSetArg(args[n], XmNnumColumns,1); n++;
XtSetArg(args[n], XmNorientation, XmHORIZONTAL); n++;
XtSetArg(args[n], XmNpacking, XmPACK_COLUMN); n++;
XtSetArg(args[n], XmNresizeHeight, FALSE ); n++;
XtSetArg(args[n], XmNresizeWidth, FALSE); n++;

hw[1] = XmCreateRowColumn(hw[0], "hw[1]", args, n);

/*======================================================================
* Info PB_WER
*=====================================================================*/
n = 0;

cxstring = XmStringCreateLtoR("Info", "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNbackground, bg); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

hw[2] = XmCreatePushButton(hw[1], "hw[2]", args, n);

XtManageChild(hw[2]);

XtAddCallback(
  hw[2],XmNactivateCallback,(XtCallbackProc) CB_WER,(XtPointer)NULL);

/*======================================================================
* Ende PB_EXIT
*=====================================================================*/
n = 0;

if(LANG == 1) strcpy(cstring,"Ende");
if(LANG == 2) strcpy(cstring,"Exit");
cxstring = XmStringCreateLtoR(cstring, "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNbackground, bg); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

hw[3] = XmCreatePushButton(hw[1], "hw[3]", args, n);

XtManageChild(hw[3]);

XtAddCallback(
  hw[3],XmNactivateCallback,(XtCallbackProc) CB_EXIT,(XtPointer)NULL);

/*======================================================================
* Hilfe PB_HELP
*=====================================================================*/
n = 0;

if(LANG == 1) strcpy(cstring,"Hilfe");
if(LANG == 2) strcpy(cstring,"Help");
cxstring = XmStringCreateLtoR(cstring, "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNbackground, bg); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

hw[4] = XmCreatePushButton(hw[1], "hw[4]", args, n);

XtManageChild(hw[4]);

XtAddCallback(
  hw[4],XmNactivateCallback,(XtCallbackProc) CB_HELP,(XtPointer)NULL);

XtManageChild(hw[1]); /* das RowColumn MAIN */

/*======================================================================
* Pushbutton Z88-Commander: allgemeine Hilfe
*=====================================================================*/
n = 0;

strcpy(cstring,"Z88-COMMANDER");
cxstring = XmStringCreateLtoR(cstring, "cf_flarge");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNbackground, bg); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

XtSetArg(args[n], XmNleftAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNx, (IX_TITLE)); n++; 
XtSetArg(args[n], XmNtopAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNy, IY_TITLE); n++;
XtSetArg(args[n], XmNrightAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNwidth,  IW_TITLE); n++;
XtSetArg(args[n], XmNbottomAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNheight, IH_TITLE); n++; 

XtSetArg(args[n], XmNrecomputeSize, TRUE ); n++;
XtSetArg(args[n], XmNalignment, 1 ); n++;

hw[5] = XmCreatePushButton(hform, "hw[5]", args, n);

XtManageChild(hw[5]);

XtAddCallback(
  hw[5],XmNactivateCallback,(XtCallbackProc) CB_HELPGEN,(XtPointer)NULL);

/*----------------------------------------------------------------------
* PROC- Frame
*---------------------------------------------------------------------*/
/*======================================================================
* Frame
*=====================================================================*/
n = 0;

XtSetArg(args[n], XmNleftAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNx, IX_PROC); n++;
XtSetArg(args[n], XmNtopAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNy, IY_PROC); n++;
XtSetArg(args[n], XmNrightAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNwidth,  IW_PROC); n++;
XtSetArg(args[n], XmNbottomAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNheight, IH_PROC); n++;
XtSetArg(args[n], XmNshadowType, XmSHADOW_IN); n++; 

hw[6]= XmCreateFrame(hform, "hw[6]", args, n);

XtManageChild(hw[6]);

/*======================================================================
* RowColumn
*=====================================================================*/
n=0;

XtSetArg(args[n], XmNleftAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNx, IX_PROC); n++;
XtSetArg(args[n], XmNtopAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNy, IY_PROC); n++;
XtSetArg(args[n], XmNrightAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNwidth,  IW_PROC); n++;
XtSetArg(args[n], XmNbottomAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNheight, IH_PROC); n++;
XtSetArg(args[n], XmNadjustLast, FALSE); n++;
XtSetArg(args[n], XmNnumColumns,1); n++;
XtSetArg(args[n], XmNorientation, XmHORIZONTAL); n++;
XtSetArg(args[n], XmNpacking, XmPACK_COLUMN); n++;
XtSetArg(args[n], XmNresizeHeight, FALSE ); n++;
XtSetArg(args[n], XmNresizeWidth, FALSE); n++;

hw[7] = XmCreateRowColumn(hw[6], "hw[7]", args, n);

/*======================================================================
* Z88V : PB_Z88V
*=====================================================================*/
n = 0;

cxstring = XmStringCreateLtoR(" Z88V ","cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNbackground, bg); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

hw[8] = XmCreatePushButton(hw[7], "hw[8]", args, n);

XtManageChild(hw[8]);

XtAddCallback(
  hw[8],XmNactivateCallback,(XtCallbackProc) CB_Z88V,(XtPointer)NULL);

/*======================================================================
* Z88N : PB_Z88N
*=====================================================================*/
n = 0;

cxstring = XmStringCreateLtoR(" Z88N ", "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNbackground, bg); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

hw[9] = XmCreatePushButton(hw[7], "hw[9]", args, n);

XtManageChild(hw[9]);

XtAddCallback(
  hw[9],XmNactivateCallback,(XtCallbackProc) CB_Z88N,(XtPointer)NULL);

/*======================================================================
* Z88D : PB_Z88D
*=====================================================================*/
n = 0;

cxstring = XmStringCreateLtoR(" Z88D ", "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNbackground, bg); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

hw[10] = XmCreatePushButton(hw[7], "hw[10]", args, n);

XtManageChild(hw[10]);

XtAddCallback(
  hw[10],XmNactivateCallback,(XtCallbackProc) CB_Z88D,(XtPointer)NULL);

/*======================================================================
* Z88E : PB_Z88E
*=====================================================================*/
n = 0;

cxstring = XmStringCreateLtoR(" Z88E ", "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNbackground, bg); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

hw[11] = XmCreatePushButton(hw[7], "hw[11]", args, n);

XtManageChild(hw[11]);

XtAddCallback(
  hw[11],XmNactivateCallback,(XtCallbackProc) CB_Z88E,(XtPointer)NULL);

/*======================================================================
* Z88G : PB_Z88G
*=====================================================================*/
n = 0;

cxstring = XmStringCreateLtoR(" Z88G ", "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNbackground, bg); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

hw[65] = XmCreatePushButton(hw[7], "hw[65]", args, n);

XtManageChild(hw[65]);

XtAddCallback(
  hw[65],XmNactivateCallback,(XtCallbackProc) CB_Z88G,(XtPointer)NULL);

/*======================================================================
* Z88H : PB_Z88H
*=====================================================================*/
n = 0;

cxstring = XmStringCreateLtoR(" Z88H ", "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNbackground, bg); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

hw[66] = XmCreatePushButton(hw[7], "hw[66]", args, n);

XtManageChild(hw[66]);

XtAddCallback(
  hw[66],XmNactivateCallback,(XtCallbackProc) CB_Z88H,(XtPointer)NULL);

XtManageChild(hw[7]); /* das RowColumn PROC */

/*----------------------------------------------------------------------
* START- Frame
*---------------------------------------------------------------------*/
/*======================================================================
* Frame
*=====================================================================*/
n = 0;

XtSetArg(args[n], XmNleftAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNx, IX_START); n++;
XtSetArg(args[n], XmNtopAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNy, IY_START); n++;
XtSetArg(args[n], XmNrightAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNwidth,  IW_START); n++;
XtSetArg(args[n], XmNbottomAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNheight, IH_START); n++;
XtSetArg(args[n], XmNshadowType, XmSHADOW_IN); n++; 

hw[12]= XmCreateFrame(hform, "hw[12]", args, n);

XtManageChild(hw[12]);

/*======================================================================
* RowColumn
*=====================================================================*/
n=0;

XtSetArg(args[n], XmNleftAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNx, IX_START); n++;
XtSetArg(args[n], XmNtopAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNy, IY_START); n++;
XtSetArg(args[n], XmNrightAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNwidth,  IW_START); n++;
XtSetArg(args[n], XmNbottomAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNheight, IH_START); n++;
XtSetArg(args[n], XmNadjustLast, FALSE); n++;
XtSetArg(args[n], XmNnumColumns,1); n++;
XtSetArg(args[n], XmNorientation, XmHORIZONTAL); n++;
XtSetArg(args[n], XmNpacking, XmPACK_COLUMN); n++;
XtSetArg(args[n], XmNresizeHeight, FALSE ); n++;
XtSetArg(args[n], XmNresizeWidth, FALSE); n++;

hw[13] = XmCreateRowColumn(hw[12], "hw[13]", args, n);

/*======================================================================
* Start EDITIN
*=====================================================================*/
n = 0;

if(LANG == 1) strcpy(cstring," Edit Eingabe ");
if(LANG == 2) strcpy(cstring," Edit Input F ");
cxstring = XmStringCreateLtoR(cstring, "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNbackground, bg); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

hw[14] = XmCreatePushButton(hw[13], "hw[14]", args, n);

XtManageChild(hw[14]);

XtAddCallback(hw[14],XmNactivateCallback,
  (XtCallbackProc)CB_STARTEDITIN,(XtPointer)NULL);

/*======================================================================
* Start EDITOUT
*=====================================================================*/
n = 0;

if(LANG == 1) strcpy(cstring," Edit Ausgabe ");
if(LANG == 2) strcpy(cstring," Edit Output F");
cxstring = XmStringCreateLtoR(cstring, "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNbackground, bg); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

hw[15] = XmCreatePushButton(hw[13], "hw[15]", args, n);

XtManageChild(hw[15]);

XtAddCallback(hw[15],XmNactivateCallback,
  (XtCallbackProc)CB_STARTEDITOUT,(XtPointer)NULL);

/*======================================================================
* Start CAD<>Z88
*=====================================================================*/
n = 0;

if(LANG == 1) strcpy(cstring," DXF <-> Z88 ");
if(LANG == 2) strcpy(cstring," DXF <-> Z88 ");
cxstring = XmStringCreateLtoR(cstring, "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNbackground, bg); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

hw[16] = XmCreatePushButton(hw[13], "hw[16]", args, n);

XtManageChild(hw[16]);

XtAddCallback(
  hw[16],XmNactivateCallback,(XtCallbackProc)CB_STARTCAD,(XtPointer)NULL);

/*======================================================================
* Start PLOT
*=====================================================================*/
n = 0;

if(LANG == 1) strcpy(cstring," Plotauswahl ");
if(LANG == 2) strcpy(cstring," Plot Feature");
cxstring = XmStringCreateLtoR(cstring, "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNbackground, bg); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

hw[17] = XmCreatePushButton(hw[13], "hw[17]", args, n);

XtManageChild(hw[17]);

XtAddCallback(
  hw[17],XmNactivateCallback,(XtCallbackProc)CB_STARTPLOT,(XtPointer)NULL);

/*======================================================================
* Start Z88F
*=====================================================================*/
n = 0;

cxstring = XmStringCreateLtoR("*** Solver ***", "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNbackground, bg); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

hw[18] = XmCreatePushButton(hw[13], "hw[18]", args, n);

XtManageChild(hw[18]);

XtAddCallback(
  hw[18],XmNactivateCallback,(XtCallbackProc)CB_STARTFEA,(XtPointer)NULL);


XtManageChild(hw[13]); /* das RowColumn START */

/*----------------------------------------------------------------------
* Radiobox EDITIN
*---------------------------------------------------------------------*/
/*======================================================================
* der Frame
*=====================================================================*/
n = 0;

XtSetArg(args[n], XmNleftAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNx, IX_EDITIN); n++;
XtSetArg(args[n], XmNtopAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNy, IY_EDITIN); n++;
XtSetArg(args[n], XmNrightAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNwidth,  IW_EDITIN); n++;
XtSetArg(args[n], XmNbottomAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNheight, IH_EDITIN); n++;
XtSetArg(args[n], XmNshadowType, XmSHADOW_IN); n++;

hw[19] = XmCreateFrame(hform,"hw[19]",args, n);

XtManageChild(hw[19]);

/*======================================================================
* Radiobox EDITIN
*=====================================================================*/
n=0;

XtSetArg(args[n], XmNleftAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNx, IX_EDITIN); n++;
XtSetArg(args[n], XmNtopAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNy, IY_EDITIN); n++;
XtSetArg(args[n], XmNrightAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNwidth,  IW_EDITIN); n++;
XtSetArg(args[n], XmNbottomAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNheight, IH_EDITIN); n++;

XtSetArg(args[n], XmNorientation, XmVERTICAL); n++;
XtSetArg(args[n], XmNpacking, XmPACK_COLUMN); n++;

XtSetArg(args[n], XmNresizeWidth, FALSE); n++;
XtSetArg(args[n], XmNresizeHeight, FALSE); n++;

hw[20]= XmCreateRadioBox(hw[19],"hw[20]",args, n);
                              
/*======================================================================
* Toggle Z88.DYN
*=====================================================================*/
n = 0;

cxstring = XmStringCreateLtoR("Z88.DYN", "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

XtSetArg(args[n], XmNrecomputeSize, TRUE ); n++;

hw[21]= XmCreateToggleButton(hw[20],"hw[21]",args, n);

XtManageChild(hw[21]);

XtAddCallback(hw[21],XmNvalueChangedCallback,
  (XtCallbackProc) CB_EDITIN,(XtPointer)IDM_Z88DYN);

/*======================================================================
* Toggle Z88.FCD
*=====================================================================*/
n = 0;

cxstring = XmStringCreateLtoR("Z88.FCD", "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

XtSetArg(args[n], XmNrecomputeSize, TRUE ); n++;

hw[22]= XmCreateToggleButton(hw[20],"hw[22]",args, n);

XtManageChild(hw[22]);

XtAddCallback(hw[22],XmNvalueChangedCallback,
  (XtCallbackProc) CB_EDITIN,(XtPointer)IDM_Z88FCD);

/*======================================================================
* Toggle Z88NI.TXT
*=====================================================================*/
n = 0;

cxstring = XmStringCreateLtoR("Z88NI.TXT", "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

XtSetArg(args[n], XmNrecomputeSize, TRUE ); n++;

hw[23]= XmCreateToggleButton(hw[20],"hw[23]",args, n);

XtManageChild(hw[23]);

XtAddCallback(hw[23],XmNvalueChangedCallback,
  (XtCallbackProc) CB_EDITIN,(XtPointer)IDM_Z88NI);

/*======================================================================
* Toggle Z88I1.TXT
*=====================================================================*/
n = 0;

cxstring = XmStringCreateLtoR("Z88I1.TXT", "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

XtSetArg(args[n], XmNset, TRUE ); n++;

XtSetArg(args[n], XmNrecomputeSize, TRUE ); n++;

hw[24]= XmCreateToggleButton(hw[20],"hw[24]",args, n);

XtManageChild(hw[24]);

XtAddCallback(hw[24],XmNvalueChangedCallback,
  (XtCallbackProc) CB_EDITIN,(XtPointer)IDM_Z88I1);

/*======================================================================
* Toggle Z88I2.TXT
*=====================================================================*/
n = 0;

cxstring = XmStringCreateLtoR("Z88I2.TXT", "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

XtSetArg(args[n], XmNrecomputeSize, TRUE ); n++;

hw[25]= XmCreateToggleButton(hw[20],"hw[25]",args, n);

XtManageChild(hw[25]);

XtAddCallback(hw[25],XmNvalueChangedCallback,
  (XtCallbackProc) CB_EDITIN,(XtPointer)IDM_Z88I2);

/*======================================================================
* Toggle Z88I3.TXT
*=====================================================================*/
n = 0;

cxstring = XmStringCreateLtoR("Z88I3.TXT", "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

XtSetArg(args[n], XmNrecomputeSize, TRUE ); n++;

hw[26]= XmCreateToggleButton(hw[20],"hw[26]",args, n);

XtManageChild(hw[26]);

XtAddCallback(hw[26],XmNvalueChangedCallback,
  (XtCallbackProc) CB_EDITIN,(XtPointer)IDM_Z88I3);

/*======================================================================
* Toggle Z88I4.TXT
*=====================================================================*/
n = 0;

cxstring = XmStringCreateLtoR("Z88I4.TXT", "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

XtSetArg(args[n], XmNrecomputeSize, TRUE ); n++;

hw[27]= XmCreateToggleButton(hw[20],"hw[27]",args, n);

XtManageChild(hw[27]);

XtAddCallback(hw[27],XmNvalueChangedCallback,
  (XtCallbackProc) CB_EDITIN,(XtPointer)IDM_Z88I4);

XtManageChild(hw[20]); /* Radiobox Edit In */

/*----------------------------------------------------------------------
* Radiobox EDITOUT
*---------------------------------------------------------------------*/
/*======================================================================
* der Frame
*=====================================================================*/
n = 0;

XtSetArg(args[n], XmNleftAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNx, IX_EDITOUT); n++;
XtSetArg(args[n], XmNtopAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNy, IY_EDITOUT); n++;
XtSetArg(args[n], XmNrightAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNwidth,  IW_EDITOUT); n++;
XtSetArg(args[n], XmNbottomAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNheight, IH_EDITOUT); n++;
XtSetArg(args[n], XmNshadowType, XmSHADOW_IN); n++;

hw[28] = XmCreateFrame(hform,"hw[28]",args, n);

XtManageChild(hw[28]);

/*======================================================================
* Radiobox EDITOUT
*=====================================================================*/
n=0;

XtSetArg(args[n], XmNleftAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNx, IX_EDITOUT); n++;
XtSetArg(args[n], XmNtopAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNy, IY_EDITOUT); n++;
XtSetArg(args[n], XmNrightAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNwidth,  IW_EDITOUT); n++;
XtSetArg(args[n], XmNbottomAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNheight, IH_EDITOUT); n++;

XtSetArg(args[n], XmNorientation, XmVERTICAL); n++;
XtSetArg(args[n], XmNpacking, XmPACK_COLUMN); n++;

XtSetArg(args[n], XmNresizeWidth, FALSE); n++;
XtSetArg(args[n], XmNresizeHeight, FALSE); n++;

hw[29]= XmCreateRadioBox(hw[28],"hw[29]",args, n);
                              
/*======================================================================
* Toggle Z88O0.TXT
*=====================================================================*/
n = 0;

cxstring = XmStringCreateLtoR("Z88O0.TXT", "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

XtSetArg(args[n], XmNrecomputeSize, TRUE ); n++;

hw[30]= XmCreateToggleButton(hw[29],"hw[30]",args, n);

XtManageChild(hw[30]);

XtAddCallback(hw[30],XmNvalueChangedCallback,
  (XtCallbackProc) CB_EDITOUT,(XtPointer)IDM_Z88O0);

/*======================================================================
* Toggle Z88O1.TXT
*=====================================================================*/
n = 0;

cxstring = XmStringCreateLtoR("Z88O1.TXT", "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

XtSetArg(args[n], XmNrecomputeSize, TRUE ); n++;

hw[31]= XmCreateToggleButton(hw[29],"hw[31]",args, n);

XtManageChild(hw[31]);

XtAddCallback(hw[31],XmNvalueChangedCallback,
  (XtCallbackProc) CB_EDITOUT,(XtPointer)IDM_Z88O1);

/*======================================================================
* Toggle Z88O2.TXT
*=====================================================================*/
n = 0;

cxstring = XmStringCreateLtoR("Z88O2.TXT", "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

XtSetArg(args[n], XmNset, TRUE ); n++;

XtSetArg(args[n], XmNrecomputeSize, TRUE ); n++;

hw[32]= XmCreateToggleButton(hw[29],"hw[32]",args, n);

XtManageChild(hw[32]);

XtAddCallback(hw[32],XmNvalueChangedCallback,
  (XtCallbackProc) CB_EDITOUT,(XtPointer)IDM_Z88O2);

/*======================================================================
* Toggle Z88O3.TXT
*=====================================================================*/
n = 0;

cxstring = XmStringCreateLtoR("Z88O3.TXT", "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

XtSetArg(args[n], XmNrecomputeSize, TRUE ); n++;

hw[33]= XmCreateToggleButton(hw[29],"hw[33]",args, n);

XtManageChild(hw[33]);

XtAddCallback(hw[33],XmNvalueChangedCallback,
  (XtCallbackProc) CB_EDITOUT,(XtPointer)IDM_Z88O3);

/*======================================================================
* Toggle Z88O4.TXT
*=====================================================================*/
n = 0;

cxstring = XmStringCreateLtoR("Z88O4.TXT", "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

XtSetArg(args[n], XmNrecomputeSize, TRUE ); n++;

hw[34]= XmCreateToggleButton(hw[29],"hw[34]",args, n);

XtManageChild(hw[34]);

XtAddCallback(hw[34],XmNvalueChangedCallback,
  (XtCallbackProc) CB_EDITOUT,(XtPointer)IDM_Z88O4);

XtManageChild(hw[29]); /* Radiobox Edit Out */

/*======================================================================
* Toggle Z88O6.TXT
*=====================================================================*/
n = 0;

cxstring = XmStringCreateLtoR("Z88O6.TXT", "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

XtSetArg(args[n], XmNrecomputeSize, TRUE ); n++;

hw[50]= XmCreateToggleButton(hw[29],"hw[50]",args, n);

XtManageChild(hw[50]);

XtAddCallback(hw[50],XmNvalueChangedCallback,
  (XtCallbackProc) CB_EDITOUT,(XtPointer)IDM_Z88O6);

XtManageChild(hw[29]); /* Radiobox Edit Out */

/*----------------------------------------------------------------------
* Radiobox Z88X
*---------------------------------------------------------------------*/
/*======================================================================
* der Frame
*=====================================================================*/
n = 0;

XtSetArg(args[n], XmNleftAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNx, IX_CAD); n++;
XtSetArg(args[n], XmNtopAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNy, IY_CAD); n++;
XtSetArg(args[n], XmNrightAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNwidth,  IW_CAD); n++;
XtSetArg(args[n], XmNbottomAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNheight, IH_CAD); n++;
XtSetArg(args[n], XmNshadowType, XmSHADOW_IN); n++;

hw[35] = XmCreateFrame(hform,"hw[35]",args, n);

XtManageChild(hw[35]);

/*======================================================================
* Radiobox CAD
*=====================================================================*/
n=0;

XtSetArg(args[n], XmNleftAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNx, IX_CAD); n++;
XtSetArg(args[n], XmNtopAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNy, IY_CAD); n++;
XtSetArg(args[n], XmNrightAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNwidth,  IW_CAD); n++;
XtSetArg(args[n], XmNbottomAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNheight, IH_CAD); n++;

XtSetArg(args[n], XmNorientation, XmVERTICAL); n++;
XtSetArg(args[n], XmNpacking, XmPACK_COLUMN); n++;

XtSetArg(args[n], XmNresizeWidth, FALSE); n++;
XtSetArg(args[n], XmNresizeHeight, FALSE); n++;

hw[36]= XmCreateRadioBox(hw[35],"hw[36]",args, n);
                              
/*======================================================================
* Toggle I1TX
*=====================================================================*/
n = 0;
                               
cxstring = XmStringCreateLtoR("I1 -> DXF", "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

XtSetArg(args[n], XmNrecomputeSize, TRUE ); n++;

hw[37]= XmCreateToggleButton(hw[36],"hw[37]",args, n);

XtManageChild(hw[37]);

XtAddCallback(hw[37],XmNvalueChangedCallback,
  (XtCallbackProc) CB_Z88X,(XtPointer) IDM_I1TX);

/*======================================================================
* Toggle IATX
*=====================================================================*/
n = 0;

cxstring = XmStringCreateLtoR("I* -> DXF", "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

XtSetArg(args[n], XmNrecomputeSize, TRUE ); n++;

hw[38]= XmCreateToggleButton(hw[36],"hw[38]",args, n);

XtManageChild(hw[38]);

XtAddCallback(hw[38],XmNvalueChangedCallback,
  (XtCallbackProc) CB_Z88X,(XtPointer) IDM_IATX);

/*======================================================================
* Toggle NITX
*=====================================================================*/
n = 0;

cxstring = XmStringCreateLtoR("NI -> DXF", "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

XtSetArg(args[n], XmNrecomputeSize, TRUE ); n++;

hw[39]= XmCreateToggleButton(hw[36],"hw[39]",args, n);

XtManageChild(hw[39]);

XtAddCallback(hw[39],XmNvalueChangedCallback,
  (XtCallbackProc) CB_Z88X,(XtPointer) IDM_NITX);

/*======================================================================
* Toggle I1FX
*=====================================================================*/
n = 0;

cxstring = XmStringCreateLtoR("DXF -> I1", "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

XtSetArg(args[n], XmNrecomputeSize, TRUE ); n++;

hw[40]= XmCreateToggleButton(hw[36],"hw[40]",args, n);

XtManageChild(hw[40]);

XtAddCallback(hw[40],XmNvalueChangedCallback,
  (XtCallbackProc) CB_Z88X,(XtPointer) IDM_I1FX);

/*======================================================================
* Toggle IAFX
*=====================================================================*/
n = 0;

cxstring = XmStringCreateLtoR("DXF -> I*", "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

XtSetArg(args[n], XmNset, TRUE ); n++;

XtSetArg(args[n], XmNrecomputeSize, TRUE ); n++;

hw[41]= XmCreateToggleButton(hw[36],"hw[41]",args, n);

XtManageChild(hw[41]);

XtAddCallback(hw[41],XmNvalueChangedCallback,
  (XtCallbackProc) CB_Z88X,(XtPointer) IDM_IAFX);

/*======================================================================
* Toggle NIFX
*=====================================================================*/
n = 0;

cxstring = XmStringCreateLtoR("DXF -> NI", "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

XtSetArg(args[n], XmNrecomputeSize, TRUE ); n++;

hw[42]= XmCreateToggleButton(hw[36],"hw[42]",args, n);

XtManageChild(hw[42]);

XtAddCallback(hw[42],XmNvalueChangedCallback,
  (XtCallbackProc) CB_Z88X,(XtPointer) IDM_NIFX);

XtManageChild(hw[36]); /* Radiobox Z88X */

/*----------------------------------------------------------------------
* Radiobox PLOT
*---------------------------------------------------------------------*/
/*======================================================================
* der Frame
*=====================================================================*/
n = 0;

XtSetArg(args[n], XmNleftAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNx, IX_PLOT); n++;
XtSetArg(args[n], XmNtopAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNy, IY_PLOT); n++;
XtSetArg(args[n], XmNrightAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNwidth,  IW_PLOT); n++;
XtSetArg(args[n], XmNbottomAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNheight, IH_PLOT); n++;
XtSetArg(args[n], XmNshadowType, XmSHADOW_IN); n++;

hw[43] = XmCreateFrame(hform,"hw[43]",args, n);

XtManageChild(hw[43]);

/*======================================================================
* Radiobox PLOT
*=====================================================================*/
n=0;

XtSetArg(args[n], XmNleftAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNx, IX_PLOT); n++;
XtSetArg(args[n], XmNtopAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNy, IY_PLOT); n++;
XtSetArg(args[n], XmNrightAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNwidth,  IW_PLOT); n++;
XtSetArg(args[n], XmNbottomAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNheight, IH_PLOT); n++;

XtSetArg(args[n], XmNorientation, XmVERTICAL); n++;
XtSetArg(args[n], XmNpacking, XmPACK_COLUMN); n++;

XtSetArg(args[n], XmNresizeWidth, FALSE); n++;
XtSetArg(args[n], XmNresizeHeight, FALSE); n++;

hw[44]= XmCreateRadioBox(hw[43],"hw[44]",args, n);
                              
/*======================================================================
* Toggle Z88O
*=====================================================================*/
n = 0;
                               
cxstring = XmStringCreateLtoR("Z88O", "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

XtSetArg(args[n], XmNset, TRUE ); n++;

XtSetArg(args[n], XmNrecomputeSize, TRUE ); n++;

hw[67]= XmCreateToggleButton(hw[44],"hw[67]",args, n);

XtManageChild(hw[67]);

XtAddCallback(hw[67],XmNvalueChangedCallback,
  (XtCallbackProc) CB_PLOT,(XtPointer) IDM_Z88O);

/*======================================================================
* Toggle Z88P
*=====================================================================*/
n = 0;
                               
cxstring = XmStringCreateLtoR("Z88P", "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

XtSetArg(args[n], XmNrecomputeSize, TRUE ); n++;

hw[45]= XmCreateToggleButton(hw[44],"hw[45]",args, n);

XtManageChild(hw[45]);

XtAddCallback(hw[45],XmNvalueChangedCallback,
  (XtCallbackProc) CB_PLOT,(XtPointer) IDM_Z88P);


/*======================================================================
* Toggle Loeschen Z88P.STO
*=====================================================================*/
n = 0;
                               
cxstring = XmStringCreateLtoR("rm p.sto", "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

XtSetArg(args[n], XmNrecomputeSize, TRUE ); n++;

hw[46]= XmCreateToggleButton(hw[44],"hw[46]",args, n);

XtManageChild(hw[46]);

XtAddCallback(hw[46],XmNvalueChangedCallback,
  (XtCallbackProc) CB_PLOT,(XtPointer) IDM_RMSTO);

/*======================================================================
* Toggle Z88O7.TXT an Z88O6.TXT
*=====================================================================*/
n = 0;
                               
cxstring = XmStringCreateLtoR("cat O7", "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

XtSetArg(args[n], XmNrecomputeSize, TRUE ); n++;

hw[47]= XmCreateToggleButton(hw[44],"hw[47]",args, n);

XtManageChild(hw[47]);

XtAddCallback(hw[47],XmNvalueChangedCallback,
  (XtCallbackProc) CB_PLOT,(XtPointer) IDM_CATO6O7);

/*======================================================================
* Toggle PXON88
*=====================================================================*/
n = 0;
                               
cxstring = XmStringCreateLtoR("PXON88", "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

XtSetArg(args[n], XmNrecomputeSize, TRUE ); n++;

hw[48]= XmCreateToggleButton(hw[44],"hw[48]",args, n);

XtManageChild(hw[48]);

XtAddCallback(hw[48],XmNvalueChangedCallback,
  (XtCallbackProc) CB_PLOT,(XtPointer) IDM_PXON88);

/*======================================================================
* Toggle LASERJ88
*=====================================================================*/
n = 0;
                               
cxstring = XmStringCreateLtoR("LASERJ88", "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

XtSetArg(args[n], XmNrecomputeSize, TRUE ); n++;

hw[49]= XmCreateToggleButton(hw[44],"hw[49]",args, n);

XtManageChild(hw[49]);

XtAddCallback(hw[49],XmNvalueChangedCallback,
  (XtCallbackProc) CB_PLOT,(XtPointer) IDM_LASERJ88);

XtManageChild(hw[44]); /* Radiobox PLOT */

/*----------------------------------------------------------------------
* Radiobox Z88F
*---------------------------------------------------------------------*/
/*======================================================================
* der Frame
*=====================================================================*/
n = 0;

XtSetArg(args[n], XmNleftAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNx, IX_FEA); n++;
XtSetArg(args[n], XmNtopAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNy, IY_FEA); n++;
XtSetArg(args[n], XmNrightAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNwidth,  IW_FEA); n++;
XtSetArg(args[n], XmNbottomAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNheight, IH_FEA); n++;
XtSetArg(args[n], XmNshadowType, XmSHADOW_IN); n++;

hw[51] = XmCreateFrame(hform,"hw[51]",args, n);

XtManageChild(hw[51]);

/*======================================================================
* Radiobox Z88F
*=====================================================================*/
n=0;

XtSetArg(args[n], XmNleftAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNx, IX_FEA); n++;
XtSetArg(args[n], XmNtopAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNy, IY_FEA); n++;
XtSetArg(args[n], XmNrightAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNwidth,  IW_FEA); n++;
XtSetArg(args[n], XmNbottomAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNheight, IH_FEA); n++;

XtSetArg(args[n], XmNorientation, XmVERTICAL); n++;
XtSetArg(args[n], XmNpacking, XmPACK_COLUMN); n++;

XtSetArg(args[n], XmNresizeWidth, FALSE); n++;
XtSetArg(args[n], XmNresizeHeight, FALSE); n++;

hw[52]= XmCreateRadioBox(hw[51],"hw[52]",args, n);
                              
/*======================================================================
* Toggle -C
*=====================================================================*/
n = 0;
                               
strcpy(cstring,"Z88F -C");
cxstring = XmStringCreateLtoR(cstring, "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

XtSetArg(args[n], XmNset, TRUE ); n++;

XtSetArg(args[n], XmNrecomputeSize, TRUE ); n++;

hw[53]= XmCreateToggleButton(hw[52],"hw[53]",args, n);

XtManageChild(hw[53]);

XtAddCallback(hw[53],XmNvalueChangedCallback,
  (XtCallbackProc) CB_Z88F,(XtPointer) IDM_Z88FCOM);

/*======================================================================
* Toggle -T
*=====================================================================*/
n = 0;
                               
strcpy(cstring,"Z88F -T");
cxstring = XmStringCreateLtoR(cstring, "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

XtSetArg(args[n], XmNrecomputeSize, TRUE ); n++;

hw[54]= XmCreateToggleButton(hw[52],"hw[54]",args, n);

XtManageChild(hw[54]);

XtAddCallback(hw[54],XmNvalueChangedCallback,
  (XtCallbackProc) CB_Z88F,(XtPointer) IDM_Z88FTES);

/*======================================================================
* Toggle -N
*=====================================================================*/
n = 0;
                               
strcpy(cstring,"Z88F -N");
cxstring = XmStringCreateLtoR(cstring, "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

XtSetArg(args[n], XmNrecomputeSize, TRUE ); n++;

hw[55]= XmCreateToggleButton(hw[52],"hw[55]",args, n);

XtManageChild(hw[55]);

XtAddCallback(hw[55],XmNvalueChangedCallback,
  (XtCallbackProc) CB_Z88F,(XtPointer) IDM_Z88FNEU);

/*======================================================================
* Toggle -A
*=====================================================================*/
n = 0;
                               
strcpy(cstring,"Z88F -A");
cxstring = XmStringCreateLtoR(cstring, "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

XtSetArg(args[n], XmNrecomputeSize, TRUE ); n++;

hw[56]= XmCreateToggleButton(hw[52],"hw[56]",args, n);

XtManageChild(hw[56]);

XtAddCallback(hw[56],XmNvalueChangedCallback,
  (XtCallbackProc) CB_Z88F,(XtPointer) IDM_Z88FALT);

/*======================================================================
* Toggle Iterationssolver Z88I1
*=====================================================================*/
n = 0;
                               
strcpy(cstring,"Z88I1");
cxstring = XmStringCreateLtoR(cstring, "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

XtSetArg(args[n], XmNrecomputeSize, TRUE ); n++;

hw[57]= XmCreateToggleButton(hw[52],"hw[57]",args, n);

XtManageChild(hw[57]);

XtAddCallback(hw[57],XmNvalueChangedCallback,
  (XtCallbackProc) CB_Z88F,(XtPointer) IDM_Z88II1);

/*======================================================================
* Toggle Iterationssolver Z88I2 -C
*=====================================================================*/
n = 0;
                               
strcpy(cstring,"Z88I2 -C");
cxstring = XmStringCreateLtoR(cstring, "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

XtSetArg(args[n], XmNrecomputeSize, TRUE ); n++;

hw[58]= XmCreateToggleButton(hw[52],"hw[58]",args, n);

XtManageChild(hw[58]);

XtAddCallback(hw[58],XmNvalueChangedCallback,
  (XtCallbackProc) CB_Z88F,(XtPointer) IDM_Z88II2C);


/*======================================================================
* Toggle Iterationssolver Z88I2 -S
*=====================================================================*/
n = 0;
                               
strcpy(cstring,"Z88I2 -S");
cxstring = XmStringCreateLtoR(cstring, "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

XtSetArg(args[n], XmNrecomputeSize, TRUE ); n++;

hw[59]= XmCreateToggleButton(hw[52],"hw[59]",args, n);

XtManageChild(hw[59]);

XtAddCallback(hw[59],XmNvalueChangedCallback,
  (XtCallbackProc) CB_Z88F,(XtPointer) IDM_Z88II2S);

XtManageChild(hw[52]); /* Radiobox FEA */


/*----------------------------------------------------------------------
* Statuszeile- Frame
*---------------------------------------------------------------------*/
/*======================================================================
* Frame
*=====================================================================*/
n = 0;

XtSetArg(args[n], XmNleftAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNx, IX_STATUS); n++;
XtSetArg(args[n], XmNtopAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNy, IY_STATUS); n++;
XtSetArg(args[n], XmNrightAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNwidth,  IW_STATUS); n++;
XtSetArg(args[n], XmNbottomAttachment, XmATTACH_SELF); n++;
XtSetArg(args[n], XmNheight, IH_STATUS); n++;
/* XtSetArg(args[n], XmNshadowType, XmSHADOW_IN); n++; */

hw[63]= XmCreateFrame(hform, "hw[63]", args, n);

XtManageChild(hw[63]);

/*======================================================================
* Statuszeile
*=====================================================================*/
n = 0;

if(LANG == 1) strcpy(cstring,"Aktion");
if(LANG == 2) strcpy(cstring,"Action");
cxstring = XmStringCreateLtoR(cstring, "cf_fsmall");
XtSetArg(args[n], XmNlabelString, cxstring); n++;
XtSetArg(args[n], XmNfontList, fontlist); n++;
XtSetArg(args[n], XmNforeground, fg); n++;

hw[64] = XmCreateLabel(hw[63],"hw[64]",args, n);

XtManageChild(hw[64]);

/*----------------------------------------------------------------------
* String freigeben
*---------------------------------------------------------------------*/
if(cxstring) XmStringFree(cxstring);

/*----------------------------------------------------------------------
* Fontliste freigeben
*---------------------------------------------------------------------*/
if(fontlist) XmFontListFree(fontlist);

/*----------------------------------------------------------------------
* Ende WindowProcedure
*---------------------------------------------------------------------*/
return hform;
}

