2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
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)
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
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
23 /* $TOG: CreateActionAppShell.c /main/11 1998/10/26 17:17:50 mgreess $ */
24 /*******************************************************************************
25 CreateActionAppShell.c
27 Associated Header file: CreateActionAppShell.h
28 *******************************************************************************/
35 #include <Xm/MwmUtil.h>
36 #include <Xm/MenuShell.h>
38 #include <Xm/ToggleBG.h>
40 #include <Xm/ScrolledW.h>
42 #include <Xm/PushBG.h>
46 #include <Xm/CascadeB.h>
47 #include <Xm/ToggleB.h>
48 #include <Xm/Separator.h>
50 #include <Xm/RowColumn.h>
52 #include <Xm/Protocols.h>
53 #include <Xm/AtomMgr.h>
55 #include <X11/Shell.h>
56 #include <X11/cursorfont.h>
60 #include <Dt/Action.h>
61 #include <Dt/HourGlass.h>
71 #include "Confirmed.h"
72 #include "ErrorDialog.h"
74 #define CONTEXT_MACRO_ACCESS 1
75 #include "CreateActionAppShell.h"
76 #undef CONTEXT_MACRO_ACCESS
78 /*******************************************************************************
79 Includes, Defines, and Global variables from the Declarations Editor:
80 *******************************************************************************/
82 XtArgVal /* Dimension */ winheight, xprtheight, newheight, wintypeheight;
85 /*******************************************************************************
86 The following are callback functions.
87 *******************************************************************************/
88 static char * GetDefinitionFileName( char *pszName);
89 static void CreateFiles(void);
90 static void questionCB_ReplaceFile(Widget UxWidget,
91 XtPointer UxClientData,
92 XtPointer UxCallbackArg);
93 static void questionCB_CancelSave(Widget UxWidget,
94 XtPointer UxClientData,
95 XtPointer UxCallbackArg);
97 static char * GetDefinitionFileName( char *pszName)
100 char *defname = (char *)NULL;
102 char *msgPtr, *errPtr;
105 /****************************************************************/
106 /* Create definition file name. */
107 /****************************************************************/
108 newName = ReplaceSpaces(pszName);
109 pszEnvVar = getenv("HOME");
110 if ( pszEnvVar && strlen(pszEnvVar) ) {
111 bytesneeded = strlen("/.dt/types/.dt") + strlen(pszEnvVar) + strlen(newName) + 1;
112 defname = (char *)XtMalloc(bytesneeded);
113 sprintf(defname, "%s/.dt/types/%s.dt", pszEnvVar, newName);
115 msgPtr = GETMESSAGE(5, 170,
116 "The HOME environment variable is not set.\n\
117 The HOME environment variable must be set in order\n\
118 for this action to be saved.");
119 errPtr = XtNewString(msgPtr);
120 display_error_message(CreateActionAppShell, errPtr);
128 static void CreateFiles(void)
130 Boolean bHaveError = False;
133 char *msgPtr1, *msgPtr2, *fmtPtr, *bufPtr;
134 #ifdef UNDO_CMVC_3571
138 /******************************************************************/
139 /* Create Definition file name. */
140 /******************************************************************/
141 pszDefName = GetDefinitionFileName(AD.pszName);
146 /******************************************************************/
147 /* Create Definition file. */
148 /******************************************************************/
149 if ( !bHaveError && ((usRc = WriteDefinitionFile(pszDefName, &AD)) != 0) ) {
153 /******************************************************************/
154 /* Create Action file. */
155 /******************************************************************/
156 if ( !bHaveError && ((usRc = WriteActionFile(&AD)) != 0) ) {
160 /******************************************************************/
161 /* Copy icon files to home directory ~/.dt/icons */
162 /******************************************************************/
163 if ( !bHaveError && ((usRc = CopyIconFiles(&AD)) != 0) ) {
167 /*******************************************************************/
168 /* Reload action database and pop up confirmation message if */
169 /* operation was successful. */
170 /*******************************************************************/
172 _DtTurnOnHourGlass(CreateActionAppShell);
174 DtInitialize(UxDisplay, UxTopLevel, pszExecName, pszExecName);
178 DtActionInvoke(UxTopLevel, "ReloadActions",
179 NULL, 0, NULL, NULL, NULL, 0, NULL, NULL);
181 _DtTurnOffHourGlass(CreateActionAppShell);
183 msgPtr1 = XtNewString(GETMESSAGE(5, 70, "The new action"));
184 msgPtr2 = XtNewString(GETMESSAGE(5, 71,
185 "has been placed in your home folder."));
186 #ifdef UNDO_CMVC_3571
187 msgPtr3 = XtNewString(GETMESSAGE(5, 73,
188 "The action definition file that was created is called:"));
189 fmtPtr = "%s\n\n %s\n\n%s\n\n%s\n %s";
191 fmtPtr = "%s\n\n %s\n\n%s";
194 bufPtr = XtMalloc((strlen(msgPtr1) + strlen(msgPtr2) +
196 #ifdef UNDO_CMVC_3571
197 strlen(msgPtr3) + strlen(pszFile) +
199 strlen(fmtPtr) + 1) * sizeof(char));
201 sprintf(bufPtr, fmtPtr, msgPtr1, AD.pszName, msgPtr2
202 #ifdef UNDO_CMVC_3571
207 display_confirmed_message(CreateActionAppShell, bufPtr);
210 #ifdef UNDO_CMVC_3571
218 /*******************************************************************/
219 /* Update the copy of the AD structure. This will be used to */
220 /* determine if the user has saved the most recent data before */
222 /*******************************************************************/
223 FreeAndClearAD(pMyCopyAD);
224 XtFree((char *) pMyCopyAD);
225 pMyCopyAD = copyAD(&AD);
230 static void questionCB_ReplaceFile(Widget UxWidget,
231 XtPointer UxClientData,
232 XtPointer UxCallbackArg)
235 XtDestroyWidget(XtParent(UxWidget));
238 static void questionCB_CancelSave(Widget UxWidget,
239 XtPointer UxClientData,
240 XtPointer UxCallbackArg)
242 XtDestroyWidget(XtParent(UxWidget));
246 void activateCB_CA_MB_FileSave(Widget UxWidget,
247 XtPointer UxClientData,
248 XtPointer UxCallbackArg)
253 char *msgPtr, *bufPtr;
254 Boolean bHaveError = FALSE;
259 /*********************************************************************/
260 /* Check that required fields are filled in for main window. */
261 /*********************************************************************/
262 if (!CreateActionAppShellCheckFields()) {
264 /*******************************************************************/
265 /* Query fields from main window and save into structure. */
266 /*******************************************************************/
269 /*******************************************************************/
270 /* Write the files. */
271 /*******************************************************************/
272 #ifdef UNDO_CMVC_4662
274 strcpy(pszFile, pszFileToEdit);
278 /****************************************************************/
279 /* Create Action file name. */
280 /****************************************************************/
281 newName = ReplaceSpaces(AD.pszName);
282 pszActionFile = NULL;
283 pszEnvVar = getenv("HOME");
284 if ( pszEnvVar && strlen(pszEnvVar) ) {
285 pszActionFile = malloc(strlen(pszEnvVar)+strlen(newName)+10);
287 sprintf(pszActionFile, "%s/%s", pszEnvVar, newName);
289 msgPtr = GETMESSAGE(5, 170,
290 "The HOME environment variable is not set.\n\
291 The HOME environment variable must be set in order\n\
292 for this action to be saved.");
293 bufPtr = XtNewString(msgPtr);
294 display_error_message(CreateActionAppShell, bufPtr);
299 /****************************************************************/
300 /* Check if action file exists and flag a warning if it does. */
301 /****************************************************************/
302 if ( (!bHaveError) &&
304 (!stat(pszActionFile, &statbuf)) ) {
306 /* INTERNATIONALIZE */
307 msgPtr = "A file named\n\n %s\n\n\
308 already exists in your home folder.\n\
309 The existing file may be an application,\n\
310 data file, or an action file.\n\n\
311 What do you want to do?";
312 bufPtr = XtMalloc((strlen(msgPtr) + strlen(newName) + 1) *
314 sprintf(bufPtr, msgPtr, newName);
316 /* INTERNATIONALIZE */
317 display_question_message(CreateActionAppShell, bufPtr,
318 "Replace", questionCB_ReplaceFile,
319 "Cancel Save", questionCB_CancelSave,
320 (char *)NULL, (XtCallbackProc)NULL);
322 XtFree(pszActionFile);
326 /****************************************************************/
327 /* Now we are done with the newName variable and can free. */
328 /****************************************************************/
331 #ifdef UNDO_CMVC_4662
342 static void activateCB_CA_FiletypesDelete( Widget UxWidget,
343 XtPointer UxClientData,
344 XtPointer UxCallbackArg)
346 int *poslist, poscnt;
349 FiletypeData **papArray;
353 char *msgPtr1, *msgPtr2, *fmtPtr, *errPtr;
356 /**************************************************************************/
357 /* Determine the filetypes to delete and delete them. */
358 /**************************************************************************/
359 XtVaGetValues(FileTypes, XmNitems, &items, NULL);
360 if (XmListGetSelectedPos(FileTypes, &poslist, &poscnt)) {
364 /*********************************************************************/
365 /* Delete the filetype name from the listbox. */
366 /*********************************************************************/
367 XmListDeleteItem(FileTypes, items[*p -1]);
371 /***********************************************************************/
372 /* Remove the filetypes from the filetype array in the ActionData */
374 /***********************************************************************/
375 if ((AD.cFiletypes - poscnt) > 0) {
376 if ( papArray = (FiletypeData **) XtMalloc(sizeof(FiletypeData *) * (AD.cFiletypes - poscnt)) ) {
378 for (i = 0; i < AD.cFiletypes; i++) {
380 for (k = 0; k < poscnt; k++) {
381 if ((i + 1) == poslist[k]) {
386 /**************************************************************/
387 /* If did not find this element in the delete list, then add */
388 /* it back to our good list. */
389 /* Else do not include in the good list and free its memory. */
390 /**************************************************************/
392 papArray[cnt] = AD.papFiletypes[i];
395 free_Filetypedata(AD.papFiletypes[i]);
398 if (AD.papFiletypes) {
399 XtFree((XtPointer)AD.papFiletypes);
401 AD.papFiletypes = papArray;
405 /********************************************************************/
406 /* Delete the entire array. */
407 /********************************************************************/
408 for (i = 0; i < AD.cFiletypes; i++) {
409 free_Filetypedata(AD.papFiletypes[i]);
411 AD.papFiletypes = (FiletypeData **)NULL;
415 msgPtr1 = XtNewString(GETMESSAGE(5, 120,
416 "You have not selected a Datatype from the\n\
417 'Datatypes That Use This Action' list."));
418 msgPtr2 = XtNewString(GETMESSAGE(5, 125,
419 "Please select the Datatype you would like to Delete."));
421 len = (strlen(msgPtr1) + strlen(msgPtr2) + strlen(fmtPtr) + 2);
422 errPtr = XtMalloc(len);
423 snprintf(errPtr,len - 1, fmtPtr, msgPtr1, msgPtr2);
426 display_error_message(CreateActionAppShell, errPtr);
432 /*****************************************************************************/
434 /* valueChangedCB_CA_WinType */
436 /*****************************************************************************/
437 static void valueChangedCB_CA_WinType( Widget UxWidget,
438 XtPointer UxClientData,
439 XtPointer UxCallbackArg)
443 bSetToggle = ((XmToggleButtonCallbackStruct *)UxCallbackArg)->set;
445 printf("Wintype change before %X\n", AD.fsFlags);
447 switch ((int)UxClientData) {
448 case CA_WT_XWINDOWS :
449 if (bSetToggle) AD.fsFlags |= CA_WT_XWINDOWS;
450 else AD.fsFlags &= (~(CA_WT_XWINDOWS));
453 if (bSetToggle) AD.fsFlags |= CA_WT_TERM;
454 else AD.fsFlags &= (~(CA_WT_TERM));
456 case CA_WT_PERMTERM :
457 if (bSetToggle) AD.fsFlags |= CA_WT_PERMTERM;
458 else AD.fsFlags &= (~(CA_WT_PERMTERM));
462 printf("Wintype change after %X\n", AD.fsFlags);
467 /*****************************************************************************/
469 /* valueChangedCB_DroppableFiletypes */
471 /*****************************************************************************/
472 static void valueChangedCB_DroppableFiletypes( Widget UxWidget,
473 XtPointer UxClientData,
474 XtPointer UxCallbackArg)
476 if (((XmToggleButtonCallbackStruct *)UxCallbackArg)->set) {
477 AD.fsFlags |= CA_DF_ONLYFTFILES;
479 AD.fsFlags &= (~(CA_DF_ONLYFTFILES));
483 /*****************************************************************************/
485 /* simpleCB_WindowTypeOptionMenu */
487 /*****************************************************************************/
488 static void activateCB_WindowTypeOptionMenu( Widget UxWidget,
489 XtPointer UxClientData,
490 XtPointer UxCallbackArg)
492 AD.fsFlags &= (~(CA_WT_XWINDOWS | CA_WT_TERM | CA_WT_PERMTERM));
493 switch ((int)(XtArgVal)UxClientData) {
494 case CA_WT_XWINDOWS :
495 AD.fsFlags |= CA_WT_XWINDOWS;
498 AD.fsFlags |= CA_WT_TERM;
500 case CA_WT_PERMTERM :
501 AD.fsFlags |= CA_WT_PERMTERM;
506 /*******************************************************************************
507 The 'build_' function creates all the widgets
508 using the resource values specified in the Property Editor.
509 *******************************************************************************/
511 static Widget _Uxbuild_CreateActionAppShell(void)
514 Widget CA_MB_FileOption_shell;
515 Widget CA_MB_HelpOption_shell;
516 Widget CA_MB_Help_Sep1;
517 Widget CA_MB_Help_Sep2;
518 Widget CA_MB_OptionsOption_shell;
521 Widget CA_WindowType_OptionMenuShell;
522 Widget CA_WindowType_Pane;
523 Widget CA_WindowType_OptionMenu;
525 XtArgVal /* Dimension */ dim1, dim2;
526 Widget CA_MED_IconForm, CA_TINY_IconForm, CA_LRG_IconForm;
529 XmString emptyString;
530 char titleBuf[MAXBUFSIZE];
532 #define ICON_MIN_HEIGHT 83
533 #define FINDEDIT_SPACING 6
534 #define BORDER_OFFSET 3
536 /* Creation of CreateActionAppShell */
537 _UxParent = UxParent;
538 if ( _UxParent == NULL )
540 _UxParent = UxTopLevel;
543 strcpy(titleBuf, GETMESSAGE(3, 10, "Create Action"));
544 CreateActionAppShell = XtVaCreatePopupShell( "CreateActionAppShell",
545 applicationShellWidgetClass,
553 XmNiconName, titleBuf,
555 XmNallowShellResize, TRUE,
557 XmNdeleteResponse, XmDO_NOTHING, /* CDExc19440 */
560 /* CDExc19440 - make sure user doesn't accidentally lose work. */
561 XmAddWMProtocolCallback(CreateActionAppShell,
562 XmInternAtom(UxDisplay,
569 /* Creation of CreateActionMainWindow */
570 CreateActionMainWindow = XtVaCreateManagedWidget( "CreateActionMainWindow",
571 xmMainWindowWidgetClass,
572 CreateActionAppShell,
573 XmNunitType, XmPIXELS,
576 XmNscrollingPolicy, XmAUTOMATIC,
579 /* Creation of CreateActionMainWindow */
580 CreateActionMainWindow = XtVaCreateManagedWidget( "CreateActionMainWindow",
581 xmMainWindowWidgetClass,
582 CreateActionAppShell,
583 XmNunitType, XmPIXELS,
588 XtAddCallback( CreateActionMainWindow, XmNhelpCallback,
589 (XtCallbackProc) helpCB_general,
590 (XtPointer) HELP_ONITEM );
592 /*********************************************************************/
596 /*********************************************************************/
597 /* Creation of CA_MenuBar */
598 CA_MenuBar = XtVaCreateManagedWidget( "CA_MenuBar",
599 xmRowColumnWidgetClass,
600 CreateActionMainWindow,
601 XmNrowColumnType, XmMENU_BAR,
602 XmNmenuAccelerator, "<KeyUp>F10",
603 XmNpacking, XmPACK_TIGHT,
604 XmNentryAlignment, XmALIGNMENT_BEGINNING,
605 XmNorientation, XmHORIZONTAL,
608 /* Creation of CA_MB_FileOption */
609 CA_MB_FileOption_shell = XtVaCreatePopupShell ("CA_MB_FileOption_shell",
610 xmMenuShellWidgetClass, CA_MenuBar,
613 XmNallowShellResize, TRUE,
614 XmNoverrideRedirect, TRUE,
617 CA_MB_FileOption = XtVaCreateWidget( "CA_MB_FileOption",
618 xmRowColumnWidgetClass,
619 CA_MB_FileOption_shell,
620 XmNrowColumnType, XmMENU_PULLDOWN,
623 /* Creation of CA_MB_FileNew */
625 mnemonic = GETMESSAGE(2, 21, "N");
627 strcpy(mnemonic, GETMESSAGE(2, 21, "N"));
628 CA_MB_FileNew = XtVaCreateManagedWidget( "CA_MB_FileNew",
629 xmPushButtonWidgetClass,
631 RES_CONVERT( XmNlabelString, GETMESSAGE(2, 20, "New")),
632 XmNmnemonic, mnemonic[0],
634 XtAddCallback( CA_MB_FileNew, XmNactivateCallback,
635 (XtCallbackProc) activateCB_FileNew,
638 /* Creation of CA_MB_FileOpen */
640 mnemonic = GETMESSAGE(2, 16, "O");
642 strcpy(mnemonic, GETMESSAGE(2, 16, "O"));
643 CA_MB_FileOpen = XtVaCreateManagedWidget( "CA_MB_FileOpen",
644 xmPushButtonWidgetClass,
646 RES_CONVERT( XmNlabelString, GETMESSAGE(2, 15, "Open...")),
647 XmNmnemonic, mnemonic[0],
649 XtAddCallback( CA_MB_FileOpen, XmNactivateCallback,
650 (XtCallbackProc) activateCB_FileOpen,
653 /* Creation of CA_MB_FileSave */
655 mnemonic = GETMESSAGE(2, 26, "S");
657 strcpy(mnemonic, GETMESSAGE(2, 26, "S"));
658 CA_MB_FileSave = XtVaCreateManagedWidget( "CA_MB_FileSave",
659 xmPushButtonWidgetClass,
661 RES_CONVERT( XmNlabelString, GETMESSAGE(2, 25, "Save")),
662 XmNmnemonic, mnemonic[0],
664 XtAddCallback( CA_MB_FileSave, XmNactivateCallback,
665 (XtCallbackProc) activateCB_CA_MB_FileSave,
668 /* Creation of CA_MB_Sep */
669 CA_MB_Sep = XtVaCreateManagedWidget( "CA_MB_Sep",
670 xmSeparatorWidgetClass,
674 /* Creation of CA_MB_FileExit */
676 mnemonic = GETMESSAGE(2, 31, "x");
678 strcpy(mnemonic, GETMESSAGE(2, 31, "x"));
679 CA_MB_FileExit = XtVaCreateManagedWidget( "CA_MB_FileExit",
680 xmPushButtonWidgetClass,
682 RES_CONVERT( XmNlabelString, GETMESSAGE(2, 30, "Exit")),
683 XmNmnemonic, mnemonic[0],
685 XtAddCallback( CA_MB_FileExit, XmNactivateCallback,
686 (XtCallbackProc) activateCB_FileQuit,
689 /* Creation of CA_MB_FileTop */
691 mnemonic = GETMESSAGE(2, 11, "F");
693 strcpy(mnemonic, GETMESSAGE(2, 11, "F"));
694 CA_MB_FileTop = XtVaCreateManagedWidget( "CA_MB_FileTop",
695 xmCascadeButtonWidgetClass,
697 RES_CONVERT( XmNlabelString, GETMESSAGE(2, 10, "File")),
698 XmNmnemonic, mnemonic[0],
699 XmNsubMenuId, CA_MB_FileOption,
702 /* Creation of CA_MB_HelpOption */
703 CA_MB_HelpOption_shell = XtVaCreatePopupShell ("CA_MB_HelpOption_shell",
704 xmMenuShellWidgetClass, CA_MenuBar,
707 XmNallowShellResize, TRUE,
708 XmNoverrideRedirect, TRUE,
711 CA_MB_HelpOption = XtVaCreateWidget( "CA_MB_HelpOption",
712 xmRowColumnWidgetClass,
713 CA_MB_HelpOption_shell,
714 XmNrowColumnType, XmMENU_PULLDOWN,
718 * Creation of CA_MB_HelpOverview
720 strcpy(mnemonic, GETMESSAGE(2, 61, "v"));
721 CA_MB_HelpOverview = XtVaCreateManagedWidget( "CA_MB_HelpOverview",
722 xmPushButtonWidgetClass,
724 RES_CONVERT( XmNlabelString, GETMESSAGE(2, 60, "Overview")),
725 XmNmnemonic, mnemonic[0],
726 XmNuserData, CreateActionAppShell,
728 XtAddCallback( CA_MB_HelpOverview, XmNactivateCallback,
729 (XtCallbackProc) helpCB_general,
730 (XtPointer) HELP_OVERVIEW );
733 * Creation of CA_MB_HelpTasks
735 strcpy(mnemonic, GETMESSAGE(2, 71, "T"));
736 CA_MB_HelpTasks = XtVaCreateManagedWidget( "CA_MB_HelpTasks",
737 xmPushButtonWidgetClass,
739 RES_CONVERT( XmNlabelString, GETMESSAGE(2, 70, "Tasks")),
740 XmNmnemonic, mnemonic[0],
741 XmNuserData, CreateActionAppShell,
743 XtAddCallback( CA_MB_HelpTasks, XmNactivateCallback,
744 (XtCallbackProc) helpCB_general,
745 (XtPointer) HELP_TASKS );
748 /* Creation of CA_MB_HelpTOC */
750 mnemonic = GETMESSAGE(2, 66, "T");
752 strcpy(mnemonic, GETMESSAGE(2, 66, "T"));
753 CA_MB_HelpTOC = XtVaCreateManagedWidget( "CA_MB_HelpTOC",
754 xmPushButtonWidgetClass,
756 RES_CONVERT( XmNlabelString, GETMESSAGE(2, 65, "Table Of Contents...")),
757 XmNmnemonic, mnemonic[0],
758 XmNuserData, CreateActionAppShell,
762 * Creation of CA_MB_HelpReference
764 strcpy(mnemonic, GETMESSAGE(2, 76, "R"));
765 CA_MB_HelpReference = XtVaCreateManagedWidget( "CA_MB_HelpReference",
766 xmPushButtonWidgetClass,
768 RES_CONVERT( XmNlabelString, GETMESSAGE(2, 75, "Reference")),
769 XmNmnemonic, mnemonic[0],
770 XmNuserData, CreateActionAppShell,
772 XtAddCallback( CA_MB_HelpReference, XmNactivateCallback,
773 (XtCallbackProc) helpCB_general,
774 (XtPointer) HELP_REFERENCE );
777 * Creation of CA_MB_Help_Sep1
779 CA_MB_Help_Sep1 = XtVaCreateManagedWidget( "CA_MB_Help_Sep1",
780 xmSeparatorWidgetClass,
785 * Creation of CA_MB_HelpUsing
787 strcpy(mnemonic, GETMESSAGE(2, 81, "U"));
788 CA_MB_HelpUsing = XtVaCreateManagedWidget( "CA_MB_HelpUsing",
789 xmPushButtonWidgetClass,
791 RES_CONVERT( XmNlabelString, GETMESSAGE(2, 80, "Using Help")),
792 XmNmnemonic, mnemonic[0],
793 XmNuserData, CreateActionAppShell,
795 XtAddCallback( CA_MB_HelpUsing, XmNactivateCallback,
796 (XtCallbackProc) helpCB_general,
797 (XtPointer) HELP_USING );
800 * Creation of CA_MB_Help_Sep2
802 CA_MB_Help_Sep2 = XtVaCreateManagedWidget( "CA_MB_Help_Sep2",
803 xmSeparatorWidgetClass,
808 * Creation of CA_MB_HelpAbout
810 strcpy(mnemonic, GETMESSAGE(2, 86, "A"));
811 CA_MB_HelpAbout = XtVaCreateManagedWidget( "CA_MB_HelpAbout",
812 xmPushButtonWidgetClass,
814 RES_CONVERT( XmNlabelString, GETMESSAGE(2, 85, "About Create Action")),
815 XmNmnemonic, mnemonic[0],
816 XmNuserData, CreateActionAppShell,
818 XtAddCallback( CA_MB_HelpAbout, XmNactivateCallback,
819 (XtCallbackProc) helpCB_general,
820 (XtPointer) HELP_ABOUT );
823 * Creation of CA_MB_HelpTop
825 strcpy(mnemonic, GETMESSAGE(2, 54, "H"));
826 CA_MB_HelpTop = XtVaCreateManagedWidget( "CA_MB_HelpTop",
827 xmCascadeButtonWidgetClass,
829 RES_CONVERT( XmNlabelString, GETMESSAGE(2, 53, "Help")),
830 XmNmnemonic, mnemonic[0],
831 XmNsubMenuId, CA_MB_HelpOption,
832 XmNuserData, CreateActionAppShell,
835 /* Creation of CA_MB_OptionsOption */
836 CA_MB_OptionsOption_shell = XtVaCreatePopupShell ("CA_MB_OptionsOption_shell",
837 xmMenuShellWidgetClass, CA_MenuBar,
840 XmNallowShellResize, TRUE,
841 XmNoverrideRedirect, TRUE,
844 CA_MB_OptionsOption = XtVaCreateWidget( "CA_MB_OptionsOption",
845 xmRowColumnWidgetClass,
846 CA_MB_OptionsOption_shell,
847 XmNrowColumnType, XmMENU_PULLDOWN,
850 /* Creation of ColorMonoOption */
851 strcpy(mnemonic, GETMESSAGE(2, 50, "M"));
852 ColorMonoOption = XtVaCreateManagedWidget( "ColorMonoOption",
853 xmToggleButtonWidgetClass,
855 RES_CONVERT( XmNlabelString, GETMESSAGE(2, 49, "Show Monochrome Icons")),
856 XmNmnemonic, mnemonic[0],
857 XmNindicatorSize, 20,
858 XmNhighlightThickness, 0,
860 XtAddCallback( ColorMonoOption, XmNvalueChangedCallback,
861 (XtCallbackProc) valueChangedCB_ColorMonoOption,
863 createCB_ColorMonoOption(ColorMonoOption);
866 /* Creation of CA_MB_OptionTop */
867 strcpy(mnemonic, GETMESSAGE(2, 36, "O"));
868 CA_MB_OptionTop = XtVaCreateManagedWidget( "CA_MB_OptionTop",
869 xmCascadeButtonWidgetClass,
871 RES_CONVERT( XmNlabelString, GETMESSAGE(2, 35, "Options")),
872 XmNmnemonic, mnemonic[0],
873 XmNsubMenuId, CA_MB_OptionsOption,
876 /* Creation of CA_Form */
877 CA_Form = XtVaCreateManagedWidget( "CA_Form",
879 CreateActionMainWindow,
881 XmNresizePolicy, XmRESIZE_ANY,
884 /*********************************************************************/
888 /*********************************************************************/
889 /* Creation of CA_ActionNameLabel */
890 CA_ActionNameLabel = XtVaCreateManagedWidget( "CA_ActionNameLabel",
895 RES_CONVERT( XmNlabelString, GETMESSAGE(3, 12, "Action Name (Icon Label):")),
896 XmNalignment, XmALIGNMENT_BEGINNING,
898 XmNleftAttachment, XmATTACH_FORM,
900 XmNtopAttachment, XmATTACH_FORM,
902 XmNrightAttachment, XmATTACH_FORM,
905 /* Creation of CA_ActionNameTextField */
906 CA_ActionNameTextField = XtVaCreateManagedWidget( "CA_ActionNameTextField",
907 xmTextFieldWidgetClass,
912 XmNtopWidget, CA_ActionNameLabel,
913 XmNtopAttachment, XmATTACH_WIDGET,
915 XmNleftAttachment, XmATTACH_FORM,
917 XmNrightAttachment, XmATTACH_FORM,
920 XtAddCallback( CA_ActionNameTextField, XmNvalueChangedCallback,
921 (XtCallbackProc) valueChangedCB_CA_ActionNameTextField,
925 /*********************************************************************/
929 /*********************************************************************/
930 /* Creation of CA_ActionIconLabel */
931 CA_ActionIconLabel = XtVaCreateManagedWidget( "CA_ActionIconLabel",
936 RES_CONVERT( XmNlabelString, GETMESSAGE(3, 13, "Action Icons:")),
937 XmNalignment, XmALIGNMENT_BEGINNING,
939 XmNleftAttachment, XmATTACH_FORM,
941 XmNtopWidget, CA_ActionNameTextField,
942 XmNtopAttachment, XmATTACH_WIDGET,
944 XmNrightAttachment, XmATTACH_FORM,
947 /* Creation of CA_ActionIconForm */
948 CA_ActionIconForm = XtVaCreateManagedWidget( "CA_ActionIconForm",
951 XmNresizePolicy, XmRESIZE_NONE,
955 XmNnavigationType, XmTAB_GROUP,
957 XmNtopWidget, CA_ActionIconLabel,
958 XmNtopAttachment, XmATTACH_WIDGET,
960 XmNleftAttachment, XmATTACH_FORM,
962 XmNrightAttachment, XmATTACH_FORM,
963 XmNshadowThickness, 3,
964 XmNshadowType, XmSHADOW_ETCHED_IN,
965 XmNautoUnmanage, FALSE,
967 XmNallowOverlap, TRUE,
969 XmNverticalSpacing, 5,
972 CA_MED_IconForm = XtVaCreateManagedWidget( "CA_MED_IconForm",
975 XmNresizePolicy, XmRESIZE_NONE,
976 XmNborderWidth, ICON_BORDER_WIDTH,
979 XmNleftAttachment, XmATTACH_POSITION,
980 XmNbottomPosition, 88,
982 XmNbottomAttachment, XmATTACH_POSITION,
985 /* Creation of CA_MED_IconGadget */
986 emptyString = XmStringCreateLocalized("");
987 pIconData = (IconData *)XtMalloc(sizeof(IconData));
988 memset(pIconData, 0, sizeof(IconData));
989 IconDataList[CA_MED] = pIconData;
990 CA_MED_IconGadget = XtVaCreateManagedWidget( "CA_MED_IconGadget",
993 XmNalignment, XmALIGNMENT_CENTER,
994 XmNuserData, pIconData,
995 XmNstring, emptyString,
996 XmNrecomputeSize, TRUE,
997 XmNleftOffset, BORDER_OFFSET,
998 XmNleftAttachment, XmATTACH_FORM,
999 XmNrightOffset, BORDER_OFFSET,
1000 XmNrightAttachment, XmATTACH_FORM,
1001 XmNtopOffset, BORDER_OFFSET,
1002 XmNtopAttachment, XmATTACH_FORM,
1003 XmNbottomOffset, BORDER_OFFSET,
1004 XmNbottomAttachment, XmATTACH_FORM,
1006 XmNleftPosition, 32,
1008 XmNleftAttachment, XmATTACH_POSITION,
1009 XmNbottomPosition, 88,
1011 XmNbottomAttachment, XmATTACH_POSITION,
1014 pIconData->wid = CA_MED_IconGadget;
1015 pIconData->size = Medium_Icon;
1016 XtAddCallback( CA_MED_IconGadget, XmNcallback,
1017 (XtCallbackProc) activateCB_action_icon,
1019 createCB_IconGadget( CA_MED_IconGadget, TRUE, Medium_Icon );
1020 last_action_pushed = CA_MED_IconGadget;
1022 CA_TINY_IconForm = XtVaCreateManagedWidget( "CA_TINY_IconForm",
1025 XmNresizePolicy, XmRESIZE_NONE,
1027 XmNleftPosition, 52,
1029 XmNleftAttachment, XmATTACH_POSITION,
1030 XmNbottomPosition, 88,
1032 XmNbottomAttachment, XmATTACH_POSITION,
1035 /* Creation of CA_TINY_IconGadget */
1036 pIconData = (IconData *)XtMalloc(sizeof(IconData));
1037 memset(pIconData, 0, sizeof(IconData));
1038 IconDataList[CA_TINY] = pIconData;
1039 CA_TINY_IconGadget = XtVaCreateManagedWidget( "CA_TINY_IconGadget",
1042 XmNalignment, XmALIGNMENT_CENTER,
1043 XmNuserData, pIconData,
1044 XmNrecomputeSize, TRUE,
1045 XmNstring, emptyString,
1046 XmNleftOffset, BORDER_OFFSET,
1047 XmNleftAttachment, XmATTACH_FORM,
1048 XmNrightOffset, BORDER_OFFSET,
1049 XmNrightAttachment, XmATTACH_FORM,
1050 XmNtopOffset, BORDER_OFFSET,
1051 XmNtopAttachment, XmATTACH_FORM,
1052 XmNbottomOffset, BORDER_OFFSET,
1053 XmNbottomAttachment, XmATTACH_FORM,
1055 pIconData->wid = CA_TINY_IconGadget;
1056 pIconData->size = Tiny_Icon;
1057 XtAddCallback( CA_TINY_IconGadget, XmNcallback,
1058 (XtCallbackProc) activateCB_action_icon,
1060 createCB_IconGadget( CA_TINY_IconGadget, TRUE, Tiny_Icon );
1062 CA_LRG_IconForm = XtVaCreateManagedWidget( "CA_LRG_IconForm",
1065 XmNresizePolicy, XmRESIZE_NONE,
1067 XmNleftPosition, 11,
1069 XmNleftAttachment, XmATTACH_POSITION,
1070 XmNbottomPosition, 88,
1072 XmNbottomAttachment, XmATTACH_POSITION,
1075 /* Creation of CA_LRG_IconGadget */
1076 pIconData = (IconData *)XtMalloc(sizeof(IconData));
1077 memset(pIconData, 0, sizeof(IconData));
1078 IconDataList[CA_LRG] = pIconData;
1079 CA_LRG_IconGadget = XtVaCreateManagedWidget( "CA_LRG_IconGadget",
1082 XmNalignment, XmALIGNMENT_CENTER,
1083 XmNuserData, pIconData,
1084 XmNstring, emptyString,
1085 XmNrecomputeSize, TRUE,
1086 XmNleftOffset, BORDER_OFFSET,
1087 XmNleftAttachment, XmATTACH_FORM,
1088 XmNrightOffset, BORDER_OFFSET,
1089 XmNrightAttachment, XmATTACH_FORM,
1090 XmNtopOffset, BORDER_OFFSET,
1091 XmNtopAttachment, XmATTACH_FORM,
1092 XmNbottomOffset, BORDER_OFFSET,
1093 XmNbottomAttachment, XmATTACH_FORM,
1095 pIconData->wid = CA_LRG_IconGadget;
1096 pIconData->size = Large_Icon;
1097 XtAddCallback( CA_LRG_IconGadget, XmNcallback,
1098 (XtCallbackProc) activateCB_action_icon,
1100 createCB_IconGadget( CA_LRG_IconGadget, TRUE, Large_Icon );
1102 XmStringFree(emptyString);
1104 /* Creation of CA_EditIcon_button */
1105 CA_EditIcon_button = XtVaCreateManagedWidget( "CA_EditIcon_button",
1106 xmPushButtonGadgetClass,
1108 RES_CONVERT( XmNlabelString, GETMESSAGE(6, 20, "Edit Icon...")),
1109 XmNalignment, XmALIGNMENT_BEGINNING,
1110 XmNleftPosition, 68,
1112 XmNleftAttachment, XmATTACH_POSITION,
1114 XmNtopOffset, (int)(FINDEDIT_SPACING / 2),
1115 XmNtopAttachment, XmATTACH_POSITION,
1117 XtAddCallback( CA_EditIcon_button, XmNactivateCallback,
1118 (XtCallbackProc) activateCB_edit_icon,
1119 (XtPointer) CA_ACTION_ICONS );
1121 /* Creation of CA_FindSet_button */
1122 CA_FindSet_button = XtVaCreateManagedWidget( "CA_FindSet_button",
1123 xmPushButtonGadgetClass,
1125 RES_CONVERT( XmNlabelString, GETMESSAGE(6, 19, "Find Set...")),
1126 XmNalignment, XmALIGNMENT_BEGINNING,
1127 XmNmultiClick, XmMULTICLICK_DISCARD,
1128 XmNleftPosition, 68,
1130 XmNleftAttachment, XmATTACH_POSITION,
1131 XmNbottomPosition, 50,
1132 XmNbottomOffset, (int)(FINDEDIT_SPACING / 2),
1133 XmNbottomAttachment, XmATTACH_POSITION,
1135 XtAddCallback( CA_FindSet_button, XmNactivateCallback,
1136 (XtCallbackProc) activateCB_open_FindSet,
1137 (XtPointer) CA_ACTION_ICONS );
1139 /******************************************************************/
1140 /* Determine which button is wider, and attach the short on to it */
1141 /******************************************************************/
1142 XtVaGetValues(CA_EditIcon_button, XmNwidth, &dim1, NULL);
1143 XtVaGetValues(CA_FindSet_button, XmNwidth, &dim2, NULL);
1145 XtVaSetValues(CA_FindSet_button,
1149 XtVaSetValues(CA_EditIcon_button,
1153 /******************************************************************/
1154 /* Determine vertical positioning for findset and edit buttons */
1155 /******************************************************************/
1156 XtVaGetValues(CA_EditIcon_button, XmNheight, &dim1, NULL);
1157 XtVaGetValues(CA_FindSet_button, XmNheight, &dim2, NULL);
1158 if ((int)(dim1 + dim2) + (3*(FINDEDIT_SPACING)) > ICON_MIN_HEIGHT) {
1159 XtVaSetValues(CA_EditIcon_button,
1160 XmNbottomOffset, FINDEDIT_SPACING,
1161 XmNbottomAttachment, XmATTACH_FORM,
1163 XtVaSetValues(CA_FindSet_button,
1164 XmNbottomOffset, FINDEDIT_SPACING,
1165 XmNbottomWidget, CA_EditIcon_button,
1166 XmNbottomAttachment, XmATTACH_WIDGET,
1167 XmNtopOffset, FINDEDIT_SPACING,
1168 XmNtopAttachment, XmATTACH_FORM,
1173 /******************************************************************/
1174 /* Bogus separator to keep ActionIconForm a minimum height */
1175 /******************************************************************/
1176 separator1 = XtVaCreateManagedWidget( "separator1",
1177 xmSeparatorWidgetClass,
1182 XmNheight, ICON_MIN_HEIGHT,
1183 XmNorientation, XmVERTICAL,
1184 XmNseparatorType, XmNO_LINE,
1186 XmNtopAttachment, XmATTACH_FORM,
1188 XmNbottomAttachment, XmATTACH_FORM,
1191 /*********************************************************************/
1195 /*********************************************************************/
1196 /* Creation of CA_DblClkLabel */
1197 CA_DblClkLabel = XtVaCreateManagedWidget( "CA_DblClkLabel",
1200 RES_CONVERT( XmNlabelString, GETMESSAGE(3, 22, "Command When Action Is Opened (Double-clicked):")),
1201 XmNalignment, XmALIGNMENT_BEGINNING,
1203 XmNleftAttachment, XmATTACH_FORM,
1205 XmNtopWidget, CA_ActionIconForm,
1206 XmNtopAttachment, XmATTACH_WIDGET,
1208 XmNrightAttachment, XmATTACH_FORM,
1211 /* Creation of CA_DblClkText */
1212 CA_DblClkText = XtVaCreateManagedWidget( "CA_DblClkText",
1213 xmTextFieldWidgetClass,
1215 XmNnavigationType, XmTAB_GROUP,
1217 XmNtopWidget, CA_DblClkLabel,
1218 XmNtopAttachment, XmATTACH_WIDGET,
1220 XmNleftAttachment, XmATTACH_FORM,
1222 XmNrightAttachment, XmATTACH_FORM,
1226 /*********************************************************************/
1228 /* Help Text Label */
1230 /*********************************************************************/
1231 /* Creation of CA_HlpTxtLabel */
1232 CA_HlpTxtLabel = XtVaCreateManagedWidget( "CA_HlpTxtLabel",
1235 RES_CONVERT( XmNlabelString, GETMESSAGE(3, 30, "Help Text For Action Icon:")),
1236 XmNalignment, XmALIGNMENT_BEGINNING,
1238 XmNleftAttachment, XmATTACH_FORM,
1240 XmNtopWidget, CA_DblClkText,
1241 XmNtopAttachment, XmATTACH_WIDGET,
1243 XmNrightAttachment, XmATTACH_FORM,
1246 /*********************************************************************/
1248 /* Advanced Features Area */
1250 /*********************************************************************/
1251 /* Creation of XprtOptionForm */
1252 XprtOptionForm = XtVaCreateManagedWidget( "XprtOptionForm",
1255 XmNresizePolicy, XmRESIZE_ANY,
1257 XmNleftAttachment, XmATTACH_FORM,
1259 XmNrightAttachment, XmATTACH_FORM,
1261 XmNbottomAttachment, XmATTACH_FORM,
1264 /*********************************************************************/
1266 /* Optional Separator */
1268 /*********************************************************************/
1270 /* Creation of CA_XprtSep1 */
1271 CA_XprtSep1 = XtVaCreateManagedWidget( "CA_XprtSep1",
1272 xmSeparatorWidgetClass,
1275 XmNleftAttachment, XmATTACH_FORM,
1277 XmNrightAttachment, XmATTACH_FORM,
1279 XmNtopAttachment, XmATTACH_FORM,
1282 /*********************************************************************/
1286 /*********************************************************************/
1287 /* Creation of CA_ActionOpenLabel */
1288 CA_ActionOpenLabel = XtVaCreateManagedWidget( "CA_ActionOpenLabel",
1291 RES_CONVERT( XmNlabelString, GETMESSAGE(4, 11, "When Action Opens, Ask Users for:")),
1292 XmNalignment, XmALIGNMENT_BEGINNING,
1294 XmNleftAttachment, XmATTACH_FORM,
1296 XmNrightAttachment, XmATTACH_FORM,
1298 XmNtopWidget, CA_XprtSep1,
1299 XmNtopAttachment, XmATTACH_WIDGET,
1302 /* Creation of CA_XprtActionOpenText */
1303 CA_XprtActionOpenText = XtVaCreateManagedWidget( "CA_XprtActionOpenText",
1307 XmNnavigationType, XmTAB_GROUP,
1309 XmNleftAttachment, XmATTACH_FORM,
1311 XmNrightAttachment, XmATTACH_FORM,
1313 XmNtopWidget, CA_ActionOpenLabel,
1314 XmNtopAttachment, XmATTACH_WIDGET,
1315 /*XmNeditMode, XmMULTI_LINE_EDIT,*/
1316 /*XmNwordWrap, TRUE,*/
1319 /*********************************************************************/
1321 /* Filetypes that use this Action area */
1323 /*********************************************************************/
1324 /* Creation of CA_FiletypesLabel */
1325 CA_FiletypesLabel = XtVaCreateManagedWidget( "CA_FiletypesLabel",
1330 RES_CONVERT( XmNlabelString, GETMESSAGE(4, 12, "Datatypes That Use This Action:")),
1331 XmNalignment, XmALIGNMENT_BEGINNING,
1333 XmNleftAttachment, XmATTACH_FORM,
1335 XmNrightAttachment, XmATTACH_FORM,
1337 XmNtopWidget, CA_XprtActionOpenText,
1338 XmNtopAttachment, XmATTACH_WIDGET,
1341 /*********************************************************************/
1343 /* Add, Delete, Edit buttons for Filetypes */
1345 /*********************************************************************/
1346 /* Creation of rowColumn1 */
1347 rowColumn1 = XtVaCreateManagedWidget( "rowColumn1",
1348 xmRowColumnWidgetClass,
1350 XmNnavigationType, XmTAB_GROUP,
1352 XmNtopWidget, CA_FiletypesLabel,
1353 XmNtopAttachment, XmATTACH_WIDGET,
1355 XmNrightAttachment, XmATTACH_FORM,
1358 /* Creation of CA_FiletypesAdd */
1359 CA_FiletypesAdd = XtVaCreateManagedWidget( "CA_FiletypesAdd",
1360 xmPushButtonGadgetClass,
1362 RES_CONVERT( XmNlabelString, GETMESSAGE(4, 13, "Add...")),
1363 XmNalignment, XmALIGNMENT_BEGINNING,
1367 XtAddCallback( CA_FiletypesAdd, XmNactivateCallback,
1368 (XtCallbackProc) activateCB_add_filetype,
1371 /* Creation of CA_FiletypesDelete */
1372 CA_FiletypesDelete = XtVaCreateManagedWidget( "CA_FiletypesDelete",
1373 xmPushButtonGadgetClass,
1375 RES_CONVERT( XmNlabelString, GETMESSAGE(4, 14, "Delete")),
1376 XmNalignment, XmALIGNMENT_BEGINNING,
1380 XtAddCallback( CA_FiletypesDelete, XmNactivateCallback,
1381 (XtCallbackProc) activateCB_CA_FiletypesDelete,
1384 /* Creation of CA_FiletypesEdit */
1385 CA_FiletypesEdit = XtVaCreateManagedWidget( "CA_FiletypesEdit",
1386 xmPushButtonGadgetClass,
1388 RES_CONVERT( XmNlabelString, GETMESSAGE(4, 15, "Edit...")),
1389 XmNalignment, XmALIGNMENT_BEGINNING,
1393 XtAddCallback( CA_FiletypesEdit, XmNactivateCallback,
1394 (XtCallbackProc) activateCB_edit_filetype,
1397 /*********************************************************************/
1399 /* Filetypes Listbox Area */
1401 /*********************************************************************/
1402 /* Creation of CA_FiletypesWindow */
1403 CA_FiletypesWindow = XtVaCreateManagedWidget( "CA_FiletypesWindow",
1404 xmScrolledWindowWidgetClass,
1408 XmNshadowThickness, 2,
1410 XmNleftAttachment, XmATTACH_FORM,
1412 XmNtopWidget, CA_FiletypesLabel,
1413 XmNtopAttachment, XmATTACH_WIDGET,
1415 XmNbottomWidget, rowColumn1,
1416 XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET,
1418 XmNrightWidget, rowColumn1,
1419 XmNrightAttachment, XmATTACH_WIDGET,
1422 /* Creation of CA_FiletypesList */
1423 CA_FiletypesList = XtVaCreateManagedWidget( "CA_FiletypesList",
1426 XmNselectionPolicy, XmSINGLE_SELECT,
1427 XmNshadowThickness, 0,
1430 /*********************************************************************/
1432 /* Droppable Filetypes Toggle Area */
1434 /*********************************************************************/
1435 /* Creation of CA_DroppableFiletypesLabel */
1436 CA_DroppableFiletypesLabel = XtVaCreateManagedWidget( "CA_DroppableFiletypesLabel",
1441 XmNalignment, XmALIGNMENT_BEGINNING,
1442 RES_CONVERT( XmNlabelString, GETMESSAGE(4, 16, "Dropable Datatypes:")),
1444 XmNleftAttachment, XmATTACH_FORM,
1446 XmNtopWidget, rowColumn1,
1447 XmNtopAttachment, XmATTACH_WIDGET,
1451 /* Creation of CA_DroppableFiletypesRowColumn */
1452 CA_DroppableFiletypesRowColumn = XtVaCreateManagedWidget( "CA_DroppableFiletypesRowColumn",
1453 xmRowColumnWidgetClass,
1457 RES_CONVERT( XmNlabelString, "" ),
1458 XmNorientation, XmHORIZONTAL,
1459 XmNpacking, XmPACK_TIGHT,
1460 XmNradioBehavior, TRUE,
1462 XmNnavigationType, XmTAB_GROUP,
1464 XmNtopWidget, CA_DroppableFiletypesLabel,
1465 XmNtopAttachment, XmATTACH_WIDGET,
1467 XmNbottomAttachment, XmATTACH_FORM,
1469 XmNleftAttachment, XmATTACH_FORM,
1471 XmNrightAttachment, XmATTACH_FORM,
1474 /* Creation of CA_DroppableFiletypesRowColumn */
1475 CA_DroppableFiletypesRowColumn = XtVaCreateManagedWidget( "CA_DroppableFiletypesRowColumn",
1476 xmRowColumnWidgetClass,
1478 RES_CONVERT( XmNlabelString, "" ),
1479 XmNorientation, XmHORIZONTAL,
1480 XmNpacking, XmPACK_TIGHT,
1481 XmNradioBehavior, TRUE,
1483 XmNnavigationType, XmTAB_GROUP,
1485 XmNtopWidget, CA_DroppableFiletypesLabel,
1486 XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET,
1488 XmNbottomAttachment, XmATTACH_FORM,
1490 XmNleftWidget, CA_DroppableFiletypesLabel,
1491 XmNleftAttachment, XmATTACH_WIDGET,
1493 XmNrightAttachment, XmATTACH_FORM,
1497 /* Creation of CA_AllFiletypesToggle */
1498 CA_AllFiletypesToggle = XtVaCreateManagedWidget( "CA_AllFiletypesToggle",
1499 xmToggleButtonWidgetClass,
1500 CA_DroppableFiletypesRowColumn,
1501 RES_CONVERT( XmNlabelString, GETMESSAGE(4, 17, "All Datatypes")),
1505 /* Creation of CA_FiletypesInListToggle */
1506 CA_FiletypesInListToggle = XtVaCreateManagedWidget( "CA_FiletypesInListToggle",
1507 xmToggleButtonWidgetClass,
1508 CA_DroppableFiletypesRowColumn,
1509 RES_CONVERT( XmNlabelString, GETMESSAGE(4, 18, "Only Above List")),
1511 XtAddCallback( CA_FiletypesInListToggle, XmNvalueChangedCallback,
1512 (XtCallbackProc) valueChangedCB_DroppableFiletypes,
1513 (XtPointer) CA_DF_ONLYFTFILES );
1516 /*********************************************************************/
1520 /*********************************************************************/
1521 CA_Expand = XtVaCreateManagedWidget( "CA_Expand",
1522 xmPushButtonWidgetClass,
1524 RES_CONVERT( XmNlabelString, GETMESSAGE(3, 50, "Advanced")),
1525 XmNmultiClick, XmMULTICLICK_DISCARD,
1526 XmNnavigationType, XmTAB_GROUP,
1530 XmNleftAttachment, XmATTACH_FORM,
1531 XmNbottomOffset, 20,
1532 XmNbottomWidget, XprtOptionForm,
1533 XmNbottomAttachment, XmATTACH_WIDGET,
1535 XtAddCallback( CA_Expand, XmNactivateCallback,
1536 (XtCallbackProc) activateCB_ExpertOption,
1539 /*********************************************************************/
1541 /* Start of WindowType Option Menu */
1543 /*********************************************************************/
1544 CA_WindowType_OptionMenuShell = XtVaCreatePopupShell ("CA_WindowType_OptionMenuShell",
1545 xmMenuShellWidgetClass,
1549 XmNallowShellResize, TRUE,
1550 XmNoverrideRedirect, TRUE,
1553 CA_WindowType_Pane = XtVaCreateWidget( "CA_WindowType_Pane",
1554 xmRowColumnWidgetClass,
1556 CA_WindowType_OptionMenuShell,
1557 XmNrowColumnType, XmMENU_PULLDOWN,
1560 CA_WinTypeX = XtVaCreateManagedWidget( "CA_WinTypeX",
1561 xmPushButtonWidgetClass,
1563 RES_CONVERT( XmNlabelString, GETMESSAGE(3, 34, "Graphical (X-Window)")),
1565 XtAddCallback( CA_WinTypeX, XmNactivateCallback,
1566 (XtCallbackProc) activateCB_WindowTypeOptionMenu,
1567 (XtPointer) CA_WT_XWINDOWS );
1569 CA_WinTypeAutoClose = XtVaCreateManagedWidget( "CA_WinTypeAutoClose",
1570 xmPushButtonWidgetClass,
1572 RES_CONVERT( XmNlabelString, GETMESSAGE(3, 36, "Terminal (Auto-Close)")),
1574 XtAddCallback( CA_WinTypeAutoClose, XmNactivateCallback,
1575 (XtCallbackProc) activateCB_WindowTypeOptionMenu,
1576 (XtPointer) CA_WT_TERM );
1578 CA_WinTypeManualClose = XtVaCreateManagedWidget( "CA_WinTypeManualClose",
1579 xmPushButtonWidgetClass,
1581 RES_CONVERT( XmNlabelString, GETMESSAGE(3, 38, "Terminal (Manual Close)")),
1583 XtAddCallback( CA_WinTypeManualClose, XmNactivateCallback,
1584 (XtCallbackProc) activateCB_WindowTypeOptionMenu,
1585 (XtPointer) CA_WT_PERMTERM );
1587 CA_WinTypeNoOutput = XtVaCreateManagedWidget( "CA_WinTypeNoOutput",
1588 xmPushButtonWidgetClass,
1590 RES_CONVERT( XmNlabelString, GETMESSAGE(3, 40, "No Output")),
1592 XtAddCallback( CA_WinTypeNoOutput, XmNactivateCallback,
1593 (XtCallbackProc) activateCB_WindowTypeOptionMenu,
1594 (XtPointer) CA_WT_XWINDOWS );
1596 CA_WindowType_OptionMenu = XtVaCreateManagedWidget( "CA_WindowType_OptionMenu",
1597 xmRowColumnWidgetClass,
1599 XmNrowColumnType, XmMENU_OPTION,
1600 XmNsubMenuId, CA_WindowType_Pane,
1601 RES_CONVERT( XmNlabelString, GETMESSAGE(3, 32, "Window Type: ")),
1602 XmNnavigationType, XmTAB_GROUP,
1604 XmNleftAttachment, XmATTACH_FORM,
1606 XmNrightAttachment, XmATTACH_FORM,
1607 XmNbottomOffset, 15,
1608 XmNbottomWidget, CA_Expand,
1609 XmNbottomAttachment, XmATTACH_WIDGET,
1611 CA_WindowTypeArea = CA_WindowType_OptionMenu;
1613 /*********************************************************************/
1615 /* Help Text Window */
1617 /*********************************************************************/
1618 /* Creation of CA_HelpTextWindow */
1619 CA_HelpTextWindow = XtVaCreateManagedWidget( "CA_HelpTextWindow",
1620 xmScrolledWindowWidgetClass,
1624 XmNshadowThickness, 0,
1626 XmNtopWidget, CA_HlpTxtLabel,
1627 XmNtopAttachment, XmATTACH_WIDGET,
1629 XmNleftAttachment, XmATTACH_FORM,
1631 XmNrightAttachment, XmATTACH_FORM,
1632 XmNbottomOffset, 15,
1633 XmNbottomWidget, CA_WindowTypeArea,
1634 XmNbottomAttachment, XmATTACH_WIDGET,
1637 /* Creation of CA_HelpText */
1638 CA_HelpText = XtVaCreateManagedWidget( "CA_HelpText",
1641 XmNeditMode, XmMULTI_LINE_EDIT ,
1642 XmNscrollVertical, TRUE,
1643 XmNscrollHorizontal, FALSE,
1650 /*********************************************************************/
1654 /*********************************************************************/
1655 XtVaSetValues(CA_MenuBar,
1656 XmNmenuHelpWidget, CA_MB_HelpTop,
1659 XtAddCallback( CreateActionAppShell, XmNdestroyCallback,
1660 (XtCallbackProc) UxDestroyContextCB,
1663 XmMainWindowSetAreas( CreateActionMainWindow, CA_MenuBar, (Widget) NULL,
1664 (Widget) NULL, (Widget) NULL, CA_Form );
1666 return ( CreateActionAppShell );
1669 /*******************************************************************************
1670 The following is the 'Interface function' which is the
1671 external entry point for creating this interface.
1672 This function should be called from your application or from
1673 a callback function.
1674 *******************************************************************************/
1676 Widget create_applicationShell1(swidget _UxUxParent)
1679 _UxCCreateActionAppShell *UxContext;
1680 Dimension dimHeight;
1685 UxCreateActionAppShellContext = UxContext =
1686 (_UxCCreateActionAppShell *) UxNewContext( sizeof(_UxCCreateActionAppShell), False );
1688 UxParent = _UxUxParent;
1690 rtrn = _Uxbuild_CreateActionAppShell();
1692 /******************************************************************/
1693 /* Need to realize app shell widget now, because we need to */
1694 /* determine initial geometry before the advanced area is */
1695 /* unmanaged in set_ca_dialog_height routine. */
1696 /******************************************************************/
1697 XtSetMappedWhenManaged(rtrn, False);
1698 XtRealizeWidget(rtrn);
1699 XmProcessTraversal(CA_ActionNameTextField, XmTRAVERSE_CURRENT);
1701 FileTypes = (Widget)CA_FiletypesList;
1703 set_ca_dialog_height ();
1705 if (sessiondata.useSession) {
1706 XtVaSetValues (CreateActionAppShell,
1707 XmNx, sessiondata.x,
1708 XmNy, sessiondata.y,
1709 XmNwidth, sessiondata.width,
1710 XmNheight, sessiondata.height,
1711 XmNinitialState, sessiondata.iconicState,
1714 /* display in workspace */
1716 if (sessiondata.workspaces[0])
1718 char *workspaces = sessiondata.workspaces;
1720 Atom * workspace_atoms = NULL;
1721 int num_workspaces = 0;
1724 ptr = strchr (workspaces, '*');
1725 if (ptr != NULL) *ptr = '\0';
1727 workspace_atoms = (Atom *) XtRealloc (
1728 (char *)workspace_atoms,
1729 sizeof (Atom) * (num_workspaces + 1));
1730 workspace_atoms[num_workspaces] = XmInternAtom(
1731 XtDisplay(CreateActionAppShell),
1738 workspaces = ptr + 1;
1740 } while (ptr != NULL);
1741 DtWsmSetWorkspacesOccupied( XtDisplay(CreateActionAppShell),
1742 XtWindow(CreateActionAppShell),
1745 XtFree ((char *) workspace_atoms);
1746 workspace_atoms = NULL;
1750 XtVaGetValues (CA_Form,
1751 XmNheight, &dimHeight,
1752 XmNwidth, &dimWidth,
1754 XtVaGetValues (CreateActionMainWindow,
1755 XmNverticalScrollBar, &widTmp,
1757 XtVaGetValues (widTmp,
1760 dimHeight += dimTmp;
1763 XtVaGetValues (CA_MenuBar,
1766 dimHeight += dimTmp;
1768 XtVaSetValues (CreateActionAppShell,
1769 XmNheight, dimHeight,
1774 XtSetMappedWhenManaged(rtrn, True);
1775 XtManageChild(rtrn);
1780 /*******************************************************************************
1782 *******************************************************************************/