| 1 |
/*=========================================================================== |
| 2 |
Copyright (C) 1995-2009 European Southern Observatory (ESO) |
| 3 |
|
| 4 |
This program is free software; you can redistribute it and/or |
| 5 |
modify it under the terms of the GNU General Public License as |
| 6 |
published by the Free Software Foundation; either version 2 of |
| 7 |
the License, or (at your option) any later version. |
| 8 |
|
| 9 |
This program is distributed in the hope that it will be useful, |
| 10 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 |
GNU General Public License for more details. |
| 13 |
|
| 14 |
You should have received a copy of the GNU General Public |
| 15 |
License along with this program; if not, write to the Free |
| 16 |
Software Foundation, Inc., 675 Massachusetts Ave, Cambridge, |
| 17 |
MA 02139, USA. |
| 18 |
|
| 19 |
Correspondence concerning ESO-MIDAS should be addressed as follows: |
| 20 |
Internet e-mail: [email protected] |
| 21 |
Postal address: European Southern Observatory |
| 22 |
Data Management Division |
| 23 |
Karl-Schwarzschild-Strasse 2 |
| 24 |
D 85748 Garching bei Muenchen |
| 25 |
GERMANY |
| 26 |
===========================================================================*/ |
| 27 |
|
| 28 |
|
| 29 |
/******************************************************************************* |
| 30 |
FlatShell.c |
| 31 |
|
| 32 |
.VERSION |
| 33 |
090825 last modif |
| 34 |
|
| 35 |
*******************************************************************************/ |
| 36 |
|
| 37 |
#include <stdio.h> |
| 38 |
#include "UxLib.h" |
| 39 |
#include "UxLabel.h" |
| 40 |
#include "UxTextF.h" |
| 41 |
#include "UxSep.h" |
| 42 |
#include "UxText.h" |
| 43 |
#include "UxPushB.h" |
| 44 |
#include "UxForm.h" |
| 45 |
#include "UxTranSh.h" |
| 46 |
|
| 47 |
#include "proto_xech.h" |
| 48 |
|
| 49 |
/******************************************************************************* |
| 50 |
Includes, Defines, and Global variables from the Declarations Editor: |
| 51 |
*******************************************************************************/ |
| 52 |
|
| 53 |
#include <ExternResources.h> |
| 54 |
|
| 55 |
/******************************************************************************* |
| 56 |
The definition of the context structure: |
| 57 |
If you create multiple instances of your interface, the context |
| 58 |
structure ensures that your callbacks use the variables for the |
| 59 |
correct instance. |
| 60 |
|
| 61 |
For each swidget in the interface, each argument to the Interface |
| 62 |
function, and each variable in the Instance Specific section of the |
| 63 |
Declarations Editor, there is an entry in the context structure. |
| 64 |
and a #define. The #define makes the variable name refer to the |
| 65 |
corresponding entry in the context structure. |
| 66 |
*******************************************************************************/ |
| 67 |
|
| 68 |
typedef struct |
| 69 |
{ |
| 70 |
swidget UxFlatShell; |
| 71 |
swidget Uxform37; |
| 72 |
swidget Uxform38; |
| 73 |
swidget Uxpb_search_search10; |
| 74 |
swidget UxpushButton7; |
| 75 |
swidget Uxpb_search_plot21; |
| 76 |
swidget Uxpb_search_plot24; |
| 77 |
swidget Uxshelp_search7; |
| 78 |
swidget Uxseparator30; |
| 79 |
swidget Uxseparator31; |
| 80 |
swidget Uxtf_alpha35; |
| 81 |
swidget Uxtf_alpha36; |
| 82 |
swidget Uxtf_alpha37; |
| 83 |
swidget Uxlabel114; |
| 84 |
swidget Uxpb_main_search25; |
| 85 |
swidget Uxpb_main_search26; |
| 86 |
swidget Uxpb_main_search27; |
| 87 |
swidget Uxlabel115; |
| 88 |
swidget Uxlabel116; |
| 89 |
swidget Uxpb_search_plot26; |
| 90 |
swidget Uxpb_search_plot27; |
| 91 |
swidget Uxtf_alpha11; |
| 92 |
swidget Uxlabel6; |
| 93 |
} _UxCFlatShell; |
| 94 |
|
| 95 |
#define FlatShell UxFlatShellContext->UxFlatShell |
| 96 |
#define form37 UxFlatShellContext->Uxform37 |
| 97 |
#define form38 UxFlatShellContext->Uxform38 |
| 98 |
#define pb_search_search10 UxFlatShellContext->Uxpb_search_search10 |
| 99 |
#define pushButton7 UxFlatShellContext->UxpushButton7 |
| 100 |
#define pb_search_plot21 UxFlatShellContext->Uxpb_search_plot21 |
| 101 |
#define pb_search_plot24 UxFlatShellContext->Uxpb_search_plot24 |
| 102 |
#define shelp_search7 UxFlatShellContext->Uxshelp_search7 |
| 103 |
#define separator30 UxFlatShellContext->Uxseparator30 |
| 104 |
#define separator31 UxFlatShellContext->Uxseparator31 |
| 105 |
#define tf_alpha35 UxFlatShellContext->Uxtf_alpha35 |
| 106 |
#define tf_alpha36 UxFlatShellContext->Uxtf_alpha36 |
| 107 |
#define tf_alpha37 UxFlatShellContext->Uxtf_alpha37 |
| 108 |
#define label114 UxFlatShellContext->Uxlabel114 |
| 109 |
#define pb_main_search25 UxFlatShellContext->Uxpb_main_search25 |
| 110 |
#define pb_main_search26 UxFlatShellContext->Uxpb_main_search26 |
| 111 |
#define pb_main_search27 UxFlatShellContext->Uxpb_main_search27 |
| 112 |
#define label115 UxFlatShellContext->Uxlabel115 |
| 113 |
#define label116 UxFlatShellContext->Uxlabel116 |
| 114 |
#define pb_search_plot26 UxFlatShellContext->Uxpb_search_plot26 |
| 115 |
#define pb_search_plot27 UxFlatShellContext->Uxpb_search_plot27 |
| 116 |
#define tf_alpha11 UxFlatShellContext->Uxtf_alpha11 |
| 117 |
#define label6 UxFlatShellContext->Uxlabel6 |
| 118 |
|
| 119 |
static _UxCFlatShell *UxFlatShellContext; |
| 120 |
|
| 121 |
extern void DisplayShortHelp(), DisplayExtendedHelp(), SetFileList(); |
| 122 |
extern void MidasCommand(), PopupLong(), InitAllFields(); |
| 123 |
extern void WidgetLeave(), WidgetEnter(); |
| 124 |
extern void WriteKeyword(), GetExtendedHelp(), SelectList(); |
| 125 |
|
| 126 |
|
| 127 |
/******************************************************************************* |
| 128 |
The following are translation tables. |
| 129 |
*******************************************************************************/ |
| 130 |
|
| 131 |
/******************************************************************************* |
| 132 |
Forward declarations of functions that are defined later in this file. |
| 133 |
*******************************************************************************/ |
| 134 |
|
| 135 |
swidget create_FlatShell(); |
| 136 |
|
| 137 |
/******************************************************************************* |
| 138 |
The following are Action functions. |
| 139 |
*******************************************************************************/ |
| 140 |
|
| 141 |
static void action_UpdateDirectory( UxWidget, UxEvent, UxParams, p_UxNumParams ) |
| 142 |
Widget UxWidget; |
| 143 |
XEvent *UxEvent; |
| 144 |
String *UxParams; |
| 145 |
Cardinal *p_UxNumParams; |
| 146 |
{ |
| 147 |
_UxCFlatShell *UxSaveCtx, *UxContext; |
| 148 |
swidget UxThisWidget; |
| 149 |
|
| 150 |
UxThisWidget = UxWidgetToSwidget( UxWidget ); |
| 151 |
UxSaveCtx = UxFlatShellContext; |
| 152 |
UxFlatShellContext = UxContext = |
| 153 |
(_UxCFlatShell *) UxGetContext( UxThisWidget ); |
| 154 |
{ |
| 155 |
|
| 156 |
char node[80]; |
| 157 |
|
| 158 |
/* if (XmTextGetSelection(UxWidget) == NULL) return; */ |
| 159 |
strcpy(node, |
| 160 |
XmTextGetSelection(UxWidget)); |
| 161 |
XmTextClearSelection(UxWidget,XtLastTimestampProcessed(UxDisplay)); |
| 162 |
|
| 163 |
node[strlen(node)-1] = '\0'; |
| 164 |
WGet_all_dirs(node); |
| 165 |
WChange_Midas_dir(); |
| 166 |
WGet_all_files(); |
| 167 |
|
| 168 |
} |
| 169 |
UxFlatShellContext = UxSaveCtx; |
| 170 |
} |
| 171 |
|
| 172 |
static void action_ClearShort( UxWidget, UxEvent, UxParams, p_UxNumParams ) |
| 173 |
Widget UxWidget; |
| 174 |
XEvent *UxEvent; |
| 175 |
String *UxParams; |
| 176 |
Cardinal *p_UxNumParams; |
| 177 |
{ |
| 178 |
_UxCFlatShell *UxSaveCtx, *UxContext; |
| 179 |
swidget UxThisWidget; |
| 180 |
|
| 181 |
UxThisWidget = UxWidgetToSwidget( UxWidget ); |
| 182 |
UxSaveCtx = UxFlatShellContext; |
| 183 |
UxFlatShellContext = UxContext = |
| 184 |
(_UxCFlatShell *) UxGetContext( UxThisWidget ); |
| 185 |
{WidgetLeave(UxWidget);} |
| 186 |
UxFlatShellContext = UxSaveCtx; |
| 187 |
} |
| 188 |
|
| 189 |
static void action_HelpShort( UxWidget, UxEvent, UxParams, p_UxNumParams ) |
| 190 |
Widget UxWidget; |
| 191 |
XEvent *UxEvent; |
| 192 |
String *UxParams; |
| 193 |
Cardinal *p_UxNumParams; |
| 194 |
{ |
| 195 |
_UxCFlatShell *UxSaveCtx, *UxContext; |
| 196 |
swidget UxThisWidget; |
| 197 |
|
| 198 |
UxThisWidget = UxWidgetToSwidget( UxWidget ); |
| 199 |
UxSaveCtx = UxFlatShellContext; |
| 200 |
UxFlatShellContext = UxContext = |
| 201 |
(_UxCFlatShell *) UxGetContext( UxThisWidget ); |
| 202 |
{WidgetEnter(UxWidget);} |
| 203 |
UxFlatShellContext = UxSaveCtx; |
| 204 |
} |
| 205 |
|
| 206 |
static void action_FileSelectACT( UxWidget, UxEvent, UxParams, p_UxNumParams ) |
| 207 |
Widget UxWidget; |
| 208 |
XEvent *UxEvent; |
| 209 |
String *UxParams; |
| 210 |
Cardinal *p_UxNumParams; |
| 211 |
{ |
| 212 |
_UxCFlatShell *UxSaveCtx, *UxContext; |
| 213 |
swidget UxThisWidget; |
| 214 |
|
| 215 |
UxThisWidget = UxWidgetToSwidget( UxWidget ); |
| 216 |
UxSaveCtx = UxFlatShellContext; |
| 217 |
UxFlatShellContext = UxContext = |
| 218 |
(_UxCFlatShell *) UxGetContext( UxThisWidget ); |
| 219 |
{ |
| 220 |
#include <xm_defs.h> |
| 221 |
#include <spec_comm.h> |
| 222 |
|
| 223 |
extern swidget FileListInterface, TextFieldSwidget; |
| 224 |
extern Widget FileListWidget; |
| 225 |
extern char DirSpecs[]; |
| 226 |
extern int ListType; |
| 227 |
|
| 228 |
int strip = 1; /* strip off */ |
| 229 |
|
| 230 |
TextFieldSwidget = UxThisWidget; |
| 231 |
|
| 232 |
if ( UxWidget == UxGetWidget(UxFindSwidget("tf_lincat")) ) { |
| 233 |
SET_LIST_TITLE("Enter line catalog"); |
| 234 |
ListType = LIST_LINCAT; |
| 235 |
} |
| 236 |
else if ( UxWidget == UxGetWidget(UxFindSwidget("tf_guess")) ) { |
| 237 |
SET_LIST_TITLE("Enter guess table"); |
| 238 |
ListType = LIST_GUESS; |
| 239 |
} |
| 240 |
else if ( UxWidget == UxGetWidget(UxFindSwidget("tf_flux_tbl")) ) { |
| 241 |
SET_LIST_TITLE("Enter flux table"); |
| 242 |
ListType = LIST_FLUX_TBL; |
| 243 |
} |
| 244 |
else if ( UxWidget == UxGetWidget(UxFindSwidget("tf_extin_tbl")) ) { |
| 245 |
SET_LIST_TITLE("Enter extinction table"); |
| 246 |
ListType = LIST_EXTIN_TBL; |
| 247 |
} |
| 248 |
|
| 249 |
strcpy(DirSpecs, "*.tbl"); |
| 250 |
SetFileList(FileListWidget, strip, DirSpecs); |
| 251 |
UxPopupInterface(FileListInterface, exclusive_grab); |
| 252 |
|
| 253 |
} |
| 254 |
UxFlatShellContext = UxSaveCtx; |
| 255 |
} |
| 256 |
|
| 257 |
/******************************************************************************* |
| 258 |
The following are callback functions. |
| 259 |
*******************************************************************************/ |
| 260 |
|
| 261 |
static void activateCB_pb_search_search10( UxWidget, UxClientData, UxCallbackArg ) |
| 262 |
Widget UxWidget; |
| 263 |
XtPointer UxClientData, UxCallbackArg; |
| 264 |
{ |
| 265 |
_UxCFlatShell *UxSaveCtx, *UxContext; |
| 266 |
swidget UxThisWidget; |
| 267 |
|
| 268 |
UxThisWidget = UxWidgetToSwidget( UxWidget ); |
| 269 |
UxSaveCtx = UxFlatShellContext; |
| 270 |
UxFlatShellContext = UxContext = |
| 271 |
(_UxCFlatShell *) UxGetContext( UxThisWidget ); |
| 272 |
{ |
| 273 |
MidasCommand(UxWidget); |
| 274 |
|
| 275 |
} |
| 276 |
UxFlatShellContext = UxSaveCtx; |
| 277 |
} |
| 278 |
|
| 279 |
static void activateCB_pushButton7( UxWidget, UxClientData, UxCallbackArg ) |
| 280 |
Widget UxWidget; |
| 281 |
XtPointer UxClientData, UxCallbackArg; |
| 282 |
{ |
| 283 |
_UxCFlatShell *UxSaveCtx, *UxContext; |
| 284 |
swidget UxThisWidget; |
| 285 |
|
| 286 |
UxThisWidget = UxWidgetToSwidget( UxWidget ); |
| 287 |
UxSaveCtx = UxFlatShellContext; |
| 288 |
UxFlatShellContext = UxContext = |
| 289 |
(_UxCFlatShell *) UxGetContext( UxThisWidget ); |
| 290 |
{ |
| 291 |
UxPopdownInterface(UxFindSwidget("FlatShell")); |
| 292 |
} |
| 293 |
UxFlatShellContext = UxSaveCtx; |
| 294 |
} |
| 295 |
|
| 296 |
static void activateCB_pb_search_plot21( UxWidget, UxClientData, UxCallbackArg ) |
| 297 |
Widget UxWidget; |
| 298 |
XtPointer UxClientData, UxCallbackArg; |
| 299 |
{ |
| 300 |
_UxCFlatShell *UxSaveCtx, *UxContext; |
| 301 |
swidget UxThisWidget; |
| 302 |
|
| 303 |
UxThisWidget = UxWidgetToSwidget( UxWidget ); |
| 304 |
UxSaveCtx = UxFlatShellContext; |
| 305 |
UxFlatShellContext = UxContext = |
| 306 |
(_UxCFlatShell *) UxGetContext( UxThisWidget ); |
| 307 |
{ |
| 308 |
GetExtendedHelp(UxWidget); |
| 309 |
} |
| 310 |
UxFlatShellContext = UxSaveCtx; |
| 311 |
} |
| 312 |
|
| 313 |
static void activateCB_pb_search_plot24( UxWidget, UxClientData, UxCallbackArg ) |
| 314 |
Widget UxWidget; |
| 315 |
XtPointer UxClientData, UxCallbackArg; |
| 316 |
{ |
| 317 |
_UxCFlatShell *UxSaveCtx, *UxContext; |
| 318 |
swidget UxThisWidget; |
| 319 |
|
| 320 |
UxThisWidget = UxWidgetToSwidget( UxWidget ); |
| 321 |
UxSaveCtx = UxFlatShellContext; |
| 322 |
UxFlatShellContext = UxContext = |
| 323 |
(_UxCFlatShell *) UxGetContext( UxThisWidget ); |
| 324 |
{ |
| 325 |
MidasCommand(UxWidget); |
| 326 |
|
| 327 |
} |
| 328 |
UxFlatShellContext = UxSaveCtx; |
| 329 |
} |
| 330 |
|
| 331 |
static void losingFocusCB_tf_alpha35( UxWidget, UxClientData, UxCallbackArg ) |
| 332 |
Widget UxWidget; |
| 333 |
XtPointer UxClientData, UxCallbackArg; |
| 334 |
{ |
| 335 |
_UxCFlatShell *UxSaveCtx, *UxContext; |
| 336 |
swidget UxThisWidget; |
| 337 |
|
| 338 |
UxThisWidget = UxWidgetToSwidget( UxWidget ); |
| 339 |
UxSaveCtx = UxFlatShellContext; |
| 340 |
UxFlatShellContext = UxContext = |
| 341 |
(_UxCFlatShell *) UxGetContext( UxThisWidget ); |
| 342 |
{ |
| 343 |
|
| 344 |
} |
| 345 |
UxFlatShellContext = UxSaveCtx; |
| 346 |
} |
| 347 |
|
| 348 |
static void losingFocusCB_tf_alpha36( UxWidget, UxClientData, UxCallbackArg ) |
| 349 |
Widget UxWidget; |
| 350 |
XtPointer UxClientData, UxCallbackArg; |
| 351 |
{ |
| 352 |
_UxCFlatShell *UxSaveCtx, *UxContext; |
| 353 |
swidget UxThisWidget; |
| 354 |
|
| 355 |
UxThisWidget = UxWidgetToSwidget( UxWidget ); |
| 356 |
UxSaveCtx = UxFlatShellContext; |
| 357 |
UxFlatShellContext = UxContext = |
| 358 |
(_UxCFlatShell *) UxGetContext( UxThisWidget ); |
| 359 |
{ |
| 360 |
|
| 361 |
} |
| 362 |
UxFlatShellContext = UxSaveCtx; |
| 363 |
} |
| 364 |
|
| 365 |
static void losingFocusCB_tf_alpha37( UxWidget, UxClientData, UxCallbackArg ) |
| 366 |
Widget UxWidget; |
| 367 |
XtPointer UxClientData, UxCallbackArg; |
| 368 |
{ |
| 369 |
_UxCFlatShell *UxSaveCtx, *UxContext; |
| 370 |
swidget UxThisWidget; |
| 371 |
|
| 372 |
UxThisWidget = UxWidgetToSwidget( UxWidget ); |
| 373 |
UxSaveCtx = UxFlatShellContext; |
| 374 |
UxFlatShellContext = UxContext = |
| 375 |
(_UxCFlatShell *) UxGetContext( UxThisWidget ); |
| 376 |
{ |
| 377 |
|
| 378 |
} |
| 379 |
UxFlatShellContext = UxSaveCtx; |
| 380 |
} |
| 381 |
|
| 382 |
static void activateCB_pb_main_search25( UxWidget, UxClientData, UxCallbackArg ) |
| 383 |
Widget UxWidget; |
| 384 |
XtPointer UxClientData, UxCallbackArg; |
| 385 |
{ |
| 386 |
_UxCFlatShell *UxSaveCtx, *UxContext; |
| 387 |
swidget UxThisWidget; |
| 388 |
|
| 389 |
UxThisWidget = UxWidgetToSwidget( UxWidget ); |
| 390 |
UxSaveCtx = UxFlatShellContext; |
| 391 |
UxFlatShellContext = UxContext = |
| 392 |
(_UxCFlatShell *) UxGetContext( UxThisWidget ); |
| 393 |
{ |
| 394 |
SelectList(UxWidget); |
| 395 |
|
| 396 |
} |
| 397 |
UxFlatShellContext = UxSaveCtx; |
| 398 |
} |
| 399 |
|
| 400 |
static void activateCB_pb_main_search26( UxWidget, UxClientData, UxCallbackArg ) |
| 401 |
Widget UxWidget; |
| 402 |
XtPointer UxClientData, UxCallbackArg; |
| 403 |
{ |
| 404 |
_UxCFlatShell *UxSaveCtx, *UxContext; |
| 405 |
swidget UxThisWidget; |
| 406 |
|
| 407 |
UxThisWidget = UxWidgetToSwidget( UxWidget ); |
| 408 |
UxSaveCtx = UxFlatShellContext; |
| 409 |
UxFlatShellContext = UxContext = |
| 410 |
(_UxCFlatShell *) UxGetContext( UxThisWidget ); |
| 411 |
{ |
| 412 |
SelectList(UxWidget); |
| 413 |
|
| 414 |
} |
| 415 |
UxFlatShellContext = UxSaveCtx; |
| 416 |
} |
| 417 |
|
| 418 |
static void activateCB_pb_main_search27( UxWidget, UxClientData, UxCallbackArg ) |
| 419 |
Widget UxWidget; |
| 420 |
XtPointer UxClientData, UxCallbackArg; |
| 421 |
{ |
| 422 |
_UxCFlatShell *UxSaveCtx, *UxContext; |
| 423 |
swidget UxThisWidget; |
| 424 |
|
| 425 |
UxThisWidget = UxWidgetToSwidget( UxWidget ); |
| 426 |
UxSaveCtx = UxFlatShellContext; |
| 427 |
UxFlatShellContext = UxContext = |
| 428 |
(_UxCFlatShell *) UxGetContext( UxThisWidget ); |
| 429 |
{ |
| 430 |
SelectList(UxWidget); |
| 431 |
|
| 432 |
} |
| 433 |
UxFlatShellContext = UxSaveCtx; |
| 434 |
} |
| 435 |
|
| 436 |
static void activateCB_pb_search_plot26( UxWidget, UxClientData, UxCallbackArg ) |
| 437 |
Widget UxWidget; |
| 438 |
XtPointer UxClientData, UxCallbackArg; |
| 439 |
{ |
| 440 |
_UxCFlatShell *UxSaveCtx, *UxContext; |
| 441 |
swidget UxThisWidget; |
| 442 |
|
| 443 |
UxThisWidget = UxWidgetToSwidget( UxWidget ); |
| 444 |
UxSaveCtx = UxFlatShellContext; |
| 445 |
UxFlatShellContext = UxContext = |
| 446 |
(_UxCFlatShell *) UxGetContext( UxThisWidget ); |
| 447 |
{ |
| 448 |
MidasCommand(UxWidget); |
| 449 |
|
| 450 |
} |
| 451 |
UxFlatShellContext = UxSaveCtx; |
| 452 |
} |
| 453 |
|
| 454 |
static void activateCB_pb_search_plot27( UxWidget, UxClientData, UxCallbackArg ) |
| 455 |
Widget UxWidget; |
| 456 |
XtPointer UxClientData, UxCallbackArg; |
| 457 |
{ |
| 458 |
_UxCFlatShell *UxSaveCtx, *UxContext; |
| 459 |
swidget UxThisWidget; |
| 460 |
|
| 461 |
UxThisWidget = UxWidgetToSwidget( UxWidget ); |
| 462 |
UxSaveCtx = UxFlatShellContext; |
| 463 |
UxFlatShellContext = UxContext = |
| 464 |
(_UxCFlatShell *) UxGetContext( UxThisWidget ); |
| 465 |
{ |
| 466 |
MidasCommand(UxWidget); |
| 467 |
|
| 468 |
} |
| 469 |
UxFlatShellContext = UxSaveCtx; |
| 470 |
} |
| 471 |
|
| 472 |
static void losingFocusCB_tf_alpha11( UxWidget, UxClientData, UxCallbackArg ) |
| 473 |
Widget UxWidget; |
| 474 |
XtPointer UxClientData, UxCallbackArg; |
| 475 |
{ |
| 476 |
_UxCFlatShell *UxSaveCtx, *UxContext; |
| 477 |
swidget UxThisWidget; |
| 478 |
|
| 479 |
UxThisWidget = UxWidgetToSwidget( UxWidget ); |
| 480 |
UxSaveCtx = UxFlatShellContext; |
| 481 |
UxFlatShellContext = UxContext = |
| 482 |
(_UxCFlatShell *) UxGetContext( UxThisWidget ); |
| 483 |
{ |
| 484 |
|
| 485 |
} |
| 486 |
UxFlatShellContext = UxSaveCtx; |
| 487 |
} |
| 488 |
|
| 489 |
/******************************************************************************* |
| 490 |
The 'init_' function sets the private properties for all the |
| 491 |
swidgets to the values specified in the Property Table. |
| 492 |
Some properties need to be set after the X widgets have been |
| 493 |
created and the setting of these properties is done in the |
| 494 |
'build_' function after the UxCreateWidget call. |
| 495 |
*******************************************************************************/ |
| 496 |
|
| 497 |
static void _Uxinit_FlatShell() |
| 498 |
{ |
| 499 |
UxPutGeometry( FlatShell, "+10+60" ); |
| 500 |
UxPutHeight( FlatShell, 300 ); |
| 501 |
UxPutWidth( FlatShell, 530 ); |
| 502 |
UxPutY( FlatShell, 574 ); |
| 503 |
UxPutX( FlatShell, 484 ); |
| 504 |
|
| 505 |
UxPutBackground( form37, WindowBackground ); |
| 506 |
UxPutHeight( form37, 348 ); |
| 507 |
UxPutWidth( form37, 408 ); |
| 508 |
UxPutY( form37, -2 ); |
| 509 |
UxPutX( form37, 0 ); |
| 510 |
UxPutUnitType( form37, "pixels" ); |
| 511 |
UxPutResizePolicy( form37, "resize_none" ); |
| 512 |
|
| 513 |
UxPutBackground( form38, ButtonBackground ); |
| 514 |
UxPutHeight( form38, 50 ); |
| 515 |
UxPutWidth( form38, 508 ); |
| 516 |
UxPutY( form38, 240 ); |
| 517 |
UxPutX( form38, 10 ); |
| 518 |
UxPutResizePolicy( form38, "resize_none" ); |
| 519 |
|
| 520 |
UxPutLabelString( pb_search_search10, "Fit and Subtract" ); |
| 521 |
UxPutForeground( pb_search_search10, ApplyForeground ); |
| 522 |
UxPutFontList( pb_search_search10, BoldTextFont ); |
| 523 |
UxPutBackground( pb_search_search10, ButtonBackground ); |
| 524 |
UxPutHeight( pb_search_search10, 30 ); |
| 525 |
UxPutWidth( pb_search_search10, 150 ); |
| 526 |
UxPutY( pb_search_search10, 10 ); |
| 527 |
UxPutX( pb_search_search10, 16 ); |
| 528 |
|
| 529 |
UxPutLabelString( pushButton7, "Cancel" ); |
| 530 |
UxPutForeground( pushButton7, CancelForeground ); |
| 531 |
UxPutFontList( pushButton7, BoldTextFont ); |
| 532 |
UxPutBackground( pushButton7, ButtonBackground ); |
| 533 |
UxPutHeight( pushButton7, 30 ); |
| 534 |
UxPutWidth( pushButton7, 86 ); |
| 535 |
UxPutY( pushButton7, 8 ); |
| 536 |
UxPutX( pushButton7, 412 ); |
| 537 |
|
| 538 |
UxPutLabelString( pb_search_plot21, "Help..." ); |
| 539 |
UxPutForeground( pb_search_plot21, ButtonForeground ); |
| 540 |
UxPutFontList( pb_search_plot21, BoldTextFont ); |
| 541 |
UxPutBackground( pb_search_plot21, ButtonBackground ); |
| 542 |
UxPutHeight( pb_search_plot21, 30 ); |
| 543 |
UxPutWidth( pb_search_plot21, 86 ); |
| 544 |
UxPutY( pb_search_plot21, 10 ); |
| 545 |
UxPutX( pb_search_plot21, 320 ); |
| 546 |
|
| 547 |
UxPutLabelString( pb_search_plot24, "Plot Blaze" ); |
| 548 |
UxPutForeground( pb_search_plot24, ButtonForeground ); |
| 549 |
UxPutFontList( pb_search_plot24, BoldTextFont ); |
| 550 |
UxPutBackground( pb_search_plot24, ButtonBackground ); |
| 551 |
UxPutHeight( pb_search_plot24, 30 ); |
| 552 |
UxPutWidth( pb_search_plot24, 106 ); |
| 553 |
UxPutY( pb_search_plot24, 10 ); |
| 554 |
UxPutX( pb_search_plot24, 202 ); |
| 555 |
|
| 556 |
UxPutFontList( shelp_search7, TextFont ); |
| 557 |
UxPutEditable( shelp_search7, "false" ); |
| 558 |
UxPutCursorPositionVisible( shelp_search7, "false" ); |
| 559 |
UxPutBackground( shelp_search7, SHelpBackground ); |
| 560 |
UxPutHeight( shelp_search7, 50 ); |
| 561 |
UxPutWidth( shelp_search7, 508 ); |
| 562 |
UxPutY( shelp_search7, 182 ); |
| 563 |
UxPutX( shelp_search7, 8 ); |
| 564 |
|
| 565 |
UxPutBackground( separator30, WindowBackground ); |
| 566 |
UxPutHeight( separator30, 10 ); |
| 567 |
UxPutWidth( separator30, 514 ); |
| 568 |
UxPutY( separator30, 232 ); |
| 569 |
UxPutX( separator30, 8 ); |
| 570 |
|
| 571 |
UxPutBackground( separator31, WindowBackground ); |
| 572 |
UxPutHeight( separator31, 10 ); |
| 573 |
UxPutWidth( separator31, 518 ); |
| 574 |
UxPutY( separator31, 168 ); |
| 575 |
UxPutX( separator31, 8 ); |
| 576 |
|
| 577 |
UxPutForeground( tf_alpha35, TextForeground ); |
| 578 |
UxPutHighlightOnEnter( tf_alpha35, "true" ); |
| 579 |
UxPutFontList( tf_alpha35, TextFont ); |
| 580 |
UxPutBackground( tf_alpha35, TextBackground ); |
| 581 |
UxPutHeight( tf_alpha35, 32 ); |
| 582 |
UxPutWidth( tf_alpha35, 230 ); |
| 583 |
UxPutY( tf_alpha35, 8 ); |
| 584 |
UxPutX( tf_alpha35, 130 ); |
| 585 |
|
| 586 |
UxPutText( tf_alpha36, "middummff.bdf" ); |
| 587 |
UxPutForeground( tf_alpha36, TextForeground ); |
| 588 |
UxPutHighlightOnEnter( tf_alpha36, "true" ); |
| 589 |
UxPutFontList( tf_alpha36, TextFont ); |
| 590 |
UxPutBackground( tf_alpha36, TextBackground ); |
| 591 |
UxPutHeight( tf_alpha36, 32 ); |
| 592 |
UxPutWidth( tf_alpha36, 230 ); |
| 593 |
UxPutY( tf_alpha36, 46 ); |
| 594 |
UxPutX( tf_alpha36, 130 ); |
| 595 |
|
| 596 |
UxPutForeground( tf_alpha37, TextForeground ); |
| 597 |
UxPutHighlightOnEnter( tf_alpha37, "true" ); |
| 598 |
UxPutFontList( tf_alpha37, TextFont ); |
| 599 |
UxPutBackground( tf_alpha37, TextBackground ); |
| 600 |
UxPutHeight( tf_alpha37, 32 ); |
| 601 |
UxPutWidth( tf_alpha37, 230 ); |
| 602 |
UxPutY( tf_alpha37, 90 ); |
| 603 |
UxPutX( tf_alpha37, 130 ); |
| 604 |
|
| 605 |
UxPutForeground( label114, TextForeground ); |
| 606 |
UxPutAlignment( label114, "alignment_beginning" ); |
| 607 |
UxPutLabelString( label114, "Input Frame" ); |
| 608 |
UxPutFontList( label114, TextFont ); |
| 609 |
UxPutBackground( label114, LabelBackground ); |
| 610 |
UxPutHeight( label114, 30 ); |
| 611 |
UxPutWidth( label114, 94 ); |
| 612 |
UxPutY( label114, 10 ); |
| 613 |
UxPutX( label114, 18 ); |
| 614 |
|
| 615 |
UxPutWidth( pb_main_search25, 46 ); |
| 616 |
UxPutRecomputeSize( pb_main_search25, "true" ); |
| 617 |
UxPutLabelString( pb_main_search25, "..." ); |
| 618 |
UxPutForeground( pb_main_search25, ButtonForeground ); |
| 619 |
UxPutFontList( pb_main_search25, BoldTextFont ); |
| 620 |
UxPutBackground( pb_main_search25, ButtonBackground ); |
| 621 |
UxPutHeight( pb_main_search25, 28 ); |
| 622 |
UxPutY( pb_main_search25, 10 ); |
| 623 |
UxPutX( pb_main_search25, 365 ); |
| 624 |
|
| 625 |
UxPutWidth( pb_main_search26, 46 ); |
| 626 |
UxPutRecomputeSize( pb_main_search26, "true" ); |
| 627 |
UxPutLabelString( pb_main_search26, "..." ); |
| 628 |
UxPutForeground( pb_main_search26, ButtonForeground ); |
| 629 |
UxPutFontList( pb_main_search26, BoldTextFont ); |
| 630 |
UxPutBackground( pb_main_search26, ButtonBackground ); |
| 631 |
UxPutHeight( pb_main_search26, 28 ); |
| 632 |
UxPutY( pb_main_search26, 48 ); |
| 633 |
UxPutX( pb_main_search26, 365 ); |
| 634 |
|
| 635 |
UxPutWidth( pb_main_search27, 46 ); |
| 636 |
UxPutRecomputeSize( pb_main_search27, "true" ); |
| 637 |
UxPutLabelString( pb_main_search27, "..." ); |
| 638 |
UxPutForeground( pb_main_search27, ButtonForeground ); |
| 639 |
UxPutFontList( pb_main_search27, BoldTextFont ); |
| 640 |
UxPutBackground( pb_main_search27, ButtonBackground ); |
| 641 |
UxPutHeight( pb_main_search27, 28 ); |
| 642 |
UxPutY( pb_main_search27, 88 ); |
| 643 |
UxPutX( pb_main_search27, 365 ); |
| 644 |
|
| 645 |
UxPutForeground( label115, TextForeground ); |
| 646 |
UxPutAlignment( label115, "alignment_beginning" ); |
| 647 |
UxPutLabelString( label115, "- Background" ); |
| 648 |
UxPutFontList( label115, TextFont ); |
| 649 |
UxPutBackground( label115, LabelBackground ); |
| 650 |
UxPutHeight( label115, 30 ); |
| 651 |
UxPutWidth( label115, 94 ); |
| 652 |
UxPutY( label115, 42 ); |
| 653 |
UxPutX( label115, 4 ); |
| 654 |
|
| 655 |
UxPutForeground( label116, TextForeground ); |
| 656 |
UxPutAlignment( label116, "alignment_beginning" ); |
| 657 |
UxPutLabelString( label116, "= Output Frame" ); |
| 658 |
UxPutFontList( label116, TextFont ); |
| 659 |
UxPutBackground( label116, LabelBackground ); |
| 660 |
UxPutHeight( label116, 30 ); |
| 661 |
UxPutWidth( label116, 116 ); |
| 662 |
UxPutY( label116, 86 ); |
| 663 |
UxPutX( label116, 6 ); |
| 664 |
|
| 665 |
UxPutLabelString( pb_search_plot26, "Display" ); |
| 666 |
UxPutForeground( pb_search_plot26, ButtonForeground ); |
| 667 |
UxPutFontList( pb_search_plot26, BoldTextFont ); |
| 668 |
UxPutBackground( pb_search_plot26, ButtonBackground ); |
| 669 |
UxPutHeight( pb_search_plot26, 30 ); |
| 670 |
UxPutWidth( pb_search_plot26, 86 ); |
| 671 |
UxPutY( pb_search_plot26, 10 ); |
| 672 |
UxPutX( pb_search_plot26, 420 ); |
| 673 |
|
| 674 |
UxPutLabelString( pb_search_plot27, "Display" ); |
| 675 |
UxPutForeground( pb_search_plot27, ButtonForeground ); |
| 676 |
UxPutFontList( pb_search_plot27, BoldTextFont ); |
| 677 |
UxPutBackground( pb_search_plot27, ButtonBackground ); |
| 678 |
UxPutHeight( pb_search_plot27, 30 ); |
| 679 |
UxPutWidth( pb_search_plot27, 86 ); |
| 680 |
UxPutY( pb_search_plot27, 48 ); |
| 681 |
UxPutX( pb_search_plot27, 420 ); |
| 682 |
|
| 683 |
UxPutForeground( tf_alpha11, TextForeground ); |
| 684 |
UxPutHighlightOnEnter( tf_alpha11, "true" ); |
| 685 |
UxPutFontList( tf_alpha11, TextFont ); |
| 686 |
UxPutBackground( tf_alpha11, TextBackground ); |
| 687 |
UxPutHeight( tf_alpha11, 32 ); |
| 688 |
UxPutWidth( tf_alpha11, 230 ); |
| 689 |
UxPutY( tf_alpha11, 130 ); |
| 690 |
UxPutX( tf_alpha11, 130 ); |
| 691 |
|
| 692 |
UxPutForeground( label6, TextForeground ); |
| 693 |
UxPutAlignment( label6, "alignment_beginning" ); |
| 694 |
UxPutLabelString( label6, "Blaze Function:" ); |
| 695 |
UxPutFontList( label6, TextFont ); |
| 696 |
UxPutBackground( label6, LabelBackground ); |
| 697 |
UxPutHeight( label6, 30 ); |
| 698 |
UxPutWidth( label6, 116 ); |
| 699 |
UxPutY( label6, 128 ); |
| 700 |
UxPutX( label6, 8 ); |
| 701 |
|
| 702 |
} |
| 703 |
|
| 704 |
/******************************************************************************* |
| 705 |
The 'build_' function creates all the swidgets and X widgets, |
| 706 |
and sets their properties to the values specified in the |
| 707 |
Property Editor. |
| 708 |
*******************************************************************************/ |
| 709 |
|
| 710 |
static swidget _Uxbuild_FlatShell() |
| 711 |
{ |
| 712 |
/* Create the swidgets */ |
| 713 |
|
| 714 |
FlatShell = UxCreateTransientShell( "FlatShell", NO_PARENT ); |
| 715 |
UxPutContext( FlatShell, UxFlatShellContext ); |
| 716 |
|
| 717 |
form37 = UxCreateForm( "form37", FlatShell ); |
| 718 |
form38 = UxCreateForm( "form38", form37 ); |
| 719 |
pb_search_search10 = UxCreatePushButton( "pb_search_search10", form38 ); |
| 720 |
pushButton7 = UxCreatePushButton( "pushButton7", form38 ); |
| 721 |
pb_search_plot21 = UxCreatePushButton( "pb_search_plot21", form38 ); |
| 722 |
pb_search_plot24 = UxCreatePushButton( "pb_search_plot24", form38 ); |
| 723 |
shelp_search7 = UxCreateText( "shelp_search7", form37 ); |
| 724 |
separator30 = UxCreateSeparator( "separator30", form37 ); |
| 725 |
separator31 = UxCreateSeparator( "separator31", form37 ); |
| 726 |
tf_alpha35 = UxCreateTextField( "tf_alpha35", form37 ); |
| 727 |
tf_alpha36 = UxCreateTextField( "tf_alpha36", form37 ); |
| 728 |
tf_alpha37 = UxCreateTextField( "tf_alpha37", form37 ); |
| 729 |
label114 = UxCreateLabel( "label114", form37 ); |
| 730 |
pb_main_search25 = UxCreatePushButton( "pb_main_search25", form37 ); |
| 731 |
pb_main_search26 = UxCreatePushButton( "pb_main_search26", form37 ); |
| 732 |
pb_main_search27 = UxCreatePushButton( "pb_main_search27", form37 ); |
| 733 |
label115 = UxCreateLabel( "label115", form37 ); |
| 734 |
label116 = UxCreateLabel( "label116", form37 ); |
| 735 |
pb_search_plot26 = UxCreatePushButton( "pb_search_plot26", form37 ); |
| 736 |
pb_search_plot27 = UxCreatePushButton( "pb_search_plot27", form37 ); |
| 737 |
tf_alpha11 = UxCreateTextField( "tf_alpha11", form37 ); |
| 738 |
label6 = UxCreateLabel( "label6", form37 ); |
| 739 |
|
| 740 |
_Uxinit_FlatShell(); |
| 741 |
|
| 742 |
/* Create the X widgets */ |
| 743 |
|
| 744 |
UxCreateWidget( FlatShell ); |
| 745 |
UxCreateWidget( form37 ); |
| 746 |
UxCreateWidget( form38 ); |
| 747 |
UxCreateWidget( pb_search_search10 ); |
| 748 |
UxCreateWidget( pushButton7 ); |
| 749 |
UxCreateWidget( pb_search_plot21 ); |
| 750 |
UxCreateWidget( pb_search_plot24 ); |
| 751 |
UxCreateWidget( shelp_search7 ); |
| 752 |
UxCreateWidget( separator30 ); |
| 753 |
UxCreateWidget( separator31 ); |
| 754 |
UxCreateWidget( tf_alpha35 ); |
| 755 |
UxCreateWidget( tf_alpha36 ); |
| 756 |
UxCreateWidget( tf_alpha37 ); |
| 757 |
UxCreateWidget( label114 ); |
| 758 |
UxCreateWidget( pb_main_search25 ); |
| 759 |
UxCreateWidget( pb_main_search26 ); |
| 760 |
UxCreateWidget( pb_main_search27 ); |
| 761 |
UxCreateWidget( label115 ); |
| 762 |
UxCreateWidget( label116 ); |
| 763 |
UxCreateWidget( pb_search_plot26 ); |
| 764 |
UxCreateWidget( pb_search_plot27 ); |
| 765 |
UxCreateWidget( tf_alpha11 ); |
| 766 |
UxCreateWidget( label6 ); |
| 767 |
|
| 768 |
UxAddCallback( pb_search_search10, XmNactivateCallback, |
| 769 |
activateCB_pb_search_search10, |
| 770 |
(XtPointer) UxFlatShellContext ); |
| 771 |
|
| 772 |
UxAddCallback( pushButton7, XmNactivateCallback, |
| 773 |
activateCB_pushButton7, |
| 774 |
(XtPointer) UxFlatShellContext ); |
| 775 |
|
| 776 |
UxAddCallback( pb_search_plot21, XmNactivateCallback, |
| 777 |
activateCB_pb_search_plot21, |
| 778 |
(XtPointer) UxFlatShellContext ); |
| 779 |
|
| 780 |
UxAddCallback( pb_search_plot24, XmNactivateCallback, |
| 781 |
activateCB_pb_search_plot24, |
| 782 |
(XtPointer) UxFlatShellContext ); |
| 783 |
|
| 784 |
UxAddCallback( tf_alpha35, XmNlosingFocusCallback, |
| 785 |
losingFocusCB_tf_alpha35, |
| 786 |
(XtPointer) UxFlatShellContext ); |
| 787 |
|
| 788 |
UxAddCallback( tf_alpha36, XmNlosingFocusCallback, |
| 789 |
losingFocusCB_tf_alpha36, |
| 790 |
(XtPointer) UxFlatShellContext ); |
| 791 |
|
| 792 |
UxAddCallback( tf_alpha37, XmNlosingFocusCallback, |
| 793 |
losingFocusCB_tf_alpha37, |
| 794 |
(XtPointer) UxFlatShellContext ); |
| 795 |
|
| 796 |
UxAddCallback( pb_main_search25, XmNactivateCallback, |
| 797 |
activateCB_pb_main_search25, |
| 798 |
(XtPointer) UxFlatShellContext ); |
| 799 |
|
| 800 |
UxAddCallback( pb_main_search26, XmNactivateCallback, |
| 801 |
activateCB_pb_main_search26, |
| 802 |
(XtPointer) UxFlatShellContext ); |
| 803 |
|
| 804 |
UxAddCallback( pb_main_search27, XmNactivateCallback, |
| 805 |
activateCB_pb_main_search27, |
| 806 |
(XtPointer) UxFlatShellContext ); |
| 807 |
|
| 808 |
UxAddCallback( pb_search_plot26, XmNactivateCallback, |
| 809 |
activateCB_pb_search_plot26, |
| 810 |
(XtPointer) UxFlatShellContext ); |
| 811 |
|
| 812 |
UxAddCallback( pb_search_plot27, XmNactivateCallback, |
| 813 |
activateCB_pb_search_plot27, |
| 814 |
(XtPointer) UxFlatShellContext ); |
| 815 |
|
| 816 |
UxAddCallback( tf_alpha11, XmNlosingFocusCallback, |
| 817 |
losingFocusCB_tf_alpha11, |
| 818 |
(XtPointer) UxFlatShellContext ); |
| 819 |
|
| 820 |
|
| 821 |
/* Finally, call UxRealizeInterface to create the X windows |
| 822 |
for the widgets created above. */ |
| 823 |
|
| 824 |
UxRealizeInterface( FlatShell ); |
| 825 |
|
| 826 |
return ( FlatShell ); |
| 827 |
} |
| 828 |
|
| 829 |
/******************************************************************************* |
| 830 |
The following function includes the code that was entered |
| 831 |
in the 'Initial Code' and 'Final Code' sections of the |
| 832 |
Declarations Editor. This function is called from the |
| 833 |
'Interface function' below. |
| 834 |
*******************************************************************************/ |
| 835 |
|
| 836 |
static swidget _Ux_create_FlatShell() |
| 837 |
{ |
| 838 |
swidget rtrn; |
| 839 |
_UxCFlatShell *UxContext; |
| 840 |
|
| 841 |
UxFlatShellContext = UxContext = |
| 842 |
(_UxCFlatShell *) UxMalloc( sizeof(_UxCFlatShell) ); |
| 843 |
|
| 844 |
rtrn = _Uxbuild_FlatShell(); |
| 845 |
|
| 846 |
return(rtrn); |
| 847 |
} |
| 848 |
|
| 849 |
/******************************************************************************* |
| 850 |
The following is the 'Interface function' which is the |
| 851 |
external entry point for creating this interface. |
| 852 |
This function should be called from your application or from |
| 853 |
a callback function. |
| 854 |
*******************************************************************************/ |
| 855 |
|
| 856 |
swidget create_FlatShell() |
| 857 |
{ |
| 858 |
swidget _Uxrtrn; |
| 859 |
static int _Uxinit = 0; |
| 860 |
|
| 861 |
if ( ! _Uxinit ) |
| 862 |
{ |
| 863 |
static XtActionsRec _Uxactions[] = { |
| 864 |
{ "UpdateDirectory", action_UpdateDirectory }, |
| 865 |
{ "ClearShort", action_ClearShort }, |
| 866 |
{ "HelpShort", action_HelpShort }, |
| 867 |
{ "FileSelectACT", action_FileSelectACT } |
| 868 |
}; |
| 869 |
|
| 870 |
XtAppAddActions( UxAppContext, |
| 871 |
_Uxactions, |
| 872 |
XtNumber(_Uxactions) ); |
| 873 |
|
| 874 |
_Uxinit = 1; |
| 875 |
} |
| 876 |
|
| 877 |
_Uxrtrn = _Ux_create_FlatShell(); |
| 878 |
|
| 879 |
return ( _Uxrtrn ); |
| 880 |
} |
| 881 |
|
| 882 |
/******************************************************************************* |
| 883 |
END OF FILE |
| 884 |
*******************************************************************************/ |
| 885 |
|