/******************************************************************************* transientShell3.c *******************************************************************************/ #include #include "UxLib.h" #include "UxSep.h" #include "UxTogBG.h" #include "UxRowCol.h" #include "UxTogB.h" #include "UxLabel.h" #include "UxPushB.h" #include "UxText.h" #include "UxForm.h" #include "UxTranSh.h" /******************************************************************************* Includes, Defines, and Global variables from the Declarations Editor: *******************************************************************************/ #include #include char *instr[] = {"EMMI","SUSI"}; extern char print_com[], mid_mail[]; extern swidget scrolledList1; /******************************************************************************* The definition of the context structure: If you create multiple instances of your interface, the context structure ensures that your callbacks use the variables for the correct instance. For each swidget in the interface, each argument to the Interface function, and each variable in the Instance Specific section of the Declarations Editor, there is an entry in the context structure. and a #define. The #define makes the variable name refer to the corresponding entry in the context structure. *******************************************************************************/ typedef struct { swidget UxtransientShell3; swidget UxworkArea3; swidget UxSHelp3; swidget UxNewsButton3; swidget UxPrintButton3; swidget Uxlabel4; swidget Uxlabel3; swidget Uxlabel1; swidget Uxlabel2; swidget Uxost_t1; swidget Uxost_t2; swidget UxpushButton4; swidget UxpushButton5; swidget Uxost_t3; swidget Uxost_to1; swidget Uxlabel6; swidget Uxost_to2; swidget UxrowColumn1; swidget UxtoggleButtonGadget1; swidget UxtoggleButtonGadget2; swidget UxtoggleButtonGadget3; swidget Uxseparator1; swidget Uxseparator2; swidget Uxseparator3; swidget Uxseparator4; } _UxCtransientShell3; #define transientShell3 UxTransientShell3Context->UxtransientShell3 #define workArea3 UxTransientShell3Context->UxworkArea3 #define SHelp3 UxTransientShell3Context->UxSHelp3 #define NewsButton3 UxTransientShell3Context->UxNewsButton3 #define PrintButton3 UxTransientShell3Context->UxPrintButton3 #define label4 UxTransientShell3Context->Uxlabel4 #define label3 UxTransientShell3Context->Uxlabel3 #define label1 UxTransientShell3Context->Uxlabel1 #define label2 UxTransientShell3Context->Uxlabel2 #define ost_t1 UxTransientShell3Context->Uxost_t1 #define ost_t2 UxTransientShell3Context->Uxost_t2 #define pushButton4 UxTransientShell3Context->UxpushButton4 #define pushButton5 UxTransientShell3Context->UxpushButton5 #define ost_t3 UxTransientShell3Context->Uxost_t3 #define ost_to1 UxTransientShell3Context->Uxost_to1 #define label6 UxTransientShell3Context->Uxlabel6 #define ost_to2 UxTransientShell3Context->Uxost_to2 #define rowColumn1 UxTransientShell3Context->UxrowColumn1 #define toggleButtonGadget1 UxTransientShell3Context->UxtoggleButtonGadget1 #define toggleButtonGadget2 UxTransientShell3Context->UxtoggleButtonGadget2 #define toggleButtonGadget3 UxTransientShell3Context->UxtoggleButtonGadget3 #define separator1 UxTransientShell3Context->Uxseparator1 #define separator2 UxTransientShell3Context->Uxseparator2 #define separator3 UxTransientShell3Context->Uxseparator3 #define separator4 UxTransientShell3Context->Uxseparator4 static _UxCtransientShell3 *UxTransientShell3Context; /******************************************************************************* The following are translation tables. *******************************************************************************/ static char *transTable2 = "#override\n\ :WriteHelp ()\n\ :ClearHelp ()\n"; /******************************************************************************* Forward declarations of functions that are defined later in this file. *******************************************************************************/ swidget create_transientShell3(); /******************************************************************************* The following are Action functions. *******************************************************************************/ static void action_HInit( UxWidget, UxEvent, UxParams, p_UxNumParams ) Widget UxWidget; XEvent *UxEvent; String *UxParams; Cardinal *p_UxNumParams; { Cardinal UxNumParams = *p_UxNumParams; _UxCtransientShell3 *UxSaveCtx, *UxContext; swidget UxThisWidget; UxThisWidget = UxWidgetToSwidget( UxWidget ); UxSaveCtx = UxTransientShell3Context; UxTransientShell3Context = UxContext = (_UxCtransientShell3 *) UxGetContext( UxThisWidget ); { } UxTransientShell3Context = UxSaveCtx; } static void action_ClearHelp( UxWidget, UxEvent, UxParams, p_UxNumParams ) Widget UxWidget; XEvent *UxEvent; String *UxParams; Cardinal *p_UxNumParams; { Cardinal UxNumParams = *p_UxNumParams; _UxCtransientShell3 *UxSaveCtx, *UxContext; swidget UxThisWidget; UxThisWidget = UxWidgetToSwidget( UxWidget ); UxSaveCtx = UxTransientShell3Context; UxTransientShell3Context = UxContext = (_UxCtransientShell3 *) UxGetContext( UxThisWidget ); { UxPutText(UxFindSwidget("SHelp"),""); } UxTransientShell3Context = UxSaveCtx; } static void action_WriteHelp( UxWidget, UxEvent, UxParams, p_UxNumParams ) Widget UxWidget; XEvent *UxEvent; String *UxParams; Cardinal *p_UxNumParams; { Cardinal UxNumParams = *p_UxNumParams; _UxCtransientShell3 *UxSaveCtx, *UxContext; swidget UxThisWidget; UxThisWidget = UxWidgetToSwidget( UxWidget ); UxSaveCtx = UxTransientShell3Context; UxTransientShell3Context = UxContext = (_UxCtransientShell3 *) UxGetContext( UxThisWidget ); { char s[100],comm[160] ; extern char print_com[]; Widget sw = UxWidget; strcpy(s,""); /*sprintf(comm,"WRITE/OUT here"); AppendDialogText(comm);*/ if (sw == UxGetWidget(UxFindSwidget("ColButton"))) { strcpy(s,"Select the OST columns to be displayed into the scrolled window"); UxPutText(UxFindSwidget("SHelp") ,s); } else if (sw == UxGetWidget(UxFindSwidget("ClassiButton"))) { strcpy(s,"Activate interface for defining classification rules "); UxPutText(UxFindSwidget("SHelp") ,s); } else if (sw == UxGetWidget(UxFindSwidget("AssoButton"))) { strcpy(s,"Activate interface for classifying images"); UxPutText(UxFindSwidget("SHelp") ,s); } else if (sw == UxGetWidget(UxFindSwidget("AssoButton1"))) { strcpy(s,"Activate interface for associating calibration exposures to scientific frames"); UxPutText(UxFindSwidget("SHelp") ,s); } else if (sw == UxGetWidget(UxFindSwidget("NewsButton3"))) { strcpy(s,"Create the OST table"); UxPutText(UxFindSwidget("SHelp3") ,s); } else if (sw == UxGetWidget(UxFindSwidget("PrintButton3"))) { strcpy(s,"Popdown this interface"); UxPutText(UxFindSwidget("SHelp3") ,s); } else if (sw == UxGetWidget(UxFindSwidget("ost_t1"))){ strcpy(s,"Name of the Observation Summary Table to be created "); UxPutText(UxFindSwidget("SHelp3") ,s); } else if (sw == UxGetWidget(UxFindSwidget("ost_t2"))){ strcpy(s,"List of frames to be processed "); UxPutText(UxFindSwidget("SHelp3") ,s); } else if (sw == UxGetWidget(UxFindSwidget("ost_t3"))){ strcpy(s,"Name of the table containing the list of relevant Midas descriptors"); UxPutText(UxFindSwidget("SHelp3") ,s); } else if (sw == UxGetWidget(UxFindSwidget("pushButton4"))){ strcpy(s,"Push button to popup the File Selection Box"); UxPutText(UxFindSwidget("SHelp3") ,s); } else if (sw == UxGetWidget(UxFindSwidget("pushButton5"))){ strcpy(s,"Push button to popup the File Selection Box"); UxPutText(UxFindSwidget("SHelp3") ,s); } } UxTransientShell3Context = UxSaveCtx; } /******************************************************************************* The following are callback functions. *******************************************************************************/ static void popupCB_transientShell3( UxWidget, UxClientData, UxCallbackArg ) Widget UxWidget; XtPointer UxClientData, UxCallbackArg; { _UxCtransientShell3 *UxSaveCtx, *UxContext; swidget UxThisWidget; UxThisWidget = UxWidgetToSwidget( UxWidget ); UxSaveCtx = UxTransientShell3Context; UxTransientShell3Context = UxContext = (_UxCtransientShell3 *) UxGetContext( UxThisWidget ); { } UxTransientShell3Context = UxSaveCtx; } static void mapCB_workArea3( UxWidget, UxClientData, UxCallbackArg ) Widget UxWidget; XtPointer UxClientData, UxCallbackArg; { _UxCtransientShell3 *UxSaveCtx, *UxContext; swidget UxThisWidget; UxThisWidget = UxWidgetToSwidget( UxWidget ); UxSaveCtx = UxTransientShell3Context; UxTransientShell3Context = UxContext = (_UxCtransientShell3 *) UxGetContext( UxThisWidget ); { } UxTransientShell3Context = UxSaveCtx; } static void createCB_workArea3( UxWidget, UxClientData, UxCallbackArg ) Widget UxWidget; XtPointer UxClientData, UxCallbackArg; { _UxCtransientShell3 *UxSaveCtx, *UxContext; swidget UxThisWidget; UxThisWidget = UxWidgetToSwidget( UxWidget ); UxSaveCtx = UxTransientShell3Context; UxTransientShell3Context = UxContext = (_UxCtransientShell3 *) UxGetContext( UxThisWidget ); { } UxTransientShell3Context = UxSaveCtx; } static void activateCB_SHelp3( UxWidget, UxClientData, UxCallbackArg ) Widget UxWidget; XtPointer UxClientData, UxCallbackArg; { _UxCtransientShell3 *UxSaveCtx, *UxContext; swidget UxThisWidget; UxThisWidget = UxWidgetToSwidget( UxWidget ); UxSaveCtx = UxTransientShell3Context; UxTransientShell3Context = UxContext = (_UxCtransientShell3 *) UxGetContext( UxThisWidget ); { } UxTransientShell3Context = UxSaveCtx; } static void activateCB_NewsButton3( UxWidget, UxClientData, UxCallbackArg ) Widget UxWidget; XtPointer UxClientData, UxCallbackArg; { _UxCtransientShell3 *UxSaveCtx, *UxContext; swidget UxThisWidget; UxThisWidget = UxWidgetToSwidget( UxWidget ); UxSaveCtx = UxTransientShell3Context; UxTransientShell3Context = UxContext = (_UxCtransientShell3 *) UxGetContext( UxThisWidget ); { char command[160],iframe[60],dtable[60],fflag[8],sflag[8],flag[4],pfix[5]; extern char ostchoice[60]; extern int tidost,tidcomm; int unit; strcpy(ostchoice ,osfsupply(UxGetText(UxFindSwidget("ost_t1")),".tbl")); strncpy(iframe,UxGetText(UxFindSwidget("ost_t2")),60); /*printf("ostchoice: %s\n",iframe);*/ if (iframe[0] == '\0') iframe[0] = '?'; strncpy(dtable,UxGetText(UxFindSwidget("ost_t3")),60); strcpy(fflag ,UxGetSet(UxFindSwidget("ost_to1"))); strcpy(sflag,UxGetSet(UxFindSwidget("ost_to2"))); if (fflag[0] == 't') flag[0] = 'F'; else flag[0] = 'M'; if (sflag[0] == 't') flag[2] = 'F'; else flag[2] = 'N'; flag[1] = 'C'; flag[3] = '\0'; if (tidost != -1) { TCTCLO(tidost); tidost = -1; } TCTOPN( "TAB_COMM",F_IO_MODE,&tidcomm); TCEWRC(tidcomm,1,2,ostchoice); TCEWRC(tidcomm,1,3,dtable); /*SCDWRC(tidost ,"table_descr",1,dtable,1,60,&unit);*/ TCTCLO(tidcomm); tidcomm = -1; strcpy(pfix,"+"); ostcrea(iframe,pfix,dtable,ostchoice,flag); sprintf(command,"CREATE/OST %s ? %s %s %s",iframe,dtable,ostchoice,flag); /*AppendDialogText(command);*/ if (read_ost_table()) { display_ident_table(UxGetWidget(UxFindSwidget("identlist"))); } /*SCDWRC(tidost ,"table_descr",1,dtable,1,60,&unit);*/ } UxTransientShell3Context = UxSaveCtx; } static void activateCB_PrintButton3( UxWidget, UxClientData, UxCallbackArg ) Widget UxWidget; XtPointer UxClientData, UxCallbackArg; { _UxCtransientShell3 *UxSaveCtx, *UxContext; swidget UxThisWidget; UxThisWidget = UxWidgetToSwidget( UxWidget ); UxSaveCtx = UxTransientShell3Context; UxTransientShell3Context = UxContext = (_UxCtransientShell3 *) UxGetContext( UxThisWidget ); { extern swidget crea; UxPopdownInterface(crea); } UxTransientShell3Context = UxSaveCtx; } static void activateCB_pushButton4( UxWidget, UxClientData, UxCallbackArg ) Widget UxWidget; XtPointer UxClientData, UxCallbackArg; { _UxCtransientShell3 *UxSaveCtx, *UxContext; swidget UxThisWidget; UxThisWidget = UxWidgetToSwidget( UxWidget ); UxSaveCtx = UxTransientShell3Context; UxTransientShell3Context = UxContext = (_UxCtransientShell3 *) UxGetContext( UxThisWidget ); { char s[1000]; extern swidget flist; UxPopupInterface(flist,no_grab); } UxTransientShell3Context = UxSaveCtx; } static void activateCB_pushButton5( UxWidget, UxClientData, UxCallbackArg ) Widget UxWidget; XtPointer UxClientData, UxCallbackArg; { _UxCtransientShell3 *UxSaveCtx, *UxContext; swidget UxThisWidget; UxThisWidget = UxWidgetToSwidget( UxWidget ); UxSaveCtx = UxTransientShell3Context; UxTransientShell3Context = UxContext = (_UxCtransientShell3 *) UxGetContext( UxThisWidget ); { extern swidget ilist,dlist; extern int doI; char cbuf1[8],cbuf2[8]; XmString *str; int item_no,i; strcpy(cbuf1,UxGetSet(UxFindSwidget("toggleButtonGadget1"))); strcpy(cbuf2,UxGetSet(UxFindSwidget("toggleButtonGadget2"))); if (cbuf1[0] == 't') { doI = 0; item_no = 2; str = (XmString *)XtMalloc(item_no * sizeof(XmString)); for (i=0; i