Use C++ linker
[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, NULL, NULL, NULL, NULL, NULL, 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
349   /**************************************************************************/
350   /* Determine the filetypes to delete and delete them.                     */
351   /**************************************************************************/
352   XtVaGetValues(FileTypes, XmNitems, &items, NULL);
353   if (XmListGetSelectedPos(FileTypes, &poslist, &poscnt)) {
354      n = poscnt;
355      p = poslist + (n-1);
356      while (n--) {
357        /*********************************************************************/
358        /* Delete the filetype name from the listbox.                        */
359        /*********************************************************************/
360        XmListDeleteItem(FileTypes, items[*p -1]);
361        p--;
362      }
363
364      /***********************************************************************/
365      /* Remove the filetypes from the filetype array in the ActionData      */
366      /* structure.                                                          */
367      /***********************************************************************/
368      if ((AD.cFiletypes - poscnt) > 0) {
369         if ( papArray = (FiletypeData **) XtMalloc(sizeof(FiletypeData *) * (AD.cFiletypes - poscnt)) ) {
370            cnt = 0;
371            for (i = 0; i < AD.cFiletypes; i++) {
372               bFound = FALSE;
373               for (k = 0; k < poscnt; k++) {
374                 if ((i + 1) == poslist[k]) {
375                    bFound = TRUE;
376                    break;
377                 }
378               }
379               /**************************************************************/
380               /* If did not find this element in the delete list, then add  */
381               /* it back to our good list.                                  */
382               /* Else do not include in the good list and free its memory.  */
383               /**************************************************************/
384               if (!bFound) {
385                  papArray[cnt] = AD.papFiletypes[i];
386                  cnt++;
387               } else {
388                  free_Filetypedata(AD.papFiletypes[i]);
389               }
390            }
391            if (AD.papFiletypes) {
392              XtFree((XtPointer)AD.papFiletypes);
393            }
394            AD.papFiletypes = papArray;
395            AD.cFiletypes = cnt;
396         }
397      } else {
398         /********************************************************************/
399         /* Delete the entire array.                                         */
400         /********************************************************************/
401         for (i = 0; i < AD.cFiletypes; i++) {
402           free_Filetypedata(AD.papFiletypes[i]);
403         }
404         AD.papFiletypes = (FiletypeData **)NULL;
405         AD.cFiletypes = 0;
406      }
407   } else {
408      msgPtr1 = XtNewString(GETMESSAGE(5, 120,
409                   "You have not selected a Datatype from the\n\
410 'Datatypes That Use This Action' list."));
411      msgPtr2 = XtNewString(GETMESSAGE(5, 125,
412                   "Please select the Datatype you would like to Delete."));
413      fmtPtr = "%s\n%s";
414      errPtr = XtMalloc((strlen(msgPtr1) + strlen(msgPtr2) +
415                         strlen(fmtPtr) + 1) * sizeof(char));
416      sprintf(errPtr, fmtPtr, msgPtr1, msgPtr2);
417      XtFree(msgPtr2);
418      XtFree(msgPtr1);
419      display_error_message(CreateActionAppShell, errPtr);
420      XtFree(errPtr);
421   }
422 }
423
424 #if 0
425 /*****************************************************************************/
426 /*                                                                           */
427 /* valueChangedCB_CA_WinType                                                 */
428 /*                                                                           */
429 /*****************************************************************************/
430 static  void    valueChangedCB_CA_WinType( Widget UxWidget,
431                                            XtPointer UxClientData,
432                                            XtPointer UxCallbackArg)
433 {
434   Boolean bSetToggle;
435
436   bSetToggle = ((XmToggleButtonCallbackStruct *)UxCallbackArg)->set;
437 #ifdef DEBUG
438   printf("Wintype change before %X\n", AD.fsFlags);
439 #endif
440   switch ((int)UxClientData) {
441     case CA_WT_XWINDOWS :
442          if (bSetToggle) AD.fsFlags |= CA_WT_XWINDOWS;
443          else AD.fsFlags &= (~(CA_WT_XWINDOWS));
444          break;
445     case CA_WT_TERM :
446          if (bSetToggle) AD.fsFlags |= CA_WT_TERM;
447          else AD.fsFlags &= (~(CA_WT_TERM));
448          break;
449     case CA_WT_PERMTERM :
450          if (bSetToggle) AD.fsFlags |= CA_WT_PERMTERM;
451          else AD.fsFlags &= (~(CA_WT_PERMTERM));
452          break;
453   }
454 #ifdef DEBUG
455   printf("Wintype change after %X\n", AD.fsFlags);
456 #endif
457 }
458 #endif
459
460 /*****************************************************************************/
461 /*                                                                           */
462 /* valueChangedCB_DroppableFiletypes                                         */
463 /*                                                                           */
464 /*****************************************************************************/
465 static  void    valueChangedCB_DroppableFiletypes( Widget UxWidget,
466                                            XtPointer UxClientData,
467                                            XtPointer UxCallbackArg)
468 {
469   if (((XmToggleButtonCallbackStruct *)UxCallbackArg)->set) {
470     AD.fsFlags |= CA_DF_ONLYFTFILES;
471   } else {
472     AD.fsFlags &= (~(CA_DF_ONLYFTFILES));
473   }
474 }
475
476 /*****************************************************************************/
477 /*                                                                           */
478 /* simpleCB_WindowTypeOptionMenu                                             */
479 /*                                                                           */
480 /*****************************************************************************/
481 static  void    activateCB_WindowTypeOptionMenu( Widget UxWidget,
482                                            XtPointer UxClientData,
483                                            XtPointer UxCallbackArg)
484 {
485   AD.fsFlags &= (~(CA_WT_XWINDOWS | CA_WT_TERM | CA_WT_PERMTERM));
486   switch ((int)UxClientData) {
487     case CA_WT_XWINDOWS :
488          AD.fsFlags |= CA_WT_XWINDOWS;
489          break;
490     case CA_WT_TERM :
491          AD.fsFlags |= CA_WT_TERM;
492          break;
493     case CA_WT_PERMTERM :
494          AD.fsFlags |= CA_WT_PERMTERM;
495          break;
496   }
497 }
498
499 /*******************************************************************************
500        The 'build_' function creates all the widgets
501        using the resource values specified in the Property Editor.
502 *******************************************************************************/
503
504 static Widget   _Uxbuild_CreateActionAppShell(void)
505 {
506         Widget               _UxParent;
507         Widget               CA_MB_FileOption_shell;
508         Widget               CA_MB_HelpOption_shell;
509         Widget               CA_MB_Help_Sep1;
510         Widget               CA_MB_Help_Sep2;
511         Widget               CA_MB_OptionsOption_shell;
512         char                 *UxTmp0;
513
514         Widget               CA_WindowType_OptionMenuShell;
515         Widget               CA_WindowType_Pane;
516         Widget               CA_WindowType_OptionMenu;
517         char                 mnemonic[2];
518         Dimension            dim1, dim2;
519         Widget               CA_MED_IconForm, CA_TINY_IconForm, CA_LRG_IconForm;
520         IconData             *pIconData;
521
522         XmString             emptyString;
523         char                 titleBuf[MAXBUFSIZE];
524
525 #define ICON_MIN_HEIGHT      83
526 #define FINDEDIT_SPACING     6
527 #define BORDER_OFFSET        3
528
529         /* Creation of CreateActionAppShell */
530         _UxParent = UxParent;
531         if ( _UxParent == NULL )
532         {
533             _UxParent = UxTopLevel;
534         }
535
536         strcpy(titleBuf, GETMESSAGE(3, 10, "Create Action"));
537         CreateActionAppShell = XtVaCreatePopupShell( "CreateActionAppShell",
538                         applicationShellWidgetClass,
539                         _UxParent,
540                         /*
541                         XmNx, 35,
542                         XmNy, 8,
543                         XmNminWidth, -1,
544                         XmNminHeight, -1,
545                         */
546                         XmNiconName, titleBuf,
547                         XmNtitle, titleBuf,
548                         XmNallowShellResize, TRUE,
549                         XmNheight, 550,
550                         XmNdeleteResponse, XmDO_NOTHING, /* CDExc19440 */
551                         NULL );
552
553         /* CDExc19440 - make sure user doesn't accidentally lose work. */
554         XmAddWMProtocolCallback(CreateActionAppShell,
555                                 XmInternAtom(UxDisplay,
556                                              "WM_DELETE_WINDOW",
557                                              False),
558                                 activateCB_FileQuit,
559                                 (XtPointer)NULL);
560
561         if (bLowRes) {
562            /* Creation of CreateActionMainWindow */
563            CreateActionMainWindow = XtVaCreateManagedWidget( "CreateActionMainWindow",
564                         xmMainWindowWidgetClass,
565                         CreateActionAppShell,
566                         XmNunitType, XmPIXELS,
567                         XmNx, 0,
568                         XmNy, 0,
569                         XmNscrollingPolicy, XmAUTOMATIC,
570                         NULL );
571         } else {
572            /* Creation of CreateActionMainWindow */
573            CreateActionMainWindow = XtVaCreateManagedWidget( "CreateActionMainWindow",
574                         xmMainWindowWidgetClass,
575                         CreateActionAppShell,
576                         XmNunitType, XmPIXELS,
577                         XmNx, 0,
578                         XmNy, 0,
579                         NULL );
580         }
581         XtAddCallback( CreateActionMainWindow, XmNhelpCallback,
582                 (XtCallbackProc) helpCB_general,
583                 (XtPointer) HELP_ONITEM );
584
585         /*********************************************************************/
586         /*                                                                   */
587         /* MenuBar                                                           */
588         /*                                                                   */
589         /*********************************************************************/
590         /* Creation of CA_MenuBar */
591         CA_MenuBar = XtVaCreateManagedWidget( "CA_MenuBar",
592                         xmRowColumnWidgetClass,
593                         CreateActionMainWindow,
594                         XmNrowColumnType, XmMENU_BAR,
595                         XmNmenuAccelerator, "<KeyUp>F10",
596                         XmNpacking, XmPACK_TIGHT,
597                         XmNentryAlignment, XmALIGNMENT_BEGINNING,
598                         XmNorientation, XmHORIZONTAL,
599                         NULL );
600
601         /* Creation of CA_MB_FileOption */
602         CA_MB_FileOption_shell = XtVaCreatePopupShell ("CA_MB_FileOption_shell",
603                         xmMenuShellWidgetClass, CA_MenuBar,
604                         XmNwidth, 1,
605                         XmNheight, 1,
606                         XmNallowShellResize, TRUE,
607                         XmNoverrideRedirect, TRUE,
608                         NULL );
609
610         CA_MB_FileOption = XtVaCreateWidget( "CA_MB_FileOption",
611                         xmRowColumnWidgetClass,
612                         CA_MB_FileOption_shell,
613                         XmNrowColumnType, XmMENU_PULLDOWN,
614                         NULL );
615
616         /* Creation of CA_MB_FileNew */
617         /*
618         mnemonic = GETMESSAGE(2, 21, "N");
619         */
620         strcpy(mnemonic, GETMESSAGE(2, 21, "N"));
621         CA_MB_FileNew = XtVaCreateManagedWidget( "CA_MB_FileNew",
622                         xmPushButtonWidgetClass,
623                         CA_MB_FileOption,
624                         RES_CONVERT( XmNlabelString, GETMESSAGE(2, 20, "New")),
625                         XmNmnemonic, mnemonic[0],
626                         NULL );
627         XtAddCallback( CA_MB_FileNew, XmNactivateCallback,
628                 (XtCallbackProc) activateCB_FileNew,
629                 (XtPointer) NULL );
630
631         /* Creation of CA_MB_FileOpen */
632         /*
633         mnemonic = GETMESSAGE(2, 16, "O");
634         */
635         strcpy(mnemonic, GETMESSAGE(2, 16, "O"));
636         CA_MB_FileOpen = XtVaCreateManagedWidget( "CA_MB_FileOpen",
637                         xmPushButtonWidgetClass,
638                         CA_MB_FileOption,
639                         RES_CONVERT( XmNlabelString, GETMESSAGE(2, 15, "Open...")),
640                         XmNmnemonic, mnemonic[0],
641                         NULL );
642         XtAddCallback( CA_MB_FileOpen, XmNactivateCallback,
643                 (XtCallbackProc) activateCB_FileOpen,
644                 (XtPointer) NULL );
645
646         /* Creation of CA_MB_FileSave */
647         /*
648         mnemonic = GETMESSAGE(2, 26, "S");
649         */
650         strcpy(mnemonic, GETMESSAGE(2, 26, "S"));
651         CA_MB_FileSave = XtVaCreateManagedWidget( "CA_MB_FileSave",
652                         xmPushButtonWidgetClass,
653                         CA_MB_FileOption,
654                         RES_CONVERT( XmNlabelString, GETMESSAGE(2, 25, "Save")),
655                         XmNmnemonic, mnemonic[0],
656                         NULL );
657         XtAddCallback( CA_MB_FileSave, XmNactivateCallback,
658                 (XtCallbackProc) activateCB_CA_MB_FileSave,
659                 (XtPointer) NULL );
660
661         /* Creation of CA_MB_Sep */
662         CA_MB_Sep = XtVaCreateManagedWidget( "CA_MB_Sep",
663                         xmSeparatorWidgetClass,
664                         CA_MB_FileOption,
665                         NULL );
666
667         /* Creation of CA_MB_FileExit */
668         /*
669         mnemonic = GETMESSAGE(2, 31, "x");
670         */
671         strcpy(mnemonic, GETMESSAGE(2, 31, "x"));
672         CA_MB_FileExit = XtVaCreateManagedWidget( "CA_MB_FileExit",
673                         xmPushButtonWidgetClass,
674                         CA_MB_FileOption,
675                         RES_CONVERT( XmNlabelString, GETMESSAGE(2, 30, "Exit")),
676                         XmNmnemonic, mnemonic[0],
677                         NULL );
678         XtAddCallback( CA_MB_FileExit, XmNactivateCallback,
679                 (XtCallbackProc) activateCB_FileQuit,
680                 (XtPointer) NULL );
681
682         /* Creation of CA_MB_FileTop */
683         /*
684         mnemonic = GETMESSAGE(2, 11, "F");
685         */
686         strcpy(mnemonic, GETMESSAGE(2, 11, "F"));
687         CA_MB_FileTop = XtVaCreateManagedWidget( "CA_MB_FileTop",
688                         xmCascadeButtonWidgetClass,
689                         CA_MenuBar,
690                         RES_CONVERT( XmNlabelString, GETMESSAGE(2, 10, "File")),
691                         XmNmnemonic, mnemonic[0],
692                         XmNsubMenuId, CA_MB_FileOption,
693                         NULL );
694
695         /* Creation of CA_MB_HelpOption */
696         CA_MB_HelpOption_shell = XtVaCreatePopupShell ("CA_MB_HelpOption_shell",
697                         xmMenuShellWidgetClass, CA_MenuBar,
698                         XmNwidth, 1,
699                         XmNheight, 1,
700                         XmNallowShellResize, TRUE,
701                         XmNoverrideRedirect, TRUE,
702                         NULL );
703
704         CA_MB_HelpOption = XtVaCreateWidget( "CA_MB_HelpOption",
705                         xmRowColumnWidgetClass,
706                         CA_MB_HelpOption_shell,
707                         XmNrowColumnType, XmMENU_PULLDOWN,
708                         NULL );
709
710         /*
711          * Creation of CA_MB_HelpOverview
712         */
713         strcpy(mnemonic, GETMESSAGE(2, 61, "v"));
714         CA_MB_HelpOverview = XtVaCreateManagedWidget( "CA_MB_HelpOverview",
715                         xmPushButtonWidgetClass,
716                         CA_MB_HelpOption,
717                         RES_CONVERT( XmNlabelString, GETMESSAGE(2, 60, "Overview")),
718                         XmNmnemonic, mnemonic[0],
719                         XmNuserData, CreateActionAppShell,
720                         NULL );
721         XtAddCallback( CA_MB_HelpOverview, XmNactivateCallback,
722                 (XtCallbackProc) helpCB_general,
723                 (XtPointer) HELP_OVERVIEW );
724
725         /*
726          * Creation of CA_MB_HelpTasks
727         */
728         strcpy(mnemonic, GETMESSAGE(2, 71, "T"));
729         CA_MB_HelpTasks = XtVaCreateManagedWidget( "CA_MB_HelpTasks",
730                         xmPushButtonWidgetClass,
731                         CA_MB_HelpOption,
732                         RES_CONVERT( XmNlabelString, GETMESSAGE(2, 70, "Tasks")),
733                         XmNmnemonic, mnemonic[0],
734                         XmNuserData, CreateActionAppShell,
735                         NULL );
736         XtAddCallback( CA_MB_HelpTasks, XmNactivateCallback,
737                 (XtCallbackProc) helpCB_general,
738                 (XtPointer) HELP_TASKS );
739
740 #if 0
741         /* Creation of CA_MB_HelpTOC */
742         /*
743         mnemonic = GETMESSAGE(2, 66, "T");
744         */
745         strcpy(mnemonic, GETMESSAGE(2, 66, "T"));
746         CA_MB_HelpTOC = XtVaCreateManagedWidget( "CA_MB_HelpTOC",
747                         xmPushButtonWidgetClass,
748                         CA_MB_HelpOption,
749                         RES_CONVERT( XmNlabelString, GETMESSAGE(2, 65, "Table Of Contents...")),
750                         XmNmnemonic, mnemonic[0],
751                         XmNuserData, CreateActionAppShell,
752                         NULL );
753 #endif
754         /*
755         * Creation of CA_MB_HelpReference
756         */
757         strcpy(mnemonic, GETMESSAGE(2, 76, "R"));
758         CA_MB_HelpReference = XtVaCreateManagedWidget( "CA_MB_HelpReference",
759                         xmPushButtonWidgetClass,
760                         CA_MB_HelpOption,
761                         RES_CONVERT( XmNlabelString, GETMESSAGE(2, 75, "Reference")),
762                         XmNmnemonic, mnemonic[0],
763                         XmNuserData, CreateActionAppShell,
764                         NULL );
765         XtAddCallback( CA_MB_HelpReference, XmNactivateCallback,
766                 (XtCallbackProc) helpCB_general,
767                 (XtPointer) HELP_REFERENCE );
768
769         /*
770          * Creation of CA_MB_Help_Sep1
771          */
772         CA_MB_Help_Sep1 = XtVaCreateManagedWidget( "CA_MB_Help_Sep1",
773                         xmSeparatorWidgetClass,
774                         CA_MB_HelpOption,
775                         NULL );
776
777         /*
778          * Creation of CA_MB_HelpUsing
779          */
780         strcpy(mnemonic, GETMESSAGE(2, 81, "U"));
781         CA_MB_HelpUsing = XtVaCreateManagedWidget( "CA_MB_HelpUsing",
782                         xmPushButtonWidgetClass,
783                         CA_MB_HelpOption,
784                         RES_CONVERT( XmNlabelString, GETMESSAGE(2, 80, "Using Help")),
785                         XmNmnemonic, mnemonic[0],
786                         XmNuserData, CreateActionAppShell,
787                         NULL );
788         XtAddCallback( CA_MB_HelpUsing, XmNactivateCallback,
789                 (XtCallbackProc) helpCB_general,
790                 (XtPointer) HELP_USING );
791
792         /*
793          * Creation of CA_MB_Help_Sep2
794          */
795         CA_MB_Help_Sep2 = XtVaCreateManagedWidget( "CA_MB_Help_Sep2",
796                         xmSeparatorWidgetClass,
797                         CA_MB_HelpOption,
798                         NULL );
799
800         /*
801          * Creation of CA_MB_HelpAbout
802          */
803         strcpy(mnemonic, GETMESSAGE(2, 86, "A"));
804         CA_MB_HelpAbout = XtVaCreateManagedWidget( "CA_MB_HelpAbout",
805                         xmPushButtonWidgetClass,
806                         CA_MB_HelpOption,
807                         RES_CONVERT( XmNlabelString, GETMESSAGE(2, 85, "About Create Action")),
808                         XmNmnemonic, mnemonic[0],
809                         XmNuserData, CreateActionAppShell,
810                         NULL );
811         XtAddCallback( CA_MB_HelpAbout, XmNactivateCallback,
812                 (XtCallbackProc) helpCB_general,
813                 (XtPointer) HELP_ABOUT );
814
815         /*
816          * Creation of CA_MB_HelpTop
817          */
818         strcpy(mnemonic, GETMESSAGE(2, 54, "H"));
819         CA_MB_HelpTop = XtVaCreateManagedWidget( "CA_MB_HelpTop",
820                         xmCascadeButtonWidgetClass,
821                         CA_MenuBar,
822                         RES_CONVERT( XmNlabelString, GETMESSAGE(2, 53, "Help")),
823                         XmNmnemonic, mnemonic[0],
824                         XmNsubMenuId, CA_MB_HelpOption,
825                         XmNuserData, CreateActionAppShell,
826                         NULL );
827
828         /* Creation of CA_MB_OptionsOption */
829         CA_MB_OptionsOption_shell = XtVaCreatePopupShell ("CA_MB_OptionsOption_shell",
830                         xmMenuShellWidgetClass, CA_MenuBar,
831                         XmNwidth, 1,
832                         XmNheight, 1,
833                         XmNallowShellResize, TRUE,
834                         XmNoverrideRedirect, TRUE,
835                         NULL );
836
837         CA_MB_OptionsOption = XtVaCreateWidget( "CA_MB_OptionsOption",
838                         xmRowColumnWidgetClass,
839                         CA_MB_OptionsOption_shell,
840                         XmNrowColumnType, XmMENU_PULLDOWN,
841                         NULL );
842
843         /* Creation of ColorMonoOption */
844         strcpy(mnemonic, GETMESSAGE(2, 50, "M"));
845         ColorMonoOption = XtVaCreateManagedWidget( "ColorMonoOption",
846                         xmToggleButtonWidgetClass,
847                         CA_MB_OptionsOption,
848                         RES_CONVERT( XmNlabelString, GETMESSAGE(2, 49, "Show Monochrome Icons")),
849                         XmNmnemonic, mnemonic[0],
850                         XmNindicatorSize, 20,
851                         XmNhighlightThickness, 0,
852                         NULL );
853         XtAddCallback( ColorMonoOption, XmNvalueChangedCallback,
854                 (XtCallbackProc) valueChangedCB_ColorMonoOption,
855                 (XtPointer) NULL );
856         createCB_ColorMonoOption(ColorMonoOption);
857
858
859         /* Creation of CA_MB_OptionTop */
860         strcpy(mnemonic, GETMESSAGE(2, 36, "O"));
861         CA_MB_OptionTop = XtVaCreateManagedWidget( "CA_MB_OptionTop",
862                         xmCascadeButtonWidgetClass,
863                         CA_MenuBar,
864                         RES_CONVERT( XmNlabelString, GETMESSAGE(2, 35, "Options")),
865                         XmNmnemonic, mnemonic[0],
866                         XmNsubMenuId, CA_MB_OptionsOption,
867                         NULL );
868
869         /* Creation of CA_Form */
870         CA_Form = XtVaCreateManagedWidget( "CA_Form",
871                         xmFormWidgetClass,
872                         CreateActionMainWindow,
873                         XmNnoResize, FALSE,
874                         XmNresizePolicy, XmRESIZE_ANY,
875                         NULL );
876
877         /*********************************************************************/
878         /*                                                                   */
879         /* Action Name                                                       */
880         /*                                                                   */
881         /*********************************************************************/
882         /* Creation of CA_ActionNameLabel */
883         CA_ActionNameLabel = XtVaCreateManagedWidget( "CA_ActionNameLabel",
884                         xmLabelWidgetClass,
885                         CA_Form,
886                         XmNx, 10,
887                         XmNy, 30,
888                         RES_CONVERT( XmNlabelString, GETMESSAGE(3, 12, "Action Name (Icon Label):")),
889                         XmNalignment, XmALIGNMENT_BEGINNING,
890                         XmNleftOffset, 10,
891                         XmNleftAttachment, XmATTACH_FORM,
892                         XmNtopOffset, 20,
893                         XmNtopAttachment, XmATTACH_FORM,
894                         XmNrightOffset, 10,
895                         XmNrightAttachment, XmATTACH_FORM,
896                         NULL );
897
898         /* Creation of CA_ActionNameTextField */
899         CA_ActionNameTextField = XtVaCreateManagedWidget( "CA_ActionNameTextField",
900                         xmTextFieldWidgetClass,
901                         CA_Form,
902                         XmNx, 10,
903                         XmNy, 50,
904                         XmNtopOffset, 0,
905                         XmNtopWidget, CA_ActionNameLabel,
906                         XmNtopAttachment, XmATTACH_WIDGET,
907                         XmNleftOffset, 10,
908                         XmNleftAttachment, XmATTACH_FORM,
909                         XmNrightOffset, 10,
910                         XmNrightAttachment, XmATTACH_FORM,
911                         NULL );
912 #if 0
913         XtAddCallback( CA_ActionNameTextField, XmNvalueChangedCallback,
914                 (XtCallbackProc) valueChangedCB_CA_ActionNameTextField,
915                 (XtPointer) NULL );
916 #endif
917
918         /*********************************************************************/
919         /*                                                                   */
920         /* Icons                                                             */
921         /*                                                                   */
922         /*********************************************************************/
923         /* Creation of CA_ActionIconLabel */
924         CA_ActionIconLabel = XtVaCreateManagedWidget( "CA_ActionIconLabel",
925                         xmLabelWidgetClass,
926                         CA_Form,
927                         XmNx, 10,
928                         XmNy, 95,
929                         RES_CONVERT( XmNlabelString, GETMESSAGE(3, 13, "Action Icons:")),
930                         XmNalignment, XmALIGNMENT_BEGINNING,
931                         XmNleftOffset, 10,
932                         XmNleftAttachment, XmATTACH_FORM,
933                         XmNtopOffset, 15,
934                         XmNtopWidget, CA_ActionNameTextField,
935                         XmNtopAttachment, XmATTACH_WIDGET,
936                         XmNrightOffset, 10,
937                         XmNrightAttachment, XmATTACH_FORM,
938                         NULL );
939
940         /* Creation of CA_ActionIconForm */
941         CA_ActionIconForm = XtVaCreateManagedWidget( "CA_ActionIconForm",
942                         xmFormWidgetClass,
943                         CA_Form,
944                         XmNresizePolicy, XmRESIZE_NONE,
945                         XmNx, 10,
946                         XmNy, 121,
947                         XmNborderWidth, 0,
948                         XmNnavigationType, XmTAB_GROUP,
949                         XmNtopOffset, 0,
950                         XmNtopWidget, CA_ActionIconLabel,
951                         XmNtopAttachment, XmATTACH_WIDGET,
952                         XmNleftOffset, 10,
953                         XmNleftAttachment, XmATTACH_FORM,
954                         XmNrightOffset, 10,
955                         XmNrightAttachment, XmATTACH_FORM,
956                         XmNshadowThickness, 3,
957                         XmNshadowType, XmSHADOW_ETCHED_IN,
958                         XmNautoUnmanage, FALSE,
959                         XmNnoResize, FALSE,
960                         XmNallowOverlap, TRUE,
961                         XmNmarginHeight, 0,
962                         XmNverticalSpacing, 5,
963                         NULL );
964
965         CA_MED_IconForm = XtVaCreateManagedWidget( "CA_MED_IconForm",
966                         xmFormWidgetClass,
967                         CA_ActionIconForm,
968                         XmNresizePolicy, XmRESIZE_NONE,
969                         XmNborderWidth, ICON_BORDER_WIDTH,
970                         XmNleftPosition, 32,
971                         XmNleftOffset, 0,
972                         XmNleftAttachment, XmATTACH_POSITION,
973                         XmNbottomPosition, 88,
974                         XmNbottomOffset, 0,
975                         XmNbottomAttachment, XmATTACH_POSITION,
976                         NULL );
977
978         /* Creation of CA_MED_IconGadget */
979         emptyString = XmStringCreateLocalized("");
980         pIconData = (IconData *)XtMalloc(sizeof(IconData));
981         memset(pIconData, 0, sizeof(IconData));
982         IconDataList[CA_MED] = pIconData;
983         CA_MED_IconGadget = XtVaCreateManagedWidget( "CA_MED_IconGadget",
984                         dtIconGadgetClass,
985                         CA_MED_IconForm,
986                         XmNalignment, XmALIGNMENT_CENTER,
987                         XmNuserData, pIconData,
988                         XmNstring, emptyString,
989                         XmNrecomputeSize, TRUE,
990                         XmNleftOffset, BORDER_OFFSET,
991                         XmNleftAttachment, XmATTACH_FORM,
992                         XmNrightOffset, BORDER_OFFSET,
993                         XmNrightAttachment, XmATTACH_FORM,
994                         XmNtopOffset, BORDER_OFFSET,
995                         XmNtopAttachment, XmATTACH_FORM,
996                         XmNbottomOffset, BORDER_OFFSET,
997                         XmNbottomAttachment, XmATTACH_FORM,
998                         /*
999                         XmNleftPosition, 32,
1000                         XmNleftOffset, 0,
1001                         XmNleftAttachment, XmATTACH_POSITION,
1002                         XmNbottomPosition, 88,
1003                         XmNbottomOffset, 0,
1004                         XmNbottomAttachment, XmATTACH_POSITION,
1005                         */
1006                         NULL );
1007         pIconData->wid = CA_MED_IconGadget;
1008         pIconData->size = Medium_Icon;
1009         XtAddCallback( CA_MED_IconGadget, XmNcallback,
1010                 (XtCallbackProc) activateCB_action_icon,
1011                 (XtPointer) NULL );
1012         createCB_IconGadget( CA_MED_IconGadget, TRUE, Medium_Icon );
1013         last_action_pushed = CA_MED_IconGadget;
1014
1015         CA_TINY_IconForm = XtVaCreateManagedWidget( "CA_TINY_IconForm",
1016                         xmFormWidgetClass,
1017                         CA_ActionIconForm,
1018                         XmNresizePolicy, XmRESIZE_NONE,
1019                         XmNborderWidth, 0,
1020                         XmNleftPosition, 52,
1021                         XmNleftOffset, 1,
1022                         XmNleftAttachment, XmATTACH_POSITION,
1023                         XmNbottomPosition, 88,
1024                         XmNbottomOffset, 0,
1025                         XmNbottomAttachment, XmATTACH_POSITION,
1026                         NULL );
1027
1028         /* Creation of CA_TINY_IconGadget */
1029         pIconData = (IconData *)XtMalloc(sizeof(IconData));
1030         memset(pIconData, 0, sizeof(IconData));
1031         IconDataList[CA_TINY] = pIconData;
1032         CA_TINY_IconGadget = XtVaCreateManagedWidget( "CA_TINY_IconGadget",
1033                         dtIconGadgetClass,
1034                         CA_TINY_IconForm,
1035                         XmNalignment, XmALIGNMENT_CENTER,
1036                         XmNuserData, pIconData,
1037                         XmNrecomputeSize, TRUE,
1038                         XmNstring, emptyString,
1039                         XmNleftOffset, BORDER_OFFSET,
1040                         XmNleftAttachment, XmATTACH_FORM,
1041                         XmNrightOffset, BORDER_OFFSET,
1042                         XmNrightAttachment, XmATTACH_FORM,
1043                         XmNtopOffset, BORDER_OFFSET,
1044                         XmNtopAttachment, XmATTACH_FORM,
1045                         XmNbottomOffset, BORDER_OFFSET,
1046                         XmNbottomAttachment, XmATTACH_FORM,
1047                         NULL );
1048         pIconData->wid = CA_TINY_IconGadget;
1049         pIconData->size = Tiny_Icon;
1050         XtAddCallback( CA_TINY_IconGadget, XmNcallback,
1051                 (XtCallbackProc) activateCB_action_icon,
1052                 (XtPointer) NULL );
1053         createCB_IconGadget( CA_TINY_IconGadget, TRUE, Tiny_Icon );
1054
1055         CA_LRG_IconForm = XtVaCreateManagedWidget( "CA_LRG_IconForm",
1056                         xmFormWidgetClass,
1057                         CA_ActionIconForm,
1058                         XmNresizePolicy, XmRESIZE_NONE,
1059                         XmNborderWidth, 0,
1060                         XmNleftPosition, 11,
1061                         XmNleftOffset, -1,
1062                         XmNleftAttachment, XmATTACH_POSITION,
1063                         XmNbottomPosition, 88,
1064                         XmNbottomOffset, 0,
1065                         XmNbottomAttachment, XmATTACH_POSITION,
1066                         NULL );
1067
1068         /* Creation of CA_LRG_IconGadget */
1069         pIconData = (IconData *)XtMalloc(sizeof(IconData));
1070         memset(pIconData, 0, sizeof(IconData));
1071         IconDataList[CA_LRG] = pIconData;
1072         CA_LRG_IconGadget = XtVaCreateManagedWidget( "CA_LRG_IconGadget",
1073                         dtIconGadgetClass,
1074                         CA_LRG_IconForm,
1075                         XmNalignment, XmALIGNMENT_CENTER,
1076                         XmNuserData, pIconData,
1077                         XmNstring, emptyString,
1078                         XmNrecomputeSize, TRUE,
1079                         XmNleftOffset, BORDER_OFFSET,
1080                         XmNleftAttachment, XmATTACH_FORM,
1081                         XmNrightOffset, BORDER_OFFSET,
1082                         XmNrightAttachment, XmATTACH_FORM,
1083                         XmNtopOffset, BORDER_OFFSET,
1084                         XmNtopAttachment, XmATTACH_FORM,
1085                         XmNbottomOffset, BORDER_OFFSET,
1086                         XmNbottomAttachment, XmATTACH_FORM,
1087                         NULL );
1088         pIconData->wid = CA_LRG_IconGadget;
1089         pIconData->size = Large_Icon;
1090         XtAddCallback( CA_LRG_IconGadget, XmNcallback,
1091                 (XtCallbackProc) activateCB_action_icon,
1092                 (XtPointer) NULL );
1093         createCB_IconGadget( CA_LRG_IconGadget, TRUE, Large_Icon );
1094
1095         XmStringFree(emptyString);
1096
1097         /* Creation of CA_EditIcon_button */
1098         CA_EditIcon_button = XtVaCreateManagedWidget( "CA_EditIcon_button",
1099                         xmPushButtonGadgetClass,
1100                         CA_ActionIconForm,
1101                         RES_CONVERT( XmNlabelString, GETMESSAGE(6, 20, "Edit Icon...")),
1102                         XmNalignment, XmALIGNMENT_BEGINNING,
1103                         XmNleftPosition, 68,
1104                         XmNleftOffset, 1,
1105                         XmNleftAttachment, XmATTACH_POSITION,
1106                         XmNtopPosition, 50,
1107                         XmNtopOffset, (int)(FINDEDIT_SPACING / 2),
1108                         XmNtopAttachment, XmATTACH_POSITION,
1109                         NULL );
1110         XtAddCallback( CA_EditIcon_button, XmNactivateCallback,
1111                 (XtCallbackProc) activateCB_edit_icon,
1112                 (XtPointer) CA_ACTION_ICONS );
1113
1114         /* Creation of CA_FindSet_button */
1115         CA_FindSet_button = XtVaCreateManagedWidget( "CA_FindSet_button",
1116                         xmPushButtonGadgetClass,
1117                         CA_ActionIconForm,
1118                         RES_CONVERT( XmNlabelString, GETMESSAGE(6, 19, "Find Set...")),
1119                         XmNalignment, XmALIGNMENT_BEGINNING,
1120                         XmNmultiClick, XmMULTICLICK_DISCARD,
1121                         XmNleftPosition, 68,
1122                         XmNleftOffset, 0,
1123                         XmNleftAttachment, XmATTACH_POSITION,
1124                         XmNbottomPosition, 50,
1125                         XmNbottomOffset, (int)(FINDEDIT_SPACING / 2),
1126                         XmNbottomAttachment, XmATTACH_POSITION,
1127                         NULL );
1128         XtAddCallback( CA_FindSet_button, XmNactivateCallback,
1129                 (XtCallbackProc) activateCB_open_FindSet,
1130                 (XtPointer) CA_ACTION_ICONS );
1131
1132         /******************************************************************/
1133         /* Determine which button is wider, and attach the short on to it */
1134         /******************************************************************/
1135         XtVaGetValues(CA_EditIcon_button, XmNwidth, &dim1, NULL);
1136         XtVaGetValues(CA_FindSet_button, XmNwidth, &dim2, NULL);
1137         if (dim1 > dim2) {
1138            XtVaSetValues(CA_FindSet_button,
1139                          XmNwidth, dim1,
1140                          NULL);
1141         } else {
1142            XtVaSetValues(CA_EditIcon_button,
1143                          XmNwidth, dim2,
1144                          NULL);
1145         }
1146         /******************************************************************/
1147         /* Determine vertical positioning for findset and edit buttons    */
1148         /******************************************************************/
1149         XtVaGetValues(CA_EditIcon_button, XmNheight, &dim1, NULL);
1150         XtVaGetValues(CA_FindSet_button, XmNheight, &dim2, NULL);
1151         if ((int)(dim1 + dim2) + (3*(FINDEDIT_SPACING)) > ICON_MIN_HEIGHT) {
1152            XtVaSetValues(CA_EditIcon_button,
1153                          XmNbottomOffset, FINDEDIT_SPACING,
1154                          XmNbottomAttachment, XmATTACH_FORM,
1155                          NULL);
1156            XtVaSetValues(CA_FindSet_button,
1157                          XmNbottomOffset, FINDEDIT_SPACING,
1158                          XmNbottomWidget, CA_EditIcon_button,
1159                          XmNbottomAttachment, XmATTACH_WIDGET,
1160                          XmNtopOffset, FINDEDIT_SPACING,
1161                          XmNtopAttachment, XmATTACH_FORM,
1162                          NULL);
1163         }
1164
1165
1166         /******************************************************************/
1167         /* Bogus separator to keep ActionIconForm a minimum height        */
1168         /******************************************************************/
1169         separator1 = XtVaCreateManagedWidget( "separator1",
1170                         xmSeparatorWidgetClass,
1171                         CA_ActionIconForm,
1172                         XmNx, 10,
1173                         XmNy, 10,
1174                         XmNwidth, 20,
1175                         XmNheight, ICON_MIN_HEIGHT,
1176                         XmNorientation, XmVERTICAL,
1177                         XmNseparatorType, XmNO_LINE,
1178                         XmNtopOffset, 5,
1179                         XmNtopAttachment, XmATTACH_FORM,
1180                         XmNbottomOffset, 5,
1181                         XmNbottomAttachment, XmATTACH_FORM,
1182                         NULL );
1183
1184         /*********************************************************************/
1185         /*                                                                   */
1186         /* Open Command                                                      */
1187         /*                                                                   */
1188         /*********************************************************************/
1189         /* Creation of CA_DblClkLabel */
1190         CA_DblClkLabel = XtVaCreateManagedWidget( "CA_DblClkLabel",
1191                         xmLabelWidgetClass,
1192                         CA_Form,
1193                         RES_CONVERT( XmNlabelString, GETMESSAGE(3, 22, "Command When Action Is Opened (Double-clicked):")),
1194                         XmNalignment, XmALIGNMENT_BEGINNING,
1195                         XmNleftOffset, 10,
1196                         XmNleftAttachment, XmATTACH_FORM,
1197                         XmNtopOffset, 15,
1198                         XmNtopWidget, CA_ActionIconForm,
1199                         XmNtopAttachment, XmATTACH_WIDGET,
1200                         XmNrightOffset, 10,
1201                         XmNrightAttachment, XmATTACH_FORM,
1202                         NULL );
1203
1204         /* Creation of CA_DblClkText */
1205         CA_DblClkText = XtVaCreateManagedWidget( "CA_DblClkText",
1206                         xmTextFieldWidgetClass,
1207                         CA_Form,
1208                         XmNnavigationType, XmTAB_GROUP,
1209                         XmNtopOffset, 0,
1210                         XmNtopWidget, CA_DblClkLabel,
1211                         XmNtopAttachment, XmATTACH_WIDGET,
1212                         XmNleftOffset, 10,
1213                         XmNleftAttachment, XmATTACH_FORM,
1214                         XmNrightOffset, 10,
1215                         XmNrightAttachment, XmATTACH_FORM,
1216                         XmNrows, 1,
1217                         NULL );
1218
1219         /*********************************************************************/
1220         /*                                                                   */
1221         /* Help Text Label                                                   */
1222         /*                                                                   */
1223         /*********************************************************************/
1224         /* Creation of CA_HlpTxtLabel */
1225         CA_HlpTxtLabel = XtVaCreateManagedWidget( "CA_HlpTxtLabel",
1226                         xmLabelWidgetClass,
1227                         CA_Form,
1228                         RES_CONVERT( XmNlabelString, GETMESSAGE(3, 30, "Help Text For Action Icon:")),
1229                         XmNalignment, XmALIGNMENT_BEGINNING,
1230                         XmNleftOffset, 10,
1231                         XmNleftAttachment, XmATTACH_FORM,
1232                         XmNtopOffset, 15,
1233                         XmNtopWidget, CA_DblClkText,
1234                         XmNtopAttachment, XmATTACH_WIDGET,
1235                         XmNrightOffset, 10,
1236                         XmNrightAttachment, XmATTACH_FORM,
1237                         NULL );
1238
1239         /*********************************************************************/
1240         /*                                                                   */
1241         /* Advanced Features Area                                            */
1242         /*                                                                   */
1243         /*********************************************************************/
1244         /* Creation of XprtOptionForm */
1245         XprtOptionForm = XtVaCreateManagedWidget( "XprtOptionForm",
1246                         xmFormWidgetClass,
1247                         CA_Form,
1248                         XmNresizePolicy, XmRESIZE_ANY,
1249                         XmNleftOffset, 1,
1250                         XmNleftAttachment, XmATTACH_FORM,
1251                         XmNrightOffset, 1,
1252                         XmNrightAttachment, XmATTACH_FORM,
1253                         XmNbottomOffset, 0,
1254                         XmNbottomAttachment, XmATTACH_FORM,
1255                         NULL );
1256
1257         /*********************************************************************/
1258         /*                                                                   */
1259         /* Optional Separator                                                */
1260         /*                                                                   */
1261         /*********************************************************************/
1262
1263         /* Creation of CA_XprtSep1 */
1264         CA_XprtSep1 = XtVaCreateManagedWidget( "CA_XprtSep1",
1265                         xmSeparatorWidgetClass,
1266                         XprtOptionForm,
1267                         XmNleftOffset, 1,
1268                         XmNleftAttachment, XmATTACH_FORM,
1269                         XmNrightOffset, 1,
1270                         XmNrightAttachment, XmATTACH_FORM,
1271                         XmNtopOffset, 0,
1272                         XmNtopAttachment, XmATTACH_FORM,
1273                         NULL );
1274
1275         /*********************************************************************/
1276         /*                                                                   */
1277         /* Prompt Field                                                      */
1278         /*                                                                   */
1279         /*********************************************************************/
1280         /* Creation of CA_ActionOpenLabel */
1281         CA_ActionOpenLabel = XtVaCreateManagedWidget( "CA_ActionOpenLabel",
1282                         xmLabelWidgetClass,
1283                         XprtOptionForm,
1284                         RES_CONVERT( XmNlabelString, GETMESSAGE(4, 11, "When Action Opens, Ask Users for:")),
1285                         XmNalignment, XmALIGNMENT_BEGINNING,
1286                         XmNleftOffset, 10,
1287                         XmNleftAttachment, XmATTACH_FORM,
1288                         XmNrightOffset, 10,
1289                         XmNrightAttachment, XmATTACH_FORM,
1290                         XmNtopOffset, 15,
1291                         XmNtopWidget, CA_XprtSep1,
1292                         XmNtopAttachment, XmATTACH_WIDGET,
1293                         NULL );
1294
1295         /* Creation of CA_XprtActionOpenText */
1296         CA_XprtActionOpenText = XtVaCreateManagedWidget( "CA_XprtActionOpenText",
1297                         xmTextWidgetClass,
1298                         XprtOptionForm,
1299                         XmNvalue, "",
1300                         XmNnavigationType, XmTAB_GROUP,
1301                         XmNleftOffset, 10,
1302                         XmNleftAttachment, XmATTACH_FORM,
1303                         XmNrightOffset, 10,
1304                         XmNrightAttachment, XmATTACH_FORM,
1305                         XmNtopOffset, 0,
1306                         XmNtopWidget, CA_ActionOpenLabel,
1307                         XmNtopAttachment, XmATTACH_WIDGET,
1308                       /*XmNeditMode, XmMULTI_LINE_EDIT,*/
1309                       /*XmNwordWrap, TRUE,*/
1310                         NULL );
1311
1312         /*********************************************************************/
1313         /*                                                                   */
1314         /* Filetypes that use this Action area                               */
1315         /*                                                                   */
1316         /*********************************************************************/
1317         /* Creation of CA_FiletypesLabel */
1318         CA_FiletypesLabel = XtVaCreateManagedWidget( "CA_FiletypesLabel",
1319                         xmLabelWidgetClass,
1320                         XprtOptionForm,
1321                         XmNx, 10,
1322                         XmNy, 122,
1323                         RES_CONVERT( XmNlabelString, GETMESSAGE(4, 12, "Datatypes That Use This Action:")),
1324                         XmNalignment, XmALIGNMENT_BEGINNING,
1325                         XmNleftOffset, 10,
1326                         XmNleftAttachment, XmATTACH_FORM,
1327                         XmNrightOffset, 10,
1328                         XmNrightAttachment, XmATTACH_FORM,
1329                         XmNtopOffset, 15,
1330                         XmNtopWidget, CA_XprtActionOpenText,
1331                         XmNtopAttachment, XmATTACH_WIDGET,
1332                         NULL );
1333
1334         /*********************************************************************/
1335         /*                                                                   */
1336         /* Add, Delete, Edit buttons for Filetypes                           */
1337         /*                                                                   */
1338         /*********************************************************************/
1339         /* Creation of rowColumn1 */
1340         rowColumn1 = XtVaCreateManagedWidget( "rowColumn1",
1341                         xmRowColumnWidgetClass,
1342                         XprtOptionForm,
1343                         XmNnavigationType, XmTAB_GROUP,
1344                         XmNtopOffset, 0,
1345                         XmNtopWidget, CA_FiletypesLabel,
1346                         XmNtopAttachment, XmATTACH_WIDGET,
1347                         XmNrightOffset, 10,
1348                         XmNrightAttachment, XmATTACH_FORM,
1349                         NULL );
1350
1351         /* Creation of CA_FiletypesAdd */
1352         CA_FiletypesAdd = XtVaCreateManagedWidget( "CA_FiletypesAdd",
1353                         xmPushButtonGadgetClass,
1354                         rowColumn1,
1355                         RES_CONVERT( XmNlabelString, GETMESSAGE(4, 13, "Add...")),
1356                         XmNalignment, XmALIGNMENT_BEGINNING,
1357                         XmNmarginLeft, 5,
1358                         XmNmarginRight, 5,
1359                         NULL );
1360         XtAddCallback( CA_FiletypesAdd, XmNactivateCallback,
1361                 (XtCallbackProc) activateCB_add_filetype,
1362                 (XtPointer) NULL );
1363
1364         /* Creation of CA_FiletypesDelete */
1365         CA_FiletypesDelete = XtVaCreateManagedWidget( "CA_FiletypesDelete",
1366                         xmPushButtonGadgetClass,
1367                         rowColumn1,
1368                         RES_CONVERT( XmNlabelString, GETMESSAGE(4, 14, "Delete")),
1369                         XmNalignment, XmALIGNMENT_BEGINNING,
1370                         XmNmarginLeft, 5,
1371                         XmNmarginRight, 5,
1372                         NULL );
1373         XtAddCallback( CA_FiletypesDelete, XmNactivateCallback,
1374                 (XtCallbackProc) activateCB_CA_FiletypesDelete,
1375                 (XtPointer) NULL );
1376
1377         /* Creation of CA_FiletypesEdit */
1378         CA_FiletypesEdit = XtVaCreateManagedWidget( "CA_FiletypesEdit",
1379                         xmPushButtonGadgetClass,
1380                         rowColumn1,
1381                         RES_CONVERT( XmNlabelString, GETMESSAGE(4, 15, "Edit...")),
1382                         XmNalignment, XmALIGNMENT_BEGINNING,
1383                         XmNmarginLeft, 5,
1384                         XmNmarginRight, 5,
1385                         NULL );
1386         XtAddCallback( CA_FiletypesEdit, XmNactivateCallback,
1387                 (XtCallbackProc) activateCB_edit_filetype,
1388                 (XtPointer) NULL );
1389
1390         /*********************************************************************/
1391         /*                                                                   */
1392         /* Filetypes Listbox Area                                            */
1393         /*                                                                   */
1394         /*********************************************************************/
1395         /* Creation of CA_FiletypesWindow */
1396         CA_FiletypesWindow = XtVaCreateManagedWidget( "CA_FiletypesWindow",
1397                         xmScrolledWindowWidgetClass,
1398                         XprtOptionForm,
1399                         XmNx, 10,
1400                         XmNy, 140,
1401                         XmNshadowThickness, 2,
1402                         XmNleftOffset, 10,
1403                         XmNleftAttachment, XmATTACH_FORM,
1404                         XmNtopOffset, 0,
1405                         XmNtopWidget, CA_FiletypesLabel,
1406                         XmNtopAttachment, XmATTACH_WIDGET,
1407                         XmNbottomOffset, 0,
1408                         XmNbottomWidget, rowColumn1,
1409                         XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET,
1410                         XmNrightOffset, 10,
1411                         XmNrightWidget, rowColumn1,
1412                         XmNrightAttachment, XmATTACH_WIDGET,
1413                         NULL );
1414
1415         /* Creation of CA_FiletypesList */
1416         CA_FiletypesList = XtVaCreateManagedWidget( "CA_FiletypesList",
1417                         xmListWidgetClass,
1418                         CA_FiletypesWindow,
1419                         XmNselectionPolicy, XmSINGLE_SELECT,
1420                         XmNshadowThickness, 0,
1421                         NULL );
1422
1423         /*********************************************************************/
1424         /*                                                                   */
1425         /* Droppable Filetypes Toggle Area                                   */
1426         /*                                                                   */
1427         /*********************************************************************/
1428         /* Creation of CA_DroppableFiletypesLabel */
1429         CA_DroppableFiletypesLabel = XtVaCreateManagedWidget( "CA_DroppableFiletypesLabel",
1430                         xmLabelWidgetClass,
1431                         XprtOptionForm,
1432                         XmNx, 10,
1433                         XmNy, 204,
1434                         XmNalignment, XmALIGNMENT_BEGINNING,
1435                         RES_CONVERT( XmNlabelString, GETMESSAGE(4, 16, "Dropable Datatypes:")),
1436                         XmNleftOffset, 10,
1437                         XmNleftAttachment, XmATTACH_FORM,
1438                         XmNtopOffset, 15,
1439                         XmNtopWidget, rowColumn1,
1440                         XmNtopAttachment, XmATTACH_WIDGET,
1441                         NULL );
1442
1443         if (bLowRes) {
1444            /* Creation of CA_DroppableFiletypesRowColumn */
1445            CA_DroppableFiletypesRowColumn = XtVaCreateManagedWidget( "CA_DroppableFiletypesRowColumn",
1446                            xmRowColumnWidgetClass,
1447                            XprtOptionForm,
1448                            XmNx, 200,
1449                            XmNy, 204,
1450                            RES_CONVERT( XmNlabelString, "" ),
1451                            XmNorientation, XmHORIZONTAL,
1452                            XmNpacking, XmPACK_TIGHT,
1453                            XmNradioBehavior, TRUE,
1454                            XmNwhichButton, 1,
1455                            XmNnavigationType, XmTAB_GROUP,
1456                            XmNtopOffset, 0,
1457                            XmNtopWidget, CA_DroppableFiletypesLabel,
1458                            XmNtopAttachment, XmATTACH_WIDGET,
1459                            XmNbottomOffset, 0,
1460                            XmNbottomAttachment, XmATTACH_FORM,
1461                            XmNleftOffset, 10,
1462                            XmNleftAttachment, XmATTACH_FORM,
1463                            XmNrightOffset, 10,
1464                            XmNrightAttachment, XmATTACH_FORM,
1465                            NULL );
1466         } else {
1467            /* Creation of CA_DroppableFiletypesRowColumn */
1468            CA_DroppableFiletypesRowColumn = XtVaCreateManagedWidget( "CA_DroppableFiletypesRowColumn",
1469                            xmRowColumnWidgetClass,
1470                            XprtOptionForm,
1471                            RES_CONVERT( XmNlabelString, "" ),
1472                            XmNorientation, XmHORIZONTAL,
1473                            XmNpacking, XmPACK_TIGHT,
1474                            XmNradioBehavior, TRUE,
1475                            XmNwhichButton, 1,
1476                            XmNnavigationType, XmTAB_GROUP,
1477                            XmNtopOffset, -7,
1478                            XmNtopWidget, CA_DroppableFiletypesLabel,
1479                            XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET,
1480                            XmNbottomOffset, 0,
1481                            XmNbottomAttachment, XmATTACH_FORM,
1482                            XmNleftOffset, 0,
1483                            XmNleftWidget, CA_DroppableFiletypesLabel,
1484                            XmNleftAttachment, XmATTACH_WIDGET,
1485                            XmNrightOffset, 10,
1486                            XmNrightAttachment, XmATTACH_FORM,
1487                            NULL );
1488         }
1489
1490         /* Creation of CA_AllFiletypesToggle */
1491         CA_AllFiletypesToggle = XtVaCreateManagedWidget( "CA_AllFiletypesToggle",
1492                         xmToggleButtonWidgetClass,
1493                         CA_DroppableFiletypesRowColumn,
1494                         RES_CONVERT( XmNlabelString, GETMESSAGE(4, 17, "All Datatypes")),
1495                         XmNset, TRUE,
1496                         NULL );
1497
1498         /* Creation of CA_FiletypesInListToggle */
1499         CA_FiletypesInListToggle = XtVaCreateManagedWidget( "CA_FiletypesInListToggle",
1500                         xmToggleButtonWidgetClass,
1501                         CA_DroppableFiletypesRowColumn,
1502                         RES_CONVERT( XmNlabelString, GETMESSAGE(4, 18, "Only Above List")),
1503                         NULL );
1504         XtAddCallback( CA_FiletypesInListToggle, XmNvalueChangedCallback,
1505                 (XtCallbackProc) valueChangedCB_DroppableFiletypes,
1506                 (XtPointer) CA_DF_ONLYFTFILES );
1507
1508
1509         /*********************************************************************/
1510         /*                                                                   */
1511         /* Expand button                                                     */
1512         /*                                                                   */
1513         /*********************************************************************/
1514         CA_Expand = XtVaCreateManagedWidget( "CA_Expand",
1515                         xmPushButtonWidgetClass,
1516                         CA_Form,
1517                         RES_CONVERT( XmNlabelString, GETMESSAGE(3, 50, "Advanced")),
1518                         XmNmultiClick, XmMULTICLICK_DISCARD,
1519                         XmNnavigationType, XmTAB_GROUP,
1520                         XmNmarginLeft, 5,
1521                         XmNmarginRight, 5,
1522                         XmNleftOffset, 10,
1523                         XmNleftAttachment, XmATTACH_FORM,
1524                         XmNbottomOffset, 20,
1525                         XmNbottomWidget, XprtOptionForm,
1526                         XmNbottomAttachment, XmATTACH_WIDGET,
1527                         NULL );
1528         XtAddCallback( CA_Expand, XmNactivateCallback,
1529                 (XtCallbackProc) activateCB_ExpertOption,
1530                 (XtPointer) NULL );
1531
1532         /*********************************************************************/
1533         /*                                                                   */
1534         /* Start of WindowType Option Menu                                   */
1535         /*                                                                   */
1536         /*********************************************************************/
1537         CA_WindowType_OptionMenuShell = XtVaCreatePopupShell ("CA_WindowType_OptionMenuShell",
1538                         xmMenuShellWidgetClass,
1539                         CA_Form,
1540                         XmNwidth, 1,
1541                         XmNheight, 1,
1542                         XmNallowShellResize, TRUE,
1543                         XmNoverrideRedirect, TRUE,
1544                         NULL );
1545
1546         CA_WindowType_Pane = XtVaCreateWidget( "CA_WindowType_Pane",
1547                         xmRowColumnWidgetClass,
1548                       /*CA_WindowType,*/
1549                         CA_WindowType_OptionMenuShell,
1550                         XmNrowColumnType, XmMENU_PULLDOWN,
1551                         NULL );
1552
1553         CA_WinTypeX = XtVaCreateManagedWidget( "CA_WinTypeX",
1554                         xmPushButtonWidgetClass,
1555                         CA_WindowType_Pane,
1556                         RES_CONVERT( XmNlabelString, GETMESSAGE(3, 34, "Graphical (X-Window)")),
1557                         NULL );
1558         XtAddCallback( CA_WinTypeX, XmNactivateCallback,
1559                 (XtCallbackProc) activateCB_WindowTypeOptionMenu,
1560                 (XtPointer) CA_WT_XWINDOWS );
1561
1562         CA_WinTypeAutoClose = XtVaCreateManagedWidget( "CA_WinTypeAutoClose",
1563                         xmPushButtonWidgetClass,
1564                         CA_WindowType_Pane,
1565                         RES_CONVERT( XmNlabelString, GETMESSAGE(3, 36, "Terminal (Auto-Close)")),
1566                         NULL );
1567         XtAddCallback( CA_WinTypeAutoClose, XmNactivateCallback,
1568                 (XtCallbackProc) activateCB_WindowTypeOptionMenu,
1569                 (XtPointer) CA_WT_TERM );
1570
1571         CA_WinTypeManualClose = XtVaCreateManagedWidget( "CA_WinTypeManualClose",
1572                         xmPushButtonWidgetClass,
1573                         CA_WindowType_Pane,
1574                         RES_CONVERT( XmNlabelString, GETMESSAGE(3, 38, "Terminal (Manual Close)")),
1575                         NULL );
1576         XtAddCallback( CA_WinTypeManualClose, XmNactivateCallback,
1577                 (XtCallbackProc) activateCB_WindowTypeOptionMenu,
1578                 (XtPointer) CA_WT_PERMTERM );
1579
1580         CA_WinTypeNoOutput = XtVaCreateManagedWidget( "CA_WinTypeNoOutput",
1581                         xmPushButtonWidgetClass,
1582                         CA_WindowType_Pane,
1583                         RES_CONVERT( XmNlabelString, GETMESSAGE(3, 40, "No Output")),
1584                         NULL );
1585         XtAddCallback( CA_WinTypeNoOutput, XmNactivateCallback,
1586                 (XtCallbackProc) activateCB_WindowTypeOptionMenu,
1587                 (XtPointer) CA_WT_XWINDOWS );
1588
1589         CA_WindowType_OptionMenu = XtVaCreateManagedWidget( "CA_WindowType_OptionMenu",
1590                         xmRowColumnWidgetClass,
1591                         CA_Form,
1592                         XmNrowColumnType, XmMENU_OPTION,
1593                         XmNsubMenuId, CA_WindowType_Pane,
1594                         RES_CONVERT( XmNlabelString, GETMESSAGE(3, 32, "Window Type: ")),
1595                         XmNnavigationType, XmTAB_GROUP,
1596                         XmNleftOffset, 10,
1597                         XmNleftAttachment, XmATTACH_FORM,
1598                         XmNrightOffset, 10,
1599                         XmNrightAttachment, XmATTACH_FORM,
1600                         XmNbottomOffset, 15,
1601                         XmNbottomWidget, CA_Expand,
1602                         XmNbottomAttachment, XmATTACH_WIDGET,
1603                         NULL );
1604         CA_WindowTypeArea = CA_WindowType_OptionMenu;
1605
1606         /*********************************************************************/
1607         /*                                                                   */
1608         /* Help Text Window                                                  */
1609         /*                                                                   */
1610         /*********************************************************************/
1611         /* Creation of CA_HelpTextWindow */
1612         CA_HelpTextWindow = XtVaCreateManagedWidget( "CA_HelpTextWindow",
1613                         xmScrolledWindowWidgetClass,
1614                         CA_Form,
1615                         XmNx, 10,
1616                         XmNy, 336,
1617                         XmNshadowThickness, 0,
1618                         XmNtopOffset, 0,
1619                         XmNtopWidget, CA_HlpTxtLabel,
1620                         XmNtopAttachment, XmATTACH_WIDGET,
1621                         XmNleftOffset, 10,
1622                         XmNleftAttachment, XmATTACH_FORM,
1623                         XmNrightOffset, 10,
1624                         XmNrightAttachment, XmATTACH_FORM,
1625                         XmNbottomOffset, 15,
1626                         XmNbottomWidget, CA_WindowTypeArea,
1627                         XmNbottomAttachment, XmATTACH_WIDGET,
1628                         NULL );
1629
1630         /* Creation of CA_HelpText */
1631         CA_HelpText = XtVaCreateManagedWidget( "CA_HelpText",
1632                         xmTextWidgetClass,
1633                         CA_HelpTextWindow,
1634                         XmNeditMode, XmMULTI_LINE_EDIT ,
1635                         XmNscrollVertical, TRUE,
1636                         XmNscrollHorizontal, FALSE,
1637                         XmNwordWrap, TRUE,
1638                         XmNx, 12,
1639                         XmNy, 0,
1640                         XmNrows, 3,
1641                         NULL );
1642
1643         /*********************************************************************/
1644         /*                                                                   */
1645         /* Misc.                                                             */
1646         /*                                                                   */
1647         /*********************************************************************/
1648         XtVaSetValues(CA_MenuBar,
1649                         XmNmenuHelpWidget, CA_MB_HelpTop,
1650                         NULL );
1651
1652         XtAddCallback( CreateActionAppShell, XmNdestroyCallback,
1653                 (XtCallbackProc) UxDestroyContextCB,
1654                 (XtPointer) NULL );
1655
1656         XmMainWindowSetAreas( CreateActionMainWindow, CA_MenuBar, (Widget) NULL,
1657                         (Widget) NULL, (Widget) NULL, CA_Form );
1658
1659         return ( CreateActionAppShell );
1660 }
1661
1662 /*******************************************************************************
1663        The following is the 'Interface function' which is the
1664        external entry point for creating this interface.
1665        This function should be called from your application or from
1666        a callback function.
1667 *******************************************************************************/
1668
1669 Widget  create_applicationShell1(swidget _UxUxParent)
1670 {
1671         Widget                   rtrn;
1672         _UxCCreateActionAppShell *UxContext;
1673         Dimension                dimHeight;
1674         Dimension                dimWidth;
1675         Dimension                dimTmp;
1676         Widget                   widTmp;
1677
1678         UxCreateActionAppShellContext = UxContext =
1679                 (_UxCCreateActionAppShell *) UxNewContext( sizeof(_UxCCreateActionAppShell), False );
1680
1681         UxParent = _UxUxParent;
1682
1683         rtrn = _Uxbuild_CreateActionAppShell();
1684
1685         /******************************************************************/
1686         /* Need to realize app shell widget now, because we need to       */
1687         /* determine initial geometry before the advanced area is         */
1688         /* unmanaged in   set_ca_dialog_height  routine.                  */
1689         /******************************************************************/
1690         XtSetMappedWhenManaged(rtrn, False);
1691         XtRealizeWidget(rtrn);
1692         XmProcessTraversal(CA_ActionNameTextField, XmTRAVERSE_CURRENT);
1693
1694         FileTypes = (Widget)CA_FiletypesList;
1695
1696         set_ca_dialog_height ();
1697
1698         if (sessiondata.useSession) {
1699            XtVaSetValues (CreateActionAppShell,
1700                           XmNx, sessiondata.x,
1701                           XmNy, sessiondata.y,
1702                           XmNwidth, sessiondata.width,
1703                           XmNheight, sessiondata.height,
1704                           XmNinitialState, sessiondata.iconicState,
1705                           NULL);
1706
1707            /* display in workspace */
1708
1709            if (sessiondata.workspaces[0])
1710            {
1711                char *workspaces = sessiondata.workspaces;
1712                char *ptr;
1713                Atom * workspace_atoms = NULL;
1714                int num_workspaces = 0;
1715                do
1716                {
1717                    ptr = strchr (workspaces, '*');
1718                    if (ptr != NULL) *ptr = NULL;
1719
1720                    workspace_atoms = (Atom *) XtRealloc (
1721                                 (char *)workspace_atoms, 
1722                                 sizeof (Atom) * (num_workspaces + 1));
1723                    workspace_atoms[num_workspaces] = XmInternAtom(
1724                                         XtDisplay(CreateActionAppShell),
1725                                         workspaces, True);
1726
1727                    num_workspaces++;                            
1728                    if (ptr != NULL)
1729                    {
1730                        *ptr = '*';
1731                        workspaces = ptr + 1;
1732                    }
1733                } while (ptr != NULL);
1734                DtWsmSetWorkspacesOccupied( XtDisplay(CreateActionAppShell),
1735                                            XtWindow(CreateActionAppShell),
1736                                            workspace_atoms,
1737                                            num_workspaces);
1738                XtFree ((char *) workspace_atoms);
1739                workspace_atoms = NULL;
1740            }
1741         }
1742         else if (bLowRes) {
1743            XtVaGetValues (CA_Form,
1744                           XmNheight, &dimHeight,
1745                           XmNwidth, &dimWidth,
1746                           NULL);
1747            XtVaGetValues (CreateActionMainWindow,
1748                           XmNverticalScrollBar, &widTmp,
1749                           NULL);
1750            XtVaGetValues (widTmp,
1751                           XmNwidth, &dimTmp,
1752                           NULL);
1753            dimHeight += dimTmp;
1754            dimWidth += dimTmp;
1755
1756            XtVaGetValues (CA_MenuBar,
1757                           XmNheight, &dimTmp,
1758                           NULL);
1759            dimHeight += dimTmp;
1760
1761            XtVaSetValues (CreateActionAppShell,
1762                           XmNheight, dimHeight,
1763                           XmNwidth, dimWidth,
1764                           NULL);
1765         }
1766
1767         XtSetMappedWhenManaged(rtrn, True);
1768         XtManageChild(rtrn);
1769
1770         return(rtrn);
1771 }
1772
1773 /*******************************************************************************
1774        END OF FILE
1775 *******************************************************************************/
1776