/* @(#)RebinShell.c 17.1.1.1 (ES0-DMD) 01/25/02 17:27:20 */ /*=========================================================================== Copyright (C) 1995 European Southern Observatory (ESO) 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 of the License, 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; if not, write to the Free Software Foundation, Inc., 675 Massachusetss Ave, Cambridge, MA 02139, USA. Corresponding concerning ESO-MIDAS should be addressed as follows: Internet e-mail: midas@eso.org Postal address: European Southern Observatory Data Management Division Karl-Schwarzschild-Strasse 2 D 85748 Garching bei Muenchen GERMANY ===========================================================================*/ /******************************************************************************* RebinShell.c *******************************************************************************/ #include #include "UxLib.h" #include "UxSep.h" #include "UxPushB.h" #include "UxLabel.h" #include "UxText.h" #include "UxTogB.h" #include "UxRowCol.h" #include "UxForm.h" #include "UxTopSh.h" /******************************************************************************* Includes, Defines, and Global variables from the Declarations Editor: *******************************************************************************/ #include #include /******************************************************************************* 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 UxRebinShell; swidget UxRebinTopForm; swidget UxRebinRowColumn; swidget UxRebintb1; swidget UxRebintb2; swidget UxRebintb3; swidget UxZRebintext; swidget UxZRebinLabel; swidget UxRebinForm2; swidget Uxseparator4; } _UxCRebinShell; #define RebinShell UxRebinShellContext->UxRebinShell #define RebinTopForm UxRebinShellContext->UxRebinTopForm #define RebinRowColumn UxRebinShellContext->UxRebinRowColumn #define Rebintb1 UxRebinShellContext->UxRebintb1 #define Rebintb2 UxRebinShellContext->UxRebintb2 #define Rebintb3 UxRebinShellContext->UxRebintb3 #define ZRebintext UxRebinShellContext->UxZRebintext #define ZRebinLabel UxRebinShellContext->UxZRebinLabel #define RebinForm2 UxRebinShellContext->UxRebinForm2 #define separator4 UxRebinShellContext->Uxseparator4 static _UxCRebinShell *UxRebinShellContext; swidget OkRebin; swidget CancelRebin; /******************************************************************************* The following are translation tables. *******************************************************************************/ static char *ZTab = "#override\n\ Delete:delete-previous-character()\n\ BackSpace:delete-previous-character()\n\ osfBackSpace:delete-previous-character()\n\ osfDelete:delete-previous-character()\n"; /******************************************************************************* Forward declarations of functions that are defined later in this file. *******************************************************************************/ swidget create_RebinShell(); /******************************************************************************* The following are callback functions. *******************************************************************************/ static void createCB_Rebintb1( UxWidget, UxClientData, UxCallbackArg ) Widget UxWidget; XtPointer UxClientData, UxCallbackArg; { _UxCRebinShell *UxSaveCtx, *UxContext; swidget UxThisWidget; UxThisWidget = UxWidgetToSwidget( UxWidget ); UxSaveCtx = UxRebinShellContext; UxRebinShellContext = UxContext = (_UxCRebinShell *) UxGetContext( UxThisWidget ); { rebinOption = ZOPT; } UxRebinShellContext = UxSaveCtx; } static void armCB_Rebintb1( UxWidget, UxClientData, UxCallbackArg ) Widget UxWidget; XtPointer UxClientData, UxCallbackArg; { _UxCRebinShell *UxSaveCtx, *UxContext; swidget UxThisWidget; UxThisWidget = UxWidgetToSwidget( UxWidget ); UxSaveCtx = UxRebinShellContext; UxRebinShellContext = UxContext = (_UxCRebinShell *) UxGetContext( UxThisWidget ); { rebinOption= ZOPT; } UxRebinShellContext = UxSaveCtx; } static void armCB_Rebintb2( UxWidget, UxClientData, UxCallbackArg ) Widget UxWidget; XtPointer UxClientData, UxCallbackArg; { _UxCRebinShell *UxSaveCtx, *UxContext; swidget UxThisWidget; UxThisWidget = UxWidgetToSwidget( UxWidget ); UxSaveCtx = UxRebinShellContext; UxRebinShellContext = UxContext = (_UxCRebinShell *) UxGetContext( UxThisWidget ); { rebinOption=LOGOPT; } UxRebinShellContext = UxSaveCtx; } static void armCB_Rebintb3( UxWidget, UxClientData, UxCallbackArg ) Widget UxWidget; XtPointer UxClientData, UxCallbackArg; { _UxCRebinShell *UxSaveCtx, *UxContext; swidget UxThisWidget; UxThisWidget = UxWidgetToSwidget( UxWidget ); UxSaveCtx = UxRebinShellContext; UxRebinShellContext = UxContext = (_UxCRebinShell *) UxGetContext( UxThisWidget ); { rebinOption = INVOPT; } UxRebinShellContext = UxSaveCtx; } static void activateCB_OkRebin( UxWidget, UxClientData, UxCallbackArg ) Widget UxWidget; XtPointer UxClientData, UxCallbackArg; { _UxCRebinShell *UxSaveCtx, *UxContext; swidget UxThisWidget; UxThisWidget = UxWidgetToSwidget( UxWidget ); UxSaveCtx = UxRebinShellContext; UxRebinShellContext = UxContext = (_UxCRebinShell *) UxGetContext( UxThisWidget ); { float z,X[MAXVALUES],Y[MAXVALUES]; int i; sscanf(UxGetText(UxFindSwidget("ZRebintext")),"%f",&z); for(i=0;i