/************************************************************************ ** ** FILE : stepspop.c ** ** ZWECK : ** ** AUTOR : Michael C. Ancutici ** Universitaet Stuttgart, Fakultaet Informatik ** ** DATUM : 14.03.93 ** *************************************************************************/ #include "stepspop.h" #include "steps.h" #include "misc.h" #include "hastepmisc.h" #include "hawin.h" #include #include #include /************************************************************************* ** FUNKTION: StepsWinPopup ** ZWECK: ** EINGABE: ** AUSGABE: ** RETURN: ** ANMERK: *************************************************************************/ void StepsWinPopup( w, event, params, num_params) Widget w; XEvent *event; String *params; Cardinal *num_params; { STRING t; Position x,y; sprintf( t, "%d", StepsNoOfSteps); XtVaSetValues( StepsText, XtNstring, t, NULL); XtVaSetValues( StepsText, XtNinsertPosition, strlen( t), NULL); XtTranslateCoords( w, /* berechne absolute Koordinaten*/ (Position) 0, (Position) 0, &x, &y); XtVaSetValues( StepsShell, XtNx, x-6, XtNy, y-45, NULL); XtPopup( StepsShell, XtGrabExclusive); XFlush( XtDisplay( StepsShell)); } /************************************************************************* ** FUNKTION: StepsSayCancel ** ZWECK: ** EINGABE: ** AUSGABE: ** RETURN: ** ANMERK: *************************************************************************/ void StepsSayCancel( w, client_data, call_data) Widget w; XtPointer client_data, call_data; { XtPopdown( StepsShell); XtVaSetValues( HaStepToggle, XtNstate, FALSE, NULL); XFlush( XtDisplay( StepsShell)); } /************************************************************************* ** FUNKTION: StepsSayOK ** ZWECK: ** EINGABE: ** AUSGABE: ** RETURN: ** ANMERK: *************************************************************************/ void StepsSayOK( w, client_data, call_data) Widget w; XtPointer client_data, call_data; { String text; int i; XtVaGetValues( StepsText, XtNstring, &text, NULL); if ( (sscanf( text, "%d",&i)) && (i>0)) StepsNoOfSteps = i; XtPopdown( StepsShell); XSync( MyDisplay, 0); HaWinSayStep( w, (XtPointer)StepsNoOfSteps, call_data); }