Don't use fstat for readable pipe chars in dtexec.
[oweals/cde.git] / cde / programs / dtcreate / CreateActionAppShell.c
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /* $TOG: CreateActionAppShell.c /main/11 1998/10/26 17:17:50 mgreess $ */
24 /*******************************************************************************
25         CreateActionAppShell.c
26
27        Associated Header file: CreateActionAppShell.h
28 *******************************************************************************/
29
30 #include <stdlib.h>
31 #include <stdio.h>
32 #include <sys/stat.h>
33
34 #include <Xm/Xm.h>
35 #include <Xm/MwmUtil.h>
36 #include <Xm/MenuShell.h>
37 #include <Xm/Text.h>
38 #include <Xm/ToggleBG.h>
39 #include <Xm/List.h>
40 #include <Xm/ScrolledW.h>
41 #include <Xm/Text.h>
42 #include <Xm/PushBG.h>
43 #include <Xm/TextF.h>
44 #include <Xm/Label.h>
45 #include <Xm/Form.h>
46 #include <Xm/CascadeB.h>
47 #include <Xm/ToggleB.h>
48 #include <Xm/Separator.h>
49 #include <Xm/PushB.h>
50 #include <Xm/RowColumn.h>
51 #include <Xm/MainW.h>
52 #include <Xm/Protocols.h>
53 #include <Xm/AtomMgr.h>
54
55 #include <X11/Shell.h>
56 #include <X11/cursorfont.h>
57
58 #include <Dt/Icon.h>
59 #include <Dt/Action.h>
60
61 #include "dtcreate.h"
62 #include "UxXt.h"
63 #include "ca_aux.h"
64 #include "cmncbs.h"
65 #include "cmnrtns.h"
66 #include "Confirmed.h"
67
68 #define CONTEXT_MACRO_ACCESS 1
69 #include "CreateActionAppShell.h"
70 #undef CONTEXT_MACRO_ACCESS
71
72 /*******************************************************************************
73        Includes, Defines, and Global variables from the Declarations Editor:
74 *******************************************************************************/
75
76 Dimension winheight, xprtheight, newheight, wintypeheight;
77 Widget    FileTypes;
78
79 /*******************************************************************************
80        The following are callback functions.
81 *******************************************************************************/
82 static char * GetDefinitionFileName( char *pszName);
83 static void  CreateFiles(void);
84 static void  questionCB_ReplaceFile(Widget UxWidget,
85                              XtPointer UxClientData,
86                              XtPointer UxCallbackArg);
87 static void  questionCB_CancelSave(Widget UxWidget,
88                             XtPointer UxClientData,
89                             XtPointer UxCallbackArg);
90
91 static char * GetDefinitionFileName( char *pszName)
92 {
93   char     *pszEnvVar;
94   char     *defname = (char *)NULL;
95   int      bytesneeded = 0;
96   char     *msgPtr, *errPtr;
97   char     *newName;
98
99   /****************************************************************/
100   /* Create definition file name.                                 */
101   /****************************************************************/
102   newName = ReplaceSpaces(pszName);
103   pszEnvVar = getenv("HOME");
104   if ( pszEnvVar && strlen(pszEnvVar) ) {
105      bytesneeded = strlen("/.dt/types/.dt") + strlen(pszEnvVar) + strlen(newName) + 1;
106      defname = (char *)XtMalloc(bytesneeded);
107      sprintf(defname, "%s/.dt/types/%s.dt", pszEnvVar, newName);
108   } else {
109      msgPtr = GETMESSAGE(5, 170,
110          "The HOME environment variable is not set.\n\
111 The HOME environment variable must be set in order\n\
112 for this action to be saved.");
113      errPtr = XtNewString(msgPtr);
114      display_error_message(CreateActionAppShell, errPtr);
115      XtFree(errPtr);
116   }
117   XtFree(newName);
118   return(defname);
119 }
120
121
122 static void  CreateFiles(void)
123 {
124   Boolean  bHaveError = False;
125   ushort   usRc = 0;
126   char     *pszDefName;
127   char     *msgPtr1, *msgPtr2, *fmtPtr, *bufPtr;
128 #ifdef UNDO_CMVC_3571
129   char     *msgPtr3;
130 #endif
131
132   /******************************************************************/
133   /* Create Definition file name.                                   */
134   /******************************************************************/
135   pszDefName = GetDefinitionFileName(AD.pszName);
136   if (!pszDefName) {
137      bHaveError = True;
138   }
139
140   /******************************************************************/
141   /* Create Definition file.                                        */
142   /******************************************************************/
143   if ( !bHaveError && ((usRc = WriteDefinitionFile(pszDefName, &AD)) != 0) ) {
144      bHaveError = TRUE;
145   }
146
147   /******************************************************************/
148   /* Create Action file.                                            */
149   /******************************************************************/
150   if ( !bHaveError && ((usRc = WriteActionFile(&AD)) != 0) ) {
151      bHaveError = TRUE;
152   }
153
154   /******************************************************************/
155   /* Copy icon files to home directory   ~/.dt/icons                */
156   /******************************************************************/
157   if ( !bHaveError && ((usRc = CopyIconFiles(&AD)) != 0) ) {
158      bHaveError = TRUE;
159   }
160
161   /*******************************************************************/
162   /* Reload action database and pop up confirmation message if       */
163   /* operation was successful.                                       */
164   /*******************************************************************/
165   if (!bHaveError) {
166      _DtTurnOnHourGlass(CreateActionAppShell);
167      if (!DbInitDone) {
168         DtInitialize(UxDisplay, UxTopLevel, pszExecName, pszExecName);
169         DtDbLoad();
170         DbInitDone = TRUE;
171      }
172      DtActionInvoke(UxTopLevel, "ReloadActions",
173                       NULL, 0, NULL, NULL, NULL, 0, NULL, NULL);
174
175      _DtTurnOffHourGlass(CreateActionAppShell);
176
177      msgPtr1 = XtNewString(GETMESSAGE(5, 70, "The new action"));
178      msgPtr2 = XtNewString(GETMESSAGE(5, 71,
179               "has been placed in your home folder."));
180 #ifdef UNDO_CMVC_3571
181      msgPtr3 = XtNewString(GETMESSAGE(5, 73,
182               "The action definition file that was created is called:"));
183      fmtPtr = "%s\n\n   %s\n\n%s\n\n%s\n   %s";
184 #else
185      fmtPtr = "%s\n\n   %s\n\n%s";
186 #endif
187
188      bufPtr = XtMalloc((strlen(msgPtr1) + strlen(msgPtr2) +
189                         strlen(AD.pszName) +
190 #ifdef UNDO_CMVC_3571
191                         strlen(msgPtr3) + strlen(pszFile) +
192 #endif
193                         strlen(fmtPtr) + 1) * sizeof(char));
194
195      sprintf(bufPtr, fmtPtr, msgPtr1, AD.pszName, msgPtr2
196 #ifdef UNDO_CMVC_3571
197              , msgPtr3, pszFile
198 #endif
199              );
200
201      display_confirmed_message(CreateActionAppShell, bufPtr);
202
203      XtFree(bufPtr);
204 #ifdef UNDO_CMVC_3571
205      XtFree(msgPtr3);
206 #endif
207      XtFree(msgPtr2);
208      XtFree(msgPtr1);
209
210   }
211
212   /*******************************************************************/
213   /* Update the copy of the AD structure.  This will be used to      */
214   /* determine if the user has saved the most recent data before     */
215   /* exiting.                                                        */
216   /*******************************************************************/
217   FreeAndClearAD(pMyCopyAD);
218   XtFree((char *) pMyCopyAD);
219   pMyCopyAD = copyAD(&AD);
220
221 }
222
223
224 static void  questionCB_ReplaceFile(Widget UxWidget,
225                              XtPointer UxClientData,
226                              XtPointer UxCallbackArg)
227 {
228   CreateFiles();
229   XtDestroyWidget(XtParent(UxWidget));
230 }
231
232 static void  questionCB_CancelSave(Widget UxWidget,
233                             XtPointer UxClientData,
234                             XtPointer UxCallbackArg)
235 {
236   XtDestroyWidget(XtParent(UxWidget));
237 }
238
239
240 void  activateCB_CA_MB_FileSave(Widget UxWidget,
241                                 XtPointer UxClientData,
242                                 XtPointer UxCallbackArg)
243
244 {
245   ushort   usRc = 0;
246   char     *pszActionFile;
247   char     *msgPtr, *bufPtr;
248   Boolean  bHaveError = FALSE;
249   struct   stat statbuf;
250   char     *newName;
251   char     *pszEnvVar;
252
253   /*********************************************************************/
254   /*  Check that required fields are filled in for main window.        */
255   /*********************************************************************/
256   if (!CreateActionAppShellCheckFields()) {
257
258     /*******************************************************************/
259     /*  Query fields from main window and save into structure.         */
260     /*******************************************************************/
261     readCAFromGUI(&AD);
262
263     /*******************************************************************/
264     /*  Write the files.                                               */
265     /*******************************************************************/
266 #ifdef UNDO_CMVC_4662
267     if (pszFileToEdit) {
268        strcpy(pszFile, pszFileToEdit);
269     } else {
270 #endif
271
272        /****************************************************************/
273        /* Create Action file name.                                     */
274        /****************************************************************/
275        newName = ReplaceSpaces(AD.pszName);
276        pszActionFile = NULL;
277        pszEnvVar = getenv("HOME");
278        if ( pszEnvVar && strlen(pszEnvVar) ) {
279           pszActionFile = malloc(strlen(pszEnvVar)+strlen(newName)+10);
280           if (pszActionFile)
281             sprintf(pszActionFile, "%s/%s", pszEnvVar, newName);
282        } else {
283           msgPtr = GETMESSAGE(5, 170,
284               "The HOME environment variable is not set.\n\
285 The HOME environment variable must be set in order\n\
286 for this action to be saved.");
287           bufPtr = XtNewString(msgPtr);
288           display_error_message(CreateActionAppShell, bufPtr);
289           XtFree(bufPtr);
290           bHaveError = TRUE;
291        }
292
293        /****************************************************************/
294        /* Check if action file exists and flag a warning if it does.   */
295        /****************************************************************/
296        if ( (!bHaveError) &&
297             (pszActionFile) &&
298             (!stat(pszActionFile, &statbuf)) ) {
299
300           /* INTERNATIONALIZE */
301           msgPtr = "A file named\n\n   %s\n\n\
302 already exists in your home folder.\n\
303 The existing file may be an application,\n\
304 data file, or an action file.\n\n\
305 What do you want to do?";
306           bufPtr = XtMalloc((strlen(msgPtr) + strlen(newName) + 1) *
307                             sizeof(char));
308           sprintf(bufPtr, msgPtr, newName);
309
310           /* INTERNATIONALIZE */
311           display_question_message(CreateActionAppShell, bufPtr,
312                               "Replace", questionCB_ReplaceFile,
313                               "Cancel Save", questionCB_CancelSave,
314                               (char *)NULL, (XtCallbackProc)NULL);
315           XtFree(bufPtr);
316           XtFree(pszActionFile);
317           bHaveError = True;
318        }
319
320        /****************************************************************/
321        /* Now we are done with the newName variable and can free.      */
322        /****************************************************************/
323        XtFree(newName);
324
325 #ifdef UNDO_CMVC_4662
326     }
327 #endif
328
329     if (!bHaveError) {
330        CreateFiles();
331     }
332
333   }
334 }
335
336 static  void    activateCB_CA_FiletypesDelete( Widget UxWidget,
337                                               XtPointer UxClientData,
338                                               XtPointer UxCallbackArg)
339 {
340   int           *poslist, poscnt;
341   int           *p, n;
342   XmString      *items;
343   FiletypeData  **papArray;
344   int           i, k;
345   int           cnt;
346   Boolean       bFound;
347   char          *msgPtr1, *msgPtr2, *fmtPtr, *errPtr;
348   size_t        len;
349
350   /**************************************************************************/
351   /* Determine the filetypes to delete and delete them.                     */
352   /**************************************************************************/
353   XtVaGetValues(FileTypes, XmNitems, &items, NULL);
354   if (XmListGetSelectedPos(FileTypes, &poslist, &poscnt)) {
355      n = poscnt;
356      p = poslist + (n-1);
357      while (n--) {
358        /*********************************************************************/
359        /* Delete the filetype name from the listbox.                        */
360        /*********************************************************************/
361        XmListDeleteItem(FileTypes, items[*p -1]);
362        p--;
363      }
364
365      /***********************************************************************/
366      /* Remove the filetypes from the filetype array in the ActionData      */
367      /* structure.                                                          */
368      /***********************************************************************/
369      if ((AD.cFiletypes - poscnt) > 0) {
370         if ( papArray = (FiletypeData **) XtMalloc(sizeof(FiletypeData *) * (AD.cFiletypes - poscnt)) ) {
371            cnt = 0;
372            for (i = 0; i < AD.cFiletypes; i++) {
373               bFound = FALSE;
374               for (k = 0; k < poscnt; k++) {
375                 if ((i + 1) == poslist[k]) {
376                    bFound = TRUE;
377                    break;
378                 }
379               }
380               /**************************************************************/
381               /* If did not find this element in the delete list, then add  */
382               /* it back to our good list.                                  */
383               /* Else do not include in the good list and free its memory.  */
384               /**************************************************************/
385               if (!bFound) {
386                  papArray[cnt] = AD.papFiletypes[i];
387                  cnt++;
388               } else {
389                  free_Filetypedata(AD.papFiletypes[i]);
390               }
391            }
392            if (AD.papFiletypes) {
393              XtFree((XtPointer)AD.papFiletypes);
394            }
395            AD.papFiletypes = papArray;
396            AD.cFiletypes = cnt;
397         }
398      } else {
399         /********************************************************************/
400         /* Delete the entire array.                                         */
401         /********************************************************************/
402         for (i = 0; i < AD.cFiletypes; i++) {
403           free_Filetypedata(AD.papFiletypes[i]);
404         }
405         AD.papFiletypes = (FiletypeData **)NULL;
406         AD.cFiletypes = 0;
407      }
408   } else {
409      msgPtr1 = XtNewString(GETMESSAGE(5, 120,
410                   "You have not selected a Datatype from the\n\
411 'Datatypes That Use This Action' list."));
412      msgPtr2 = XtNewString(GETMESSAGE(5, 125,
413                   "Please select the Datatype you would like to Delete."));
414      fmtPtr = "%s\n%s";
415      len = (strlen(msgPtr1) + strlen(msgPtr2) + strlen(fmtPtr) + 2);
416      errPtr = XtMalloc(len);
417      snprintf(errPtr,len - 1, fmtPtr, msgPtr1, msgPtr2);
418      XtFree(msgPtr2);
419      XtFree(msgPtr1);
420      display_error_message(CreateActionAppShell, errPtr);
421      XtFree(errPtr);
422   }
423 }
424
425 #if 0
426 /*****************************************************************************/
427 /*                                                                           */
428 /* valueChangedCB_CA_WinType                                                 */
429 /*                                                                           */
430 /*****************************************************************************/
431 static  void    valueChangedCB_CA_WinType( Widget UxWidget,
432                                            XtPointer UxClientData,
433                                            XtPointer UxCallbackArg)
434 {
435   Boolean bSetToggle;
436
437   bSetToggle = ((XmToggleButtonCallbackStruct *)UxCallbackArg)->set;
438 #ifdef DEBUG
439   printf("Wintype change before %X\n", AD.fsFlags);
440 #endif
441   switch ((int)UxClientData) {
442     case CA_WT_XWINDOWS :
443          if (bSetToggle) AD.fsFlags |= CA_WT_XWINDOWS;
444          else AD.fsFlags &= (~(CA_WT_XWINDOWS));
445          break;
446     case CA_WT_TERM :
447          if (bSetToggle) AD.fsFlags |= CA_WT_TERM;
448          else AD.fsFlags &= (~(CA_WT_TERM));
449          break;
450     case CA_WT_PERMTERM :
451          if (bSetToggle) AD.fsFlags |= CA_WT_PERMTERM;
452          else AD.fsFlags &= (~(CA_WT_PERMTERM));
453          break;
454   }
455 #ifdef DEBUG
456   printf("Wintype change after %X\n", AD.fsFlags);
457 #endif
458 }
459 #endif
460
461 /*****************************************************************************/
462 /*                                                                           */
463 /* valueChangedCB_DroppableFiletypes                                         */
464 /*                                                                           */
465 /*****************************************************************************/
466 static  void    valueChangedCB_DroppableFiletypes( Widget UxWidget,
467                                            XtPointer UxClientData,
468                                            XtPointer UxCallbackArg)
469 {
470   if (((XmToggleButtonCallbackStruct *)UxCallbackArg)->set) {
471     AD.fsFlags |= CA_DF_ONLYFTFILES;
472   } else {
473     AD.fsFlags &= (~(CA_DF_ONLYFTFILES));
474   }
475 }
476
477 /*****************************************************************************/
478 /*                                                                           */
479 /* simpleCB_WindowTypeOptionMenu                                             */
480 /*                                                                           */
481 /*****************************************************************************/
482 static  void    activateCB_WindowTypeOptionMenu( Widget UxWidget,
483                                            XtPointer UxClientData,
484                                            XtPointer UxCallbackArg)
485 {
486   AD.fsFlags &= (~(CA_WT_XWINDOWS | CA_WT_TERM | CA_WT_PERMTERM));
487   switch ((int)UxClientData) {
488     case CA_WT_XWINDOWS :
489          AD.fsFlags |= CA_WT_XWINDOWS;
490          break;
491     case CA_WT_TERM :
492          AD.fsFlags |= CA_WT_TERM;
493          break;
494     case CA_WT_PERMTERM :
495          AD.fsFlags |= CA_WT_PERMTERM;
496          break;
497   }
498 }
499
500 /*******************************************************************************
501        The 'build_' function creates all the widgets
502        using the resource values specified in the Property Editor.
503 *******************************************************************************/
504
505 static Widget   _Uxbuild_CreateActionAppShell(void)
506 {
507         Widget               _UxParent;
508         Widget               CA_MB_FileOption_shell;
509         Widget               CA_MB_HelpOption_shell;
510         Widget               CA_MB_Help_Sep1;
511         Widget               CA_MB_Help_Sep2;
512         Widget               CA_MB_OptionsOption_shell;
513         char                 *UxTmp0;
514
515         Widget               CA_WindowType_OptionMenuShell;
516         Widget               CA_WindowType_Pane;
517         Widget               CA_WindowType_OptionMenu;
518         char                 mnemonic[2];
519         Dimension            dim1, dim2;
520         Widget               CA_MED_IconForm, CA_TINY_IconForm, CA_LRG_IconForm;
521         IconData             *pIconData;
522
523         XmString             emptyString;
524         char                 titleBuf[MAXBUFSIZE];
525
526 #define ICON_MIN_HEIGHT      83
527 #define FINDEDIT_SPACING     6
528 #define BORDER_OFFSET        3
529
530         /* Creation of CreateActionAppShell */
531         _UxParent = UxParent;
532         if ( _UxParent == NULL )
533         {
534             _UxParent = UxTopLevel;
535         }
536
537         strcpy(titleBuf, GETMESSAGE(3, 10, "Create Action"));
538         CreateActionAppShell = XtVaCreatePopupShell( "CreateActionAppShell",
539                         applicationShellWidgetClass,
540                         _UxParent,
541                         /*
542                         XmNx, 35,
543                         XmNy, 8,
544                         XmNminWidth, -1,
545                         XmNminHeight, -1,
546                         */
547                         XmNiconName, titleBuf,
548                         XmNtitle, titleBuf,
549                         XmNallowShellResize, TRUE,
550                         XmNheight, 550,
551                         XmNdeleteResponse, XmDO_NOTHING, /* CDExc19440 */
552                         NULL );
553
554         /* CDExc19440 - make sure user doesn't accidentally lose work. */
555         XmAddWMProtocolCallback(CreateActionAppShell,
556                                 XmInternAtom(UxDisplay,
557                                              "WM_DELETE_WINDOW",
558                                              False),
559                                 activateCB_FileQuit,
560                                 (XtPointer)NULL);
561
562         if (bLowRes) {
563            /* Creation of CreateActionMainWindow */
564            CreateActionMainWindow = XtVaCreateManagedWidget( "CreateActionMainWindow",
565                         xmMainWindowWidgetClass,
566                         CreateActionAppShell,
567                         XmNunitType, XmPIXELS,
568                         XmNx, 0,
569                         XmNy, 0,
570                         XmNscrollingPolicy, XmAUTOMATIC,
571                         NULL );
572         } else {
573            /* Creation of CreateActionMainWindow */
574            CreateActionMainWindow = XtVaCreateManagedWidget( "CreateActionMainWindow",
575                         xmMainWindowWidgetClass,
576                         CreateActionAppShell,
577                         XmNunitType, XmPIXELS,
578                         XmNx, 0,
579                         XmNy, 0,
580                         NULL );
581         }
582         XtAddCallback( CreateActionMainWindow, XmNhelpCallback,
583                 (XtCallbackProc) helpCB_general,
584                 (XtPointer) HELP_ONITEM );
585
586         /*********************************************************************/
587         /*                                                                   */
588         /* MenuBar                                                           */
589         /*                                                                   */
590         /*********************************************************************/
591         /* Creation of CA_MenuBar */
592         CA_MenuBar = XtVaCreateManagedWidget( "CA_MenuBar",
593                         xmRowColumnWidgetClass,
594                         CreateActionMainWindow,
595                         XmNrowColumnType, XmMENU_BAR,
596                         XmNmenuAccelerator, "<KeyUp>F10",
597                         XmNpacking, XmPACK_TIGHT,
598                         XmNentryAlignment, XmALIGNMENT_BEGINNING,
599                         XmNorientation, XmHORIZONTAL,
600                         NULL );
601
602         /* Creation of CA_MB_FileOption */
603         CA_MB_FileOption_shell = XtVaCreatePopupShell ("CA_MB_FileOption_shell",
604                         xmMenuShellWidgetClass, CA_MenuBar,
605                         XmNwidth, 1,
606                         XmNheight, 1,
607                         XmNallowShellResize, TRUE,
608                         XmNoverrideRedirect, TRUE,
609                         NULL );
610
611         CA_MB_FileOption = XtVaCreateWidget( "CA_MB_FileOption",
612                         xmRowColumnWidgetClass,
613                         CA_MB_FileOption_shell,
614                         XmNrowColumnType, XmMENU_PULLDOWN,
615                         NULL );
616
617         /* Creation of CA_MB_FileNew */
618         /*
619         mnemonic = GETMESSAGE(2, 21, "N");
620         */
621         strcpy(mnemonic, GETMESSAGE(2, 21, "N"));
622         CA_MB_FileNew = XtVaCreateManagedWidget( "CA_MB_FileNew",
623                         xmPushButtonWidgetClass,
624                         CA_MB_FileOption,
625                         RES_CONVERT( XmNlabelString, GETMESSAGE(2, 20, "New")),
626                         XmNmnemonic, mnemonic[0],
627                         NULL );
628         XtAddCallback( CA_MB_FileNew, XmNactivateCallback,
629                 (XtCallbackProc) activateCB_FileNew,
630                 (XtPointer) NULL );
631
632         /* Creation of CA_MB_FileOpen */
633         /*
634         mnemonic = GETMESSAGE(2, 16, "O");
635         */
636         strcpy(mnemonic, GETMESSAGE(2, 16, "O"));
637         CA_MB_FileOpen = XtVaCreateManagedWidget( "CA_MB_FileOpen",
638                         xmPushButtonWidgetClass,
639                         CA_MB_FileOption,
640                         RES_CONVERT( XmNlabelString, GETMESSAGE(2, 15, "Open...")),
641                         XmNmnemonic, mnemonic[0],
642                         NULL );
643         XtAddCallback( CA_MB_FileOpen, XmNactivateCallback,
644                 (XtCallbackProc) activateCB_FileOpen,
645                 (XtPointer) NULL );
646
647         /* Creation of CA_MB_FileSave */
648         /*
649         mnemonic = GETMESSAGE(2, 26, "S");
650         */
651         strcpy(mnemonic, GETMESSAGE(2, 26, "S"));
652         CA_MB_FileSave = XtVaCreateManagedWidget( "CA_MB_FileSave",
653                         xmPushButtonWidgetClass,
654                         CA_MB_FileOption,
655                         RES_CONVERT( XmNlabelString, GETMESSAGE(2, 25, "Save")),
656                         XmNmnemonic, mnemonic[0],
657                         NULL );
658         XtAddCallback( CA_MB_FileSave, XmNactivateCallback,
659                 (XtCallbackProc) activateCB_CA_MB_FileSave,
660                 (XtPointer) NULL );
661
662         /* Creation of CA_MB_Sep */
663         CA_MB_Sep = XtVaCreateManagedWidget( "CA_MB_Sep",
664                         xmSeparatorWidgetClass,
665                         CA_MB_FileOption,
666                         NULL );
667
668         /* Creation of CA_MB_FileExit */
669         /*
670         mnemonic = GETMESSAGE(2, 31, "x");
671         */
672         strcpy(mnemonic, GETMESSAGE(2, 31, "x"));
673         CA_MB_FileExit = XtVaCreateManagedWidget( "CA_MB_FileExit",
674                         xmPushButtonWidgetClass,
675                         CA_MB_FileOption,
676                         RES_CONVERT( XmNlabelString, GETMESSAGE(2, 30, "Exit")),
677                         XmNmnemonic, mnemonic[0],
678                         NULL );
679         XtAddCallback( CA_MB_FileExit, XmNactivateCallback,
680                 (XtCallbackProc) activateCB_FileQuit,
681                 (XtPointer) NULL );
682
683         /* Creation of CA_MB_FileTop */
684         /*
685         mnemonic = GETMESSAGE(2, 11, "F");
686         */
687         strcpy(mnemonic, GETMESSAGE(2, 11, "F"));
688         CA_MB_FileTop = XtVaCreateManagedWidget( "CA_MB_FileTop",
689                         xmCascadeButtonWidgetClass,
690                         CA_MenuBar,
691                         RES_CONVERT( XmNlabelString, GETMESSAGE(2, 10, "File")),
692                         XmNmnemonic, mnemonic[0],
693                         XmNsubMenuId, CA_MB_FileOption,
694                         NULL );
695
696         /* Creation of CA_MB_HelpOption */
697         CA_MB_HelpOption_shell = XtVaCreatePopupShell ("CA_MB_HelpOption_shell",
698                         xmMenuShellWidgetClass, CA_MenuBar,
699                         XmNwidth, 1,
700                         XmNheight, 1,
701                         XmNallowShellResize, TRUE,
702                         XmNoverrideRedirect, TRUE,
703                         NULL );
704
705         CA_MB_HelpOption = XtVaCreateWidget( "CA_MB_HelpOption",
706                         xmRowColumnWidgetClass,
707                         CA_MB_HelpOption_shell,
708                         XmNrowColumnType, XmMENU_PULLDOWN,
709                         NULL );
710
711         /*
712          * Creation of CA_MB_HelpOverview
713         */
714         strcpy(mnemonic, GETMESSAGE(2, 61, "v"));
715         CA_MB_HelpOverview = XtVaCreateManagedWidget( "CA_MB_HelpOverview",
716                         xmPushButtonWidgetClass,
717                         CA_MB_HelpOption,
718                         RES_CONVERT( XmNlabelString, GETMESSAGE(2, 60, "Overview")),
719                         XmNmnemonic, mnemonic[0],
720                         XmNuserData, CreateActionAppShell,
721                         NULL );
722         XtAddCallback( CA_MB_HelpOverview, XmNactivateCallback,
723                 (XtCallbackProc) helpCB_general,
724                 (XtPointer) HELP_OVERVIEW );
725
726         /*
727          * Creation of CA_MB_HelpTasks
728         */
729         strcpy(mnemonic, GETMESSAGE(2, 71, "T"));
730         CA_MB_HelpTasks = XtVaCreateManagedWidget( "CA_MB_HelpTasks",
731                         xmPushButtonWidgetClass,
732                         CA_MB_HelpOption,
733                         RES_CONVERT( XmNlabelString, GETMESSAGE(2, 70, "Tasks")),
734                         XmNmnemonic, mnemonic[0],
735                         XmNuserData, CreateActionAppShell,
736                         NULL );
737         XtAddCallback( CA_MB_HelpTasks, XmNactivateCallback,
738                 (XtCallbackProc) helpCB_general,
739                 (XtPointer) HELP_TASKS );
740
741 #if 0
742         /* Creation of CA_MB_HelpTOC */
743         /*
744         mnemonic = GETMESSAGE(2, 66, "T");
745         */
746         strcpy(mnemonic, GETMESSAGE(2, 66, "T"));
747         CA_MB_HelpTOC = XtVaCreateManagedWidget( "CA_MB_HelpTOC",
748                         xmPushButtonWidgetClass,
749                         CA_MB_HelpOption,
750                         RES_CONVERT( XmNlabelString, GETMESSAGE(2, 65, "Table Of Contents...")),
751                         XmNmnemonic, mnemonic[0],
752                         XmNuserData, CreateActionAppShell,
753                         NULL );
754 #endif
755         /*
756         * Creation of CA_MB_HelpReference
757         */
758         strcpy(mnemonic, GETMESSAGE(2, 76, "R"));
759         CA_MB_HelpReference = XtVaCreateManagedWidget( "CA_MB_HelpReference",
760                         xmPushButtonWidgetClass,
761                         CA_MB_HelpOption,
762                         RES_CONVERT( XmNlabelString, GETMESSAGE(2, 75, "Reference")),
763                         XmNmnemonic, mnemonic[0],
764                         XmNuserData, CreateActionAppShell,
765                         NULL );
766         XtAddCallback( CA_MB_HelpReference, XmNactivateCallback,
767                 (XtCallbackProc) helpCB_general,
768                 (XtPointer) HELP_REFERENCE );
769
770         /*
771          * Creation of CA_MB_Help_Sep1
772          */
773         CA_MB_Help_Sep1 = XtVaCreateManagedWidget( "CA_MB_Help_Sep1",
774                         xmSeparatorWidgetClass,
775                         CA_MB_HelpOption,
776                         NULL );
777
778         /*
779          * Creation of CA_MB_HelpUsing
780          */
781         strcpy(mnemonic, GETMESSAGE(2, 81, "U"));
782         CA_MB_HelpUsing = XtVaCreateManagedWidget( "CA_MB_HelpUsing",
783                         xmPushButtonWidgetClass,
784                         CA_MB_HelpOption,
785                         RES_CONVERT( XmNlabelString, GETMESSAGE(2, 80, "Using Help")),
786                         XmNmnemonic, mnemonic[0],
787                         XmNuserData, CreateActionAppShell,
788                         NULL );
789         XtAddCallback( CA_MB_HelpUsing, XmNactivateCallback,
790                 (XtCallbackProc) helpCB_general,
791                 (XtPointer) HELP_USING );
792
793         /*
794          * Creation of CA_MB_Help_Sep2
795          */
796         CA_MB_Help_Sep2 = XtVaCreateManagedWidget( "CA_MB_Help_Sep2",
797                         xmSeparatorWidgetClass,
798                         CA_MB_HelpOption,
799                         NULL );
800
801         /*
802          * Creation of CA_MB_HelpAbout
803          */
804         strcpy(mnemonic, GETMESSAGE(2, 86, "A"));
805         CA_MB_HelpAbout = XtVaCreateManagedWidget( "CA_MB_HelpAbout",
806                         xmPushButtonWidgetClass,
807                         CA_MB_HelpOption,
808                         RES_CONVERT( XmNlabelString, GETMESSAGE(2, 85, "About Create Action")),
809                         XmNmnemonic, mnemonic[0],
810                         XmNuserData, CreateActionAppShell,
811                         NULL );
812         XtAddCallback( CA_MB_HelpAbout, XmNactivateCallback,
813                 (XtCallbackProc) helpCB_general,
814                 (XtPointer) HELP_ABOUT );
815
816         /*
817          * Creation of CA_MB_HelpTop
818          */
819         strcpy(mnemonic, GETMESSAGE(2, 54, "H"));
820         CA_MB_HelpTop = XtVaCreateManagedWidget( "CA_MB_HelpTop",
821                         xmCascadeButtonWidgetClass,
822                         CA_MenuBar,
823                         RES_CONVERT( XmNlabelString, GETMESSAGE(2, 53, "Help")),
824                         XmNmnemonic, mnemonic[0],
825                         XmNsubMenuId, CA_MB_HelpOption,
826                         XmNuserData, CreateActionAppShell,
827                         NULL );
828
829         /* Creation of CA_MB_OptionsOption */
830         CA_MB_OptionsOption_shell = XtVaCreatePopupShell ("CA_MB_OptionsOption_shell",
831                         xmMenuShellWidgetClass, CA_MenuBar,
832                         XmNwidth, 1,
833                         XmNheight, 1,
834                         XmNallowShellResize, TRUE,
835                         XmNoverrideRedirect, TRUE,
836                         NULL );
837
838         CA_MB_OptionsOption = XtVaCreateWidget( "CA_MB_OptionsOption",
839                         xmRowColumnWidgetClass,
840                         CA_MB_OptionsOption_shell,
841                         XmNrowColumnType, XmMENU_PULLDOWN,
842                         NULL );
843
844         /* Creation of ColorMonoOption */
845         strcpy(mnemonic, GETMESSAGE(2, 50, "M"));
846         ColorMonoOption = XtVaCreateManagedWidget( "ColorMonoOption",
847                         xmToggleButtonWidgetClass,
848                         CA_MB_OptionsOption,
849                         RES_CONVERT( XmNlabelString, GETMESSAGE(2, 49, "Show Monochrome Icons")),
850                         XmNmnemonic, mnemonic[0],
851                         XmNindicatorSize, 20,
852                         XmNhighlightThickness, 0,
853                         NULL );
854         XtAddCallback( ColorMonoOption, XmNvalueChangedCallback,
855                 (XtCallbackProc) valueChangedCB_ColorMonoOption,
856                 (XtPointer) NULL );
857         createCB_ColorMonoOption(ColorMonoOption);
858
859
860         /* Creation of CA_MB_OptionTop */
861         strcpy(mnemonic, GETMESSAGE(2, 36, "O"));
862         CA_MB_OptionTop = XtVaCreateManagedWidget( "CA_MB_OptionTop",
863                         xmCascadeButtonWidgetClass,
864                         CA_MenuBar,
865                         RES_CONVERT( XmNlabelString, GETMESSAGE(2, 35, "Options")),
866                         XmNmnemonic, mnemonic[0],
867                         XmNsubMenuId, CA_MB_OptionsOption,
868                         NULL );
869
870         /* Creation of CA_Form */
871         CA_Form = XtVaCreateManagedWidget( "CA_Form",
872                         xmFormWidgetClass,
873                         CreateActionMainWindow,
874                         XmNnoResize, FALSE,
875                         XmNresizePolicy, XmRESIZE_ANY,
876                         NULL );
877
878         /*********************************************************************/
879         /*                                                                   */
880         /* Action Name                                                       */
881         /*                                                                   */
882         /*********************************************************************/
883         /* Creation of CA_ActionNameLabel */
884         CA_ActionNameLabel = XtVaCreateManagedWidget( "CA_ActionNameLabel",
885                         xmLabelWidgetClass,
886                         CA_Form,
887                         XmNx, 10,
888                         XmNy, 30,
889                         RES_CONVERT( XmNlabelString, GETMESSAGE(3, 12, "Action Name (Icon Label):")),
890                         XmNalignment, XmALIGNMENT_BEGINNING,
891                         XmNleftOffset, 10,
892                         XmNleftAttachment, XmATTACH_FORM,
893                         XmNtopOffset, 20,
894                         XmNtopAttachment, XmATTACH_FORM,
895                         XmNrightOffset, 10,
896                         XmNrightAttachment, XmATTACH_FORM,
897                         NULL );
898
899         /* Creation of CA_ActionNameTextField */
900         CA_ActionNameTextField = XtVaCreateManagedWidget( "CA_ActionNameTextField",
901                         xmTextFieldWidgetClass,
902                         CA_Form,
903                         XmNx, 10,
904                         XmNy, 50,
905                         XmNtopOffset, 0,
906                         XmNtopWidget, CA_ActionNameLabel,
907                         XmNtopAttachment, XmATTACH_WIDGET,
908                         XmNleftOffset, 10,
909                         XmNleftAttachment, XmATTACH_FORM,
910                         XmNrightOffset, 10,
911                         XmNrightAttachment, XmATTACH_FORM,
912                         NULL );
913 #if 0
914         XtAddCallback( CA_ActionNameTextField, XmNvalueChangedCallback,
915                 (XtCallbackProc) valueChangedCB_CA_ActionNameTextField,
916                 (XtPointer) NULL );
917 #endif
918
919         /*********************************************************************/
920         /*                                                                   */
921         /* Icons                                                             */
922         /*                                                                   */
923         /*********************************************************************/
924         /* Creation of CA_ActionIconLabel */
925         CA_ActionIconLabel = XtVaCreateManagedWidget( "CA_ActionIconLabel",
926                         xmLabelWidgetClass,
927                         CA_Form,
928                         XmNx, 10,
929                         XmNy, 95,
930                         RES_CONVERT( XmNlabelString, GETMESSAGE(3, 13, "Action Icons:")),
931                         XmNalignment, XmALIGNMENT_BEGINNING,
932                         XmNleftOffset, 10,
933                         XmNleftAttachment, XmATTACH_FORM,
934                         XmNtopOffset, 15,
935                         XmNtopWidget, CA_ActionNameTextField,
936                         XmNtopAttachment, XmATTACH_WIDGET,
937                         XmNrightOffset, 10,
938                         XmNrightAttachment, XmATTACH_FORM,
939                         NULL );
940
941         /* Creation of CA_ActionIconForm */
942         CA_ActionIconForm = XtVaCreateManagedWidget( "CA_ActionIconForm",
943                         xmFormWidgetClass,
944                         CA_Form,
945                         XmNresizePolicy, XmRESIZE_NONE,
946                         XmNx, 10,
947                         XmNy, 121,
948                         XmNborderWidth, 0,
949                         XmNnavigationType, XmTAB_GROUP,
950                         XmNtopOffset, 0,
951                         XmNtopWidget, CA_ActionIconLabel,
952                         XmNtopAttachment, XmATTACH_WIDGET,
953                         XmNleftOffset, 10,
954                         XmNleftAttachment, XmATTACH_FORM,
955                         XmNrightOffset, 10,
956                         XmNrightAttachment, XmATTACH_FORM,
957                         XmNshadowThickness, 3,
958                         XmNshadowType, XmSHADOW_ETCHED_IN,
959                         XmNautoUnmanage, FALSE,
960                         XmNnoResize, FALSE,
961                         XmNallowOverlap, TRUE,
962                         XmNmarginHeight, 0,
963                         XmNverticalSpacing, 5,
964                         NULL );
965
966         CA_MED_IconForm = XtVaCreateManagedWidget( "CA_MED_IconForm",
967                         xmFormWidgetClass,
968                         CA_ActionIconForm,
969                         XmNresizePolicy, XmRESIZE_NONE,
970                         XmNborderWidth, ICON_BORDER_WIDTH,
971                         XmNleftPosition, 32,
972                         XmNleftOffset, 0,
973                         XmNleftAttachment, XmATTACH_POSITION,
974                         XmNbottomPosition, 88,
975                         XmNbottomOffset, 0,
976                         XmNbottomAttachment, XmATTACH_POSITION,
977                         NULL );
978
979         /* Creation of CA_MED_IconGadget */
980         emptyString = XmStringCreateLocalized("");
981         pIconData = (IconData *)XtMalloc(sizeof(IconData));
982         memset(pIconData, 0, sizeof(IconData));
983         IconDataList[CA_MED] = pIconData;
984         CA_MED_IconGadget = XtVaCreateManagedWidget( "CA_MED_IconGadget",
985                         dtIconGadgetClass,
986                         CA_MED_IconForm,
987                         XmNalignment, XmALIGNMENT_CENTER,
988                         XmNuserData, pIconData,
989                         XmNstring, emptyString,
990                         XmNrecomputeSize, TRUE,
991                         XmNleftOffset, BORDER_OFFSET,
992                         XmNleftAttachment, XmATTACH_FORM,
993                         XmNrightOffset, BORDER_OFFSET,
994                         XmNrightAttachment, XmATTACH_FORM,
995                         XmNtopOffset, BORDER_OFFSET,
996                         XmNtopAttachment, XmATTACH_FORM,
997                         XmNbottomOffset, BORDER_OFFSET,
998                         XmNbottomAttachment, XmATTACH_FORM,
999                         /*
1000                         XmNleftPosition, 32,
1001                         XmNleftOffset, 0,
1002                         XmNleftAttachment, XmATTACH_POSITION,
1003                         XmNbottomPosition, 88,
1004                         XmNbottomOffset, 0,
1005                         XmNbottomAttachment, XmATTACH_POSITION,
1006                         */
1007                         NULL );
1008         pIconData->wid = CA_MED_IconGadget;
1009         pIconData->size = Medium_Icon;
1010         XtAddCallback( CA_MED_IconGadget, XmNcallback,
1011                 (XtCallbackProc) activateCB_action_icon,
1012                 (XtPointer) NULL );
1013         createCB_IconGadget( CA_MED_IconGadget, TRUE, Medium_Icon );
1014         last_action_pushed = CA_MED_IconGadget;
1015
1016         CA_TINY_IconForm = XtVaCreateManagedWidget( "CA_TINY_IconForm",
1017                         xmFormWidgetClass,
1018                         CA_ActionIconForm,
1019                         XmNresizePolicy, XmRESIZE_NONE,
1020                         XmNborderWidth, 0,
1021                         XmNleftPosition, 52,
1022                         XmNleftOffset, 1,
1023                         XmNleftAttachment, XmATTACH_POSITION,
1024                         XmNbottomPosition, 88,
1025                         XmNbottomOffset, 0,
1026                         XmNbottomAttachment, XmATTACH_POSITION,
1027                         NULL );
1028
1029         /* Creation of CA_TINY_IconGadget */
1030         pIconData = (IconData *)XtMalloc(sizeof(IconData));
1031         memset(pIconData, 0, sizeof(IconData));
1032         IconDataList[CA_TINY] = pIconData;
1033         CA_TINY_IconGadget = XtVaCreateManagedWidget( "CA_TINY_IconGadget",
1034                         dtIconGadgetClass,
1035                         CA_TINY_IconForm,
1036                         XmNalignment, XmALIGNMENT_CENTER,
1037                         XmNuserData, pIconData,
1038                         XmNrecomputeSize, TRUE,
1039                         XmNstring, emptyString,
1040                         XmNleftOffset, BORDER_OFFSET,
1041                         XmNleftAttachment, XmATTACH_FORM,
1042                         XmNrightOffset, BORDER_OFFSET,
1043                         XmNrightAttachment, XmATTACH_FORM,
1044                         XmNtopOffset, BORDER_OFFSET,
1045                         XmNtopAttachment, XmATTACH_FORM,
1046                         XmNbottomOffset, BORDER_OFFSET,
1047                         XmNbottomAttachment, XmATTACH_FORM,
1048                         NULL );
1049         pIconData->wid = CA_TINY_IconGadget;
1050         pIconData->size = Tiny_Icon;
1051         XtAddCallback( CA_TINY_IconGadget, XmNcallback,
1052                 (XtCallbackProc) activateCB_action_icon,
1053                 (XtPointer) NULL );
1054         createCB_IconGadget( CA_TINY_IconGadget, TRUE, Tiny_Icon );
1055
1056         CA_LRG_IconForm = XtVaCreateManagedWidget( "CA_LRG_IconForm",
1057                         xmFormWidgetClass,
1058                         CA_ActionIconForm,
1059                         XmNresizePolicy, XmRESIZE_NONE,
1060                         XmNborderWidth, 0,
1061                         XmNleftPosition, 11,
1062                         XmNleftOffset, -1,
1063                         XmNleftAttachment, XmATTACH_POSITION,
1064                         XmNbottomPosition, 88,
1065                         XmNbottomOffset, 0,
1066                         XmNbottomAttachment, XmATTACH_POSITION,
1067                         NULL );
1068
1069         /* Creation of CA_LRG_IconGadget */
1070         pIconData = (IconData *)XtMalloc(sizeof(IconData));
1071         memset(pIconData, 0, sizeof(IconData));
1072         IconDataList[CA_LRG] = pIconData;
1073         CA_LRG_IconGadget = XtVaCreateManagedWidget( "CA_LRG_IconGadget",
1074                         dtIconGadgetClass,
1075                         CA_LRG_IconForm,
1076                         XmNalignment, XmALIGNMENT_CENTER,
1077                         XmNuserData, pIconData,
1078                         XmNstring, emptyString,
1079                         XmNrecomputeSize, TRUE,
1080                         XmNleftOffset, BORDER_OFFSET,
1081                         XmNleftAttachment, XmATTACH_FORM,
1082                         XmNrightOffset, BORDER_OFFSET,
1083                         XmNrightAttachment, XmATTACH_FORM,
1084                         XmNtopOffset, BORDER_OFFSET,
1085                         XmNtopAttachment, XmATTACH_FORM,
1086                         XmNbottomOffset, BORDER_OFFSET,
1087                         XmNbottomAttachment, XmATTACH_FORM,
1088                         NULL );
1089         pIconData->wid = CA_LRG_IconGadget;
1090         pIconData->size = Large_Icon;
1091         XtAddCallback( CA_LRG_IconGadget, XmNcallback,
1092                 (XtCallbackProc) activateCB_action_icon,
1093                 (XtPointer) NULL );
1094         createCB_IconGadget( CA_LRG_IconGadget, TRUE, Large_Icon );
1095
1096         XmStringFree(emptyString);
1097
1098         /* Creation of CA_EditIcon_button */
1099         CA_EditIcon_button = XtVaCreateManagedWidget( "CA_EditIcon_button",
1100                         xmPushButtonGadgetClass,
1101                         CA_ActionIconForm,
1102                         RES_CONVERT( XmNlabelString, GETMESSAGE(6, 20, "Edit Icon...")),
1103                         XmNalignment, XmALIGNMENT_BEGINNING,
1104                         XmNleftPosition, 68,
1105                         XmNleftOffset, 1,
1106                         XmNleftAttachment, XmATTACH_POSITION,
1107                         XmNtopPosition, 50,
1108                         XmNtopOffset, (int)(FINDEDIT_SPACING / 2),
1109                         XmNtopAttachment, XmATTACH_POSITION,
1110                         NULL );
1111         XtAddCallback( CA_EditIcon_button, XmNactivateCallback,
1112                 (XtCallbackProc) activateCB_edit_icon,
1113                 (XtPointer) CA_ACTION_ICONS );
1114
1115         /* Creation of CA_FindSet_button */
1116         CA_FindSet_button = XtVaCreateManagedWidget( "CA_FindSet_button",
1117                         xmPushButtonGadgetClass,
1118                         CA_ActionIconForm,
1119                         RES_CONVERT( XmNlabelString, GETMESSAGE(6, 19, "Find Set...")),
1120                         XmNalignment, XmALIGNMENT_BEGINNING,
1121                         XmNmultiClick, XmMULTICLICK_DISCARD,
1122                         XmNleftPosition, 68,
1123                         XmNleftOffset, 0,
1124                         XmNleftAttachment, XmATTACH_POSITION,
1125                         XmNbottomPosition, 50,
1126                         XmNbottomOffset, (int)(FINDEDIT_SPACING / 2),
1127                         XmNbottomAttachment, XmATTACH_POSITION,
1128                         NULL );
1129         XtAddCallback( CA_FindSet_button, XmNactivateCallback,
1130                 (XtCallbackProc) activateCB_open_FindSet,
1131                 (XtPointer) CA_ACTION_ICONS );
1132
1133         /******************************************************************/
1134         /* Determine which button is wider, and attach the short on to it */
1135         /******************************************************************/
1136         XtVaGetValues(CA_EditIcon_button, XmNwidth, &dim1, NULL);
1137         XtVaGetValues(CA_FindSet_button, XmNwidth, &dim2, NULL);
1138         if (dim1 > dim2) {
1139            XtVaSetValues(CA_FindSet_button,
1140                          XmNwidth, dim1,
1141                          NULL);
1142         } else {
1143            XtVaSetValues(CA_EditIcon_button,
1144                          XmNwidth, dim2,
1145                          NULL);
1146         }
1147         /******************************************************************/
1148         /* Determine vertical positioning for findset and edit buttons    */
1149         /******************************************************************/
1150         XtVaGetValues(CA_EditIcon_button, XmNheight, &dim1, NULL);
1151         XtVaGetValues(CA_FindSet_button, XmNheight, &dim2, NULL);
1152         if ((int)(dim1 + dim2) + (3*(FINDEDIT_SPACING)) > ICON_MIN_HEIGHT) {
1153            XtVaSetValues(CA_EditIcon_button,
1154                          XmNbottomOffset, FINDEDIT_SPACING,
1155                          XmNbottomAttachment, XmATTACH_FORM,
1156                          NULL);
1157            XtVaSetValues(CA_FindSet_button,
1158                          XmNbottomOffset, FINDEDIT_SPACING,
1159                          XmNbottomWidget, CA_EditIcon_button,
1160                          XmNbottomAttachment, XmATTACH_WIDGET,
1161                          XmNtopOffset, FINDEDIT_SPACING,
1162                          XmNtopAttachment, XmATTACH_FORM,
1163                          NULL);
1164         }
1165
1166
1167         /******************************************************************/
1168         /* Bogus separator to keep ActionIconForm a minimum height        */
1169         /******************************************************************/
1170         separator1 = XtVaCreateManagedWidget( "separator1",
1171                         xmSeparatorWidgetClass,
1172                         CA_ActionIconForm,
1173                         XmNx, 10,
1174                         XmNy, 10,
1175                         XmNwidth, 20,
1176                         XmNheight, ICON_MIN_HEIGHT,
1177                         XmNorientation, XmVERTICAL,
1178                         XmNseparatorType, XmNO_LINE,
1179                         XmNtopOffset, 5,
1180                         XmNtopAttachment, XmATTACH_FORM,
1181                         XmNbottomOffset, 5,
1182                         XmNbottomAttachment, XmATTACH_FORM,
1183                         NULL );
1184
1185         /*********************************************************************/
1186         /*                                                                   */
1187         /* Open Command                                                      */
1188         /*                                                                   */
1189         /*********************************************************************/
1190         /* Creation of CA_DblClkLabel */
1191         CA_DblClkLabel = XtVaCreateManagedWidget( "CA_DblClkLabel",
1192                         xmLabelWidgetClass,
1193                         CA_Form,
1194                         RES_CONVERT( XmNlabelString, GETMESSAGE(3, 22, "Command When Action Is Opened (Double-clicked):")),
1195                         XmNalignment, XmALIGNMENT_BEGINNING,
1196                         XmNleftOffset, 10,
1197                         XmNleftAttachment, XmATTACH_FORM,
1198                         XmNtopOffset, 15,
1199                         XmNtopWidget, CA_ActionIconForm,
1200                         XmNtopAttachment, XmATTACH_WIDGET,
1201                         XmNrightOffset, 10,
1202                         XmNrightAttachment, XmATTACH_FORM,
1203                         NULL );
1204
1205         /* Creation of CA_DblClkText */
1206         CA_DblClkText = XtVaCreateManagedWidget( "CA_DblClkText",
1207                         xmTextFieldWidgetClass,
1208                         CA_Form,
1209                         XmNnavigationType, XmTAB_GROUP,
1210                         XmNtopOffset, 0,
1211                         XmNtopWidget, CA_DblClkLabel,
1212                         XmNtopAttachment, XmATTACH_WIDGET,
1213                         XmNleftOffset, 10,
1214                         XmNleftAttachment, XmATTACH_FORM,
1215                         XmNrightOffset, 10,
1216                         XmNrightAttachment, XmATTACH_FORM,
1217                         XmNrows, 1,
1218                         NULL );
1219
1220         /*********************************************************************/
1221         /*                                                                   */
1222         /* Help Text Label                                                   */
1223         /*                                                                   */
1224         /*********************************************************************/
1225         /* Creation of CA_HlpTxtLabel */
1226         CA_HlpTxtLabel = XtVaCreateManagedWidget( "CA_HlpTxtLabel",
1227                         xmLabelWidgetClass,
1228                         CA_Form,
1229                         RES_CONVERT( XmNlabelString, GETMESSAGE(3, 30, "Help Text For Action Icon:")),
1230                         XmNalignment, XmALIGNMENT_BEGINNING,
1231                         XmNleftOffset, 10,
1232                         XmNleftAttachment, XmATTACH_FORM,
1233                         XmNtopOffset, 15,
1234                         XmNtopWidget, CA_DblClkText,
1235                         XmNtopAttachment, XmATTACH_WIDGET,
1236                         XmNrightOffset, 10,
1237                         XmNrightAttachment, XmATTACH_FORM,
1238                         NULL );
1239
1240         /*********************************************************************/
1241         /*                                                                   */
1242         /* Advanced Features Area                                            */
1243         /*                                                                   */
1244         /*********************************************************************/
1245         /* Creation of XprtOptionForm */
1246         XprtOptionForm = XtVaCreateManagedWidget( "XprtOptionForm",
1247                         xmFormWidgetClass,
1248                         CA_Form,
1249                         XmNresizePolicy, XmRESIZE_ANY,
1250                         XmNleftOffset, 1,
1251                         XmNleftAttachment, XmATTACH_FORM,
1252                         XmNrightOffset, 1,
1253                         XmNrightAttachment, XmATTACH_FORM,
1254                         XmNbottomOffset, 0,
1255                         XmNbottomAttachment, XmATTACH_FORM,
1256                         NULL );
1257
1258         /*********************************************************************/
1259         /*                                                                   */
1260         /* Optional Separator                                                */
1261         /*                                                                   */
1262         /*********************************************************************/
1263
1264         /* Creation of CA_XprtSep1 */
1265         CA_XprtSep1 = XtVaCreateManagedWidget( "CA_XprtSep1",
1266                         xmSeparatorWidgetClass,
1267                         XprtOptionForm,
1268                         XmNleftOffset, 1,
1269                         XmNleftAttachment, XmATTACH_FORM,
1270                         XmNrightOffset, 1,
1271                         XmNrightAttachment, XmATTACH_FORM,
1272                         XmNtopOffset, 0,
1273                         XmNtopAttachment, XmATTACH_FORM,
1274                         NULL );
1275
1276         /*********************************************************************/
1277         /*                                                                   */
1278         /* Prompt Field                                                      */
1279         /*                                                                   */
1280         /*********************************************************************/
1281         /* Creation of CA_ActionOpenLabel */
1282         CA_ActionOpenLabel = XtVaCreateManagedWidget( "CA_ActionOpenLabel",
1283                         xmLabelWidgetClass,
1284                         XprtOptionForm,
1285                         RES_CONVERT( XmNlabelString, GETMESSAGE(4, 11, "When Action Opens, Ask Users for:")),
1286                         XmNalignment, XmALIGNMENT_BEGINNING,
1287                         XmNleftOffset, 10,
1288                         XmNleftAttachment, XmATTACH_FORM,
1289                         XmNrightOffset, 10,
1290                         XmNrightAttachment, XmATTACH_FORM,
1291                         XmNtopOffset, 15,
1292                         XmNtopWidget, CA_XprtSep1,
1293                         XmNtopAttachment, XmATTACH_WIDGET,
1294                         NULL );
1295
1296         /* Creation of CA_XprtActionOpenText */
1297         CA_XprtActionOpenText = XtVaCreateManagedWidget( "CA_XprtActionOpenText",
1298                         xmTextWidgetClass,
1299                         XprtOptionForm,
1300                         XmNvalue, "",
1301                         XmNnavigationType, XmTAB_GROUP,
1302                         XmNleftOffset, 10,
1303                         XmNleftAttachment, XmATTACH_FORM,
1304                         XmNrightOffset, 10,
1305                         XmNrightAttachment, XmATTACH_FORM,
1306                         XmNtopOffset, 0,
1307                         XmNtopWidget, CA_ActionOpenLabel,
1308                         XmNtopAttachment, XmATTACH_WIDGET,
1309                       /*XmNeditMode, XmMULTI_LINE_EDIT,*/
1310                       /*XmNwordWrap, TRUE,*/
1311                         NULL );
1312
1313         /*********************************************************************/
1314         /*                                                                   */
1315         /* Filetypes that use this Action area                               */
1316         /*                                                                   */
1317         /*********************************************************************/
1318         /* Creation of CA_FiletypesLabel */
1319         CA_FiletypesLabel = XtVaCreateManagedWidget( "CA_FiletypesLabel",
1320                         xmLabelWidgetClass,
1321                         XprtOptionForm,
1322                         XmNx, 10,
1323                         XmNy, 122,
1324                         RES_CONVERT( XmNlabelString, GETMESSAGE(4, 12, "Datatypes That Use This Action:")),
1325                         XmNalignment, XmALIGNMENT_BEGINNING,
1326                         XmNleftOffset, 10,
1327                         XmNleftAttachment, XmATTACH_FORM,
1328                         XmNrightOffset, 10,
1329                         XmNrightAttachment, XmATTACH_FORM,
1330                         XmNtopOffset, 15,
1331                         XmNtopWidget, CA_XprtActionOpenText,
1332                         XmNtopAttachment, XmATTACH_WIDGET,
1333                         NULL );
1334
1335         /*********************************************************************/
1336         /*                                                                   */
1337         /* Add, Delete, Edit buttons for Filetypes                           */
1338         /*                                                                   */
1339         /*********************************************************************/
1340         /* Creation of rowColumn1 */
1341         rowColumn1 = XtVaCreateManagedWidget( "rowColumn1",
1342                         xmRowColumnWidgetClass,
1343                         XprtOptionForm,
1344                         XmNnavigationType, XmTAB_GROUP,
1345                         XmNtopOffset, 0,
1346                         XmNtopWidget, CA_FiletypesLabel,
1347                         XmNtopAttachment, XmATTACH_WIDGET,
1348                         XmNrightOffset, 10,
1349                         XmNrightAttachment, XmATTACH_FORM,
1350                         NULL );
1351
1352         /* Creation of CA_FiletypesAdd */
1353         CA_FiletypesAdd = XtVaCreateManagedWidget( "CA_FiletypesAdd",
1354                         xmPushButtonGadgetClass,
1355                         rowColumn1,
1356                         RES_CONVERT( XmNlabelString, GETMESSAGE(4, 13, "Add...")),
1357                         XmNalignment, XmALIGNMENT_BEGINNING,
1358                         XmNmarginLeft, 5,
1359                         XmNmarginRight, 5,
1360                         NULL );
1361         XtAddCallback( CA_FiletypesAdd, XmNactivateCallback,
1362                 (XtCallbackProc) activateCB_add_filetype,
1363                 (XtPointer) NULL );
1364
1365         /* Creation of CA_FiletypesDelete */
1366         CA_FiletypesDelete = XtVaCreateManagedWidget( "CA_FiletypesDelete",
1367                         xmPushButtonGadgetClass,
1368                         rowColumn1,
1369                         RES_CONVERT( XmNlabelString, GETMESSAGE(4, 14, "Delete")),
1370                         XmNalignment, XmALIGNMENT_BEGINNING,
1371                         XmNmarginLeft, 5,
1372                         XmNmarginRight, 5,
1373                         NULL );
1374         XtAddCallback( CA_FiletypesDelete, XmNactivateCallback,
1375                 (XtCallbackProc) activateCB_CA_FiletypesDelete,
1376                 (XtPointer) NULL );
1377
1378         /* Creation of CA_FiletypesEdit */
1379         CA_FiletypesEdit = XtVaCreateManagedWidget( "CA_FiletypesEdit",
1380                         xmPushButtonGadgetClass,
1381                         rowColumn1,
1382                         RES_CONVERT( XmNlabelString, GETMESSAGE(4, 15, "Edit...")),
1383                         XmNalignment, XmALIGNMENT_BEGINNING,
1384                         XmNmarginLeft, 5,
1385                         XmNmarginRight, 5,
1386                         NULL );
1387         XtAddCallback( CA_FiletypesEdit, XmNactivateCallback,
1388                 (XtCallbackProc) activateCB_edit_filetype,
1389                 (XtPointer) NULL );
1390
1391         /*********************************************************************/
1392         /*                                                                   */
1393         /* Filetypes Listbox Area                                            */
1394         /*                                                                   */
1395         /*********************************************************************/
1396         /* Creation of CA_FiletypesWindow */
1397         CA_FiletypesWindow = XtVaCreateManagedWidget( "CA_FiletypesWindow",
1398                         xmScrolledWindowWidgetClass,
1399                         XprtOptionForm,
1400                         XmNx, 10,
1401                         XmNy, 140,
1402                         XmNshadowThickness, 2,
1403                         XmNleftOffset, 10,
1404                         XmNleftAttachment, XmATTACH_FORM,
1405                         XmNtopOffset, 0,
1406                         XmNtopWidget, CA_FiletypesLabel,
1407                         XmNtopAttachment, XmATTACH_WIDGET,
1408                         XmNbottomOffset, 0,
1409                         XmNbottomWidget, rowColumn1,
1410                         XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET,
1411                         XmNrightOffset, 10,
1412                         XmNrightWidget, rowColumn1,
1413                         XmNrightAttachment, XmATTACH_WIDGET,
1414                         NULL );
1415
1416         /* Creation of CA_FiletypesList */
1417         CA_FiletypesList = XtVaCreateManagedWidget( "CA_FiletypesList",
1418                         xmListWidgetClass,
1419                         CA_FiletypesWindow,
1420                         XmNselectionPolicy, XmSINGLE_SELECT,
1421                         XmNshadowThickness, 0,
1422                         NULL );
1423
1424         /*********************************************************************/
1425         /*                                                                   */
1426         /* Droppable Filetypes Toggle Area                                   */
1427         /*                                                                   */
1428         /*********************************************************************/
1429         /* Creation of CA_DroppableFiletypesLabel */
1430         CA_DroppableFiletypesLabel = XtVaCreateManagedWidget( "CA_DroppableFiletypesLabel",
1431                         xmLabelWidgetClass,
1432                         XprtOptionForm,
1433                         XmNx, 10,
1434                         XmNy, 204,
1435                         XmNalignment, XmALIGNMENT_BEGINNING,
1436                         RES_CONVERT( XmNlabelString, GETMESSAGE(4, 16, "Dropable Datatypes:")),
1437                         XmNleftOffset, 10,
1438                         XmNleftAttachment, XmATTACH_FORM,
1439                         XmNtopOffset, 15,
1440                         XmNtopWidget, rowColumn1,
1441                         XmNtopAttachment, XmATTACH_WIDGET,
1442                         NULL );
1443
1444         if (bLowRes) {
1445            /* Creation of CA_DroppableFiletypesRowColumn */
1446            CA_DroppableFiletypesRowColumn = XtVaCreateManagedWidget( "CA_DroppableFiletypesRowColumn",
1447                            xmRowColumnWidgetClass,
1448                            XprtOptionForm,
1449                            XmNx, 200,
1450                            XmNy, 204,
1451                            RES_CONVERT( XmNlabelString, "" ),
1452                            XmNorientation, XmHORIZONTAL,
1453                            XmNpacking, XmPACK_TIGHT,
1454                            XmNradioBehavior, TRUE,
1455                            XmNwhichButton, 1,
1456                            XmNnavigationType, XmTAB_GROUP,
1457                            XmNtopOffset, 0,
1458                            XmNtopWidget, CA_DroppableFiletypesLabel,
1459                            XmNtopAttachment, XmATTACH_WIDGET,
1460                            XmNbottomOffset, 0,
1461                            XmNbottomAttachment, XmATTACH_FORM,
1462                            XmNleftOffset, 10,
1463                            XmNleftAttachment, XmATTACH_FORM,
1464                            XmNrightOffset, 10,
1465                            XmNrightAttachment, XmATTACH_FORM,
1466                            NULL );
1467         } else {
1468            /* Creation of CA_DroppableFiletypesRowColumn */
1469            CA_DroppableFiletypesRowColumn = XtVaCreateManagedWidget( "CA_DroppableFiletypesRowColumn",
1470                            xmRowColumnWidgetClass,
1471                            XprtOptionForm,
1472                            RES_CONVERT( XmNlabelString, "" ),
1473                            XmNorientation, XmHORIZONTAL,
1474                            XmNpacking, XmPACK_TIGHT,
1475                            XmNradioBehavior, TRUE,
1476                            XmNwhichButton, 1,
1477                            XmNnavigationType, XmTAB_GROUP,
1478                            XmNtopOffset, -7,
1479                            XmNtopWidget, CA_DroppableFiletypesLabel,
1480                            XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET,
1481                            XmNbottomOffset, 0,
1482                            XmNbottomAttachment, XmATTACH_FORM,
1483                            XmNleftOffset, 0,
1484                            XmNleftWidget, CA_DroppableFiletypesLabel,
1485                            XmNleftAttachment, XmATTACH_WIDGET,
1486                            XmNrightOffset, 10,
1487                            XmNrightAttachment, XmATTACH_FORM,
1488                            NULL );
1489         }
1490
1491         /* Creation of CA_AllFiletypesToggle */
1492         CA_AllFiletypesToggle = XtVaCreateManagedWidget( "CA_AllFiletypesToggle",
1493                         xmToggleButtonWidgetClass,
1494                         CA_DroppableFiletypesRowColumn,
1495                         RES_CONVERT( XmNlabelString, GETMESSAGE(4, 17, "All Datatypes")),
1496                         XmNset, TRUE,
1497                         NULL );
1498
1499         /* Creation of CA_FiletypesInListToggle */
1500         CA_FiletypesInListToggle = XtVaCreateManagedWidget( "CA_FiletypesInListToggle",
1501                         xmToggleButtonWidgetClass,
1502                         CA_DroppableFiletypesRowColumn,
1503                         RES_CONVERT( XmNlabelString, GETMESSAGE(4, 18, "Only Above List")),
1504                         NULL );
1505         XtAddCallback( CA_FiletypesInListToggle, XmNvalueChangedCallback,
1506                 (XtCallbackProc) valueChangedCB_DroppableFiletypes,
1507                 (XtPointer) CA_DF_ONLYFTFILES );
1508
1509
1510         /*********************************************************************/
1511         /*                                                                   */
1512         /* Expand button                                                     */
1513         /*                                                                   */
1514         /*********************************************************************/
1515         CA_Expand = XtVaCreateManagedWidget( "CA_Expand",
1516                         xmPushButtonWidgetClass,
1517                         CA_Form,
1518                         RES_CONVERT( XmNlabelString, GETMESSAGE(3, 50, "Advanced")),
1519                         XmNmultiClick, XmMULTICLICK_DISCARD,
1520                         XmNnavigationType, XmTAB_GROUP,
1521                         XmNmarginLeft, 5,
1522                         XmNmarginRight, 5,
1523                         XmNleftOffset, 10,
1524                         XmNleftAttachment, XmATTACH_FORM,
1525                         XmNbottomOffset, 20,
1526                         XmNbottomWidget, XprtOptionForm,
1527                         XmNbottomAttachment, XmATTACH_WIDGET,
1528                         NULL );
1529         XtAddCallback( CA_Expand, XmNactivateCallback,
1530                 (XtCallbackProc) activateCB_ExpertOption,
1531                 (XtPointer) NULL );
1532
1533         /*********************************************************************/
1534         /*                                                                   */
1535         /* Start of WindowType Option Menu                                   */
1536         /*                                                                   */
1537         /*********************************************************************/
1538         CA_WindowType_OptionMenuShell = XtVaCreatePopupShell ("CA_WindowType_OptionMenuShell",
1539                         xmMenuShellWidgetClass,
1540                         CA_Form,
1541                         XmNwidth, 1,
1542                         XmNheight, 1,
1543                         XmNallowShellResize, TRUE,
1544                         XmNoverrideRedirect, TRUE,
1545                         NULL );
1546
1547         CA_WindowType_Pane = XtVaCreateWidget( "CA_WindowType_Pane",
1548                         xmRowColumnWidgetClass,
1549                       /*CA_WindowType,*/
1550                         CA_WindowType_OptionMenuShell,
1551                         XmNrowColumnType, XmMENU_PULLDOWN,
1552                         NULL );
1553
1554         CA_WinTypeX = XtVaCreateManagedWidget( "CA_WinTypeX",
1555                         xmPushButtonWidgetClass,
1556                         CA_WindowType_Pane,
1557                         RES_CONVERT( XmNlabelString, GETMESSAGE(3, 34, "Graphical (X-Window)")),
1558                         NULL );
1559         XtAddCallback( CA_WinTypeX, XmNactivateCallback,
1560                 (XtCallbackProc) activateCB_WindowTypeOptionMenu,
1561                 (XtPointer) CA_WT_XWINDOWS );
1562
1563         CA_WinTypeAutoClose = XtVaCreateManagedWidget( "CA_WinTypeAutoClose",
1564                         xmPushButtonWidgetClass,
1565                         CA_WindowType_Pane,
1566                         RES_CONVERT( XmNlabelString, GETMESSAGE(3, 36, "Terminal (Auto-Close)")),
1567                         NULL );
1568         XtAddCallback( CA_WinTypeAutoClose, XmNactivateCallback,
1569                 (XtCallbackProc) activateCB_WindowTypeOptionMenu,
1570                 (XtPointer) CA_WT_TERM );
1571
1572         CA_WinTypeManualClose = XtVaCreateManagedWidget( "CA_WinTypeManualClose",
1573                         xmPushButtonWidgetClass,
1574                         CA_WindowType_Pane,
1575                         RES_CONVERT( XmNlabelString, GETMESSAGE(3, 38, "Terminal (Manual Close)")),
1576                         NULL );
1577         XtAddCallback( CA_WinTypeManualClose, XmNactivateCallback,
1578                 (XtCallbackProc) activateCB_WindowTypeOptionMenu,
1579                 (XtPointer) CA_WT_PERMTERM );
1580
1581         CA_WinTypeNoOutput = XtVaCreateManagedWidget( "CA_WinTypeNoOutput",
1582                         xmPushButtonWidgetClass,
1583                         CA_WindowType_Pane,
1584                         RES_CONVERT( XmNlabelString, GETMESSAGE(3, 40, "No Output")),
1585                         NULL );
1586         XtAddCallback( CA_WinTypeNoOutput, XmNactivateCallback,
1587                 (XtCallbackProc) activateCB_WindowTypeOptionMenu,
1588                 (XtPointer) CA_WT_XWINDOWS );
1589
1590         CA_WindowType_OptionMenu = XtVaCreateManagedWidget( "CA_WindowType_OptionMenu",
1591                         xmRowColumnWidgetClass,
1592                         CA_Form,
1593                         XmNrowColumnType, XmMENU_OPTION,
1594                         XmNsubMenuId, CA_WindowType_Pane,
1595                         RES_CONVERT( XmNlabelString, GETMESSAGE(3, 32, "Window Type: ")),
1596                         XmNnavigationType, XmTAB_GROUP,
1597                         XmNleftOffset, 10,
1598                         XmNleftAttachment, XmATTACH_FORM,
1599                         XmNrightOffset, 10,
1600                         XmNrightAttachment, XmATTACH_FORM,
1601                         XmNbottomOffset, 15,
1602                         XmNbottomWidget, CA_Expand,
1603                         XmNbottomAttachment, XmATTACH_WIDGET,
1604                         NULL );
1605         CA_WindowTypeArea = CA_WindowType_OptionMenu;
1606
1607         /*********************************************************************/
1608         /*                                                                   */
1609         /* Help Text Window                                                  */
1610         /*                                                                   */
1611         /*********************************************************************/
1612         /* Creation of CA_HelpTextWindow */
1613         CA_HelpTextWindow = XtVaCreateManagedWidget( "CA_HelpTextWindow",
1614                         xmScrolledWindowWidgetClass,
1615                         CA_Form,
1616                         XmNx, 10,
1617                         XmNy, 336,
1618                         XmNshadowThickness, 0,
1619                         XmNtopOffset, 0,
1620                         XmNtopWidget, CA_HlpTxtLabel,
1621                         XmNtopAttachment, XmATTACH_WIDGET,
1622                         XmNleftOffset, 10,
1623                         XmNleftAttachment, XmATTACH_FORM,
1624                         XmNrightOffset, 10,
1625                         XmNrightAttachment, XmATTACH_FORM,
1626                         XmNbottomOffset, 15,
1627                         XmNbottomWidget, CA_WindowTypeArea,
1628                         XmNbottomAttachment, XmATTACH_WIDGET,
1629                         NULL );
1630
1631         /* Creation of CA_HelpText */
1632         CA_HelpText = XtVaCreateManagedWidget( "CA_HelpText",
1633                         xmTextWidgetClass,
1634                         CA_HelpTextWindow,
1635                         XmNeditMode, XmMULTI_LINE_EDIT ,
1636                         XmNscrollVertical, TRUE,
1637                         XmNscrollHorizontal, FALSE,
1638                         XmNwordWrap, TRUE,
1639                         XmNx, 12,
1640                         XmNy, 0,
1641                         XmNrows, 3,
1642                         NULL );
1643
1644         /*********************************************************************/
1645         /*                                                                   */
1646         /* Misc.                                                             */
1647         /*                                                                   */
1648         /*********************************************************************/
1649         XtVaSetValues(CA_MenuBar,
1650                         XmNmenuHelpWidget, CA_MB_HelpTop,
1651                         NULL );
1652
1653         XtAddCallback( CreateActionAppShell, XmNdestroyCallback,
1654                 (XtCallbackProc) UxDestroyContextCB,
1655                 (XtPointer) NULL );
1656
1657         XmMainWindowSetAreas( CreateActionMainWindow, CA_MenuBar, (Widget) NULL,
1658                         (Widget) NULL, (Widget) NULL, CA_Form );
1659
1660         return ( CreateActionAppShell );
1661 }
1662
1663 /*******************************************************************************
1664        The following is the 'Interface function' which is the
1665        external entry point for creating this interface.
1666        This function should be called from your application or from
1667        a callback function.
1668 *******************************************************************************/
1669
1670 Widget  create_applicationShell1(swidget _UxUxParent)
1671 {
1672         Widget                   rtrn;
1673         _UxCCreateActionAppShell *UxContext;
1674         Dimension                dimHeight;
1675         Dimension                dimWidth;
1676         Dimension                dimTmp;
1677         Widget                   widTmp;
1678
1679         UxCreateActionAppShellContext = UxContext =
1680                 (_UxCCreateActionAppShell *) UxNewContext( sizeof(_UxCCreateActionAppShell), False );
1681
1682         UxParent = _UxUxParent;
1683
1684         rtrn = _Uxbuild_CreateActionAppShell();
1685
1686         /******************************************************************/
1687         /* Need to realize app shell widget now, because we need to       */
1688         /* determine initial geometry before the advanced area is         */
1689         /* unmanaged in   set_ca_dialog_height  routine.                  */
1690         /******************************************************************/
1691         XtSetMappedWhenManaged(rtrn, False);
1692         XtRealizeWidget(rtrn);
1693         XmProcessTraversal(CA_ActionNameTextField, XmTRAVERSE_CURRENT);
1694
1695         FileTypes = (Widget)CA_FiletypesList;
1696
1697         set_ca_dialog_height ();
1698
1699         if (sessiondata.useSession) {
1700            XtVaSetValues (CreateActionAppShell,
1701                           XmNx, sessiondata.x,
1702                           XmNy, sessiondata.y,
1703                           XmNwidth, sessiondata.width,
1704                           XmNheight, sessiondata.height,
1705                           XmNinitialState, sessiondata.iconicState,
1706                           NULL);
1707
1708            /* display in workspace */
1709
1710            if (sessiondata.workspaces[0])
1711            {
1712                char *workspaces = sessiondata.workspaces;
1713                char *ptr;
1714                Atom * workspace_atoms = NULL;
1715                int num_workspaces = 0;
1716                do
1717                {
1718                    ptr = strchr (workspaces, '*');
1719                    if (ptr != NULL) *ptr = '\0';
1720
1721                    workspace_atoms = (Atom *) XtRealloc (
1722                                 (char *)workspace_atoms, 
1723                                 sizeof (Atom) * (num_workspaces + 1));
1724                    workspace_atoms[num_workspaces] = XmInternAtom(
1725                                         XtDisplay(CreateActionAppShell),
1726                                         workspaces, True);
1727
1728                    num_workspaces++;                            
1729                    if (ptr != NULL)
1730                    {
1731                        *ptr = '*';
1732                        workspaces = ptr + 1;
1733                    }
1734                } while (ptr != NULL);
1735                DtWsmSetWorkspacesOccupied( XtDisplay(CreateActionAppShell),
1736                                            XtWindow(CreateActionAppShell),
1737                                            workspace_atoms,
1738                                            num_workspaces);
1739                XtFree ((char *) workspace_atoms);
1740                workspace_atoms = NULL;
1741            }
1742         }
1743         else if (bLowRes) {
1744            XtVaGetValues (CA_Form,
1745                           XmNheight, &dimHeight,
1746                           XmNwidth, &dimWidth,
1747                           NULL);
1748            XtVaGetValues (CreateActionMainWindow,
1749                           XmNverticalScrollBar, &widTmp,
1750                           NULL);
1751            XtVaGetValues (widTmp,
1752                           XmNwidth, &dimTmp,
1753                           NULL);
1754            dimHeight += dimTmp;
1755            dimWidth += dimTmp;
1756
1757            XtVaGetValues (CA_MenuBar,
1758                           XmNheight, &dimTmp,
1759                           NULL);
1760            dimHeight += dimTmp;
1761
1762            XtVaSetValues (CreateActionAppShell,
1763                           XmNheight, dimHeight,
1764                           XmNwidth, dimWidth,
1765                           NULL);
1766         }
1767
1768         XtSetMappedWhenManaged(rtrn, True);
1769         XtManageChild(rtrn);
1770
1771         return(rtrn);
1772 }
1773
1774 /*******************************************************************************
1775        END OF FILE
1776 *******************************************************************************/
1777