/************************************************************************ ** ** FILE : trawininst.c ** ** ZWECK : ** ** AUTOR : Michael C. Ancutici ** Universitaet Stuttgart, Fakultaet Informatik ** ** DATUM : 14.03.93 ** *************************************************************************/ #include "trawin.H" #include "hawin.h" #include "itradel" void TraWinPressOK( w, event, params, num_params) Widget w; XEvent *event; String *params; Cardinal *num_params; { TraWinSayOK(w, (XtPointer)0, (XtPointer)0); } void TraWinPressCan( w, event, params, num_params) Widget w; XEvent *event; String *params; Cardinal *num_params; { TraWinSayCancel(w, (XtPointer)0, (XtPointer)0); } void TraWinInst( Parent) Widget Parent; { Dimension w1,h1; Position x,y; static Pixmap ITraDelPixMap; static XtActionsRec window_actions[] = { {"TraWinPressOK", TraWinPressOK}, {"TraWinPressCan", TraWinPressCan}}; static char *TraLabel[] = { "Name : ", "Priority : ", "Stop after fire : ", "OK", "Cancel"}; TraShell = XtVaCreatePopupShell( "TraShell", transientShellWidgetClass, Parent, NULL); TraPane = XtVaCreateManagedWidget( "TraPane", /* widget name */ panedWidgetClass, /* widget class */ TraShell, /* parent widget */ NULL); /* terminate argument list */ TraAForm = XtVaCreateManagedWidget( "TraAForm", /* widget name */ formWidgetClass, /* widget class */ TraPane, /* parent widget */ NULL); /* terminate argument list */ TraNrLabel = XtVaCreateManagedWidget( "TraNrLabel", /* widget name */ labelWidgetClass, /* widget class */ TraAForm, /* parent widget */ XtNlabel, "Transition nnn", NULL); /* terminate argument list */ TraNameLabel = XtVaCreateManagedWidget( "TraNameLabel", /* widget name */ labelWidgetClass, /* widget class */ TraAForm, /* parent widget */ XtNlabel, TraLabel[0], NULL); /* terminate argument list */ TraNameText = XtVaCreateManagedWidget( "TraNameText", /* widget name */ asciiTextWidgetClass, /* widget class */ TraAForm, /* parent widget */ XtNstring, "1234567890", XtNeditType,XawtextEdit, /* argument list */ NULL); /* terminate argument list */ TraPrioLabel = XtVaCreateManagedWidget( "TraPrioLabel", /* widget name */ labelWidgetClass, /* widget class */ TraAForm, /* parent widget */ XtNlabel, TraLabel[1], NULL); /* terminate argument list */ TraPrioText = XtVaCreateManagedWidget( "TraPrioText", /* widget name */ asciiTextWidgetClass, /* widget class */ TraAForm, /* parent widget */ XtNstring, "123", XtNeditType,XawtextEdit, /* argument list */ NULL); /* terminate argument list */ TraBreakLabel = XtVaCreateManagedWidget( "TraBreakLabel", /* widget name */ labelWidgetClass, /* widget class */ TraAForm, /* parent widget */ XtNlabel, TraLabel[2], NULL); /* terminate argument list */ TraBreakCom = XtVaCreateManagedWidget( "TraBreakCom", /* widget name */ commandWidgetClass, /* widget class */ TraAForm, /* parent widget */ XtNlabel, TRA_OFF_LABEL, NULL); /* terminate argument list */ TraWinBreak = TRUE; TraBPane = XtVaCreateManagedWidget( "TraBPane", /* widget name */ panedWidgetClass, /* widget class */ TraPane, /* parent widget */ XtNorientation, XtEvertical, NULL); /* terminate argument list */ TraOKCom = XtVaCreateManagedWidget( "TraOKCom", /* widget name */ commandWidgetClass, /* widget class */ TraBPane, /* parent widget */ XtNlabel, TraLabel[3], NULL); /* terminate argument list */ TraCanCom = XtVaCreateManagedWidget( "TraCanCom", /* widget name */ commandWidgetClass, /* widget class */ TraBPane, /* parent widget */ XtNlabel, TraLabel[4], NULL); /* terminate argument list */ ITraDelPixMap = XCreateBitmapFromData( XtDisplay( TraShell), RootWindowOfScreen( XtScreen( TraShell)), itradel_bits, itradel_width, itradel_height ); TraDLabel = XtVaCreateManagedWidget( "TraDLabel", /* widget name */ labelWidgetClass, /* widget class */ TraBPane, /* parent widget */ XtNlabel, "", NULL); /* terminate argument list */ TraDelCom = XtVaCreateManagedWidget( "TraDelCom", /* widget name */ commandWidgetClass, /* widget class */ TraBPane, /* parent widget */ XtNbitmap, ITraDelPixMap, XtNmax, 40, NULL); /* terminate argument list */ XtTranslateCoords( HaGraphPlane, /* berechne absolute Koordinaten*/ (Position) 20, (Position) 20, &x, &y); XtVaSetValues( TraShell, /* Positioniere AskShell */ XtNx, x, XtNy, y, NULL); XtAppAddActions( AppContext, window_actions, XtNumber(window_actions)); XtAddCallback( TraOKCom, XtNcallback, TraWinSayOK, 0); XtAddCallback( TraBreakCom, XtNcallback, TraWinSayBreak, 0); XtAddCallback( TraCanCom, XtNcallback, TraWinSayCancel, 0); XtAddCallback( TraDelCom, XtNcallback, TraWinSayDel, 0); }