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>
59 #include <Dt/Action.h>
66 #include "Confirmed.h"
68 #define CONTEXT_MACRO_ACCESS 1
69 #include "CreateActionAppShell.h"
70 #undef CONTEXT_MACRO_ACCESS
72 /*******************************************************************************
73 Includes, Defines, and Global variables from the Declarations Editor:
74 *******************************************************************************/
76 Dimension winheight, xprtheight, newheight, wintypeheight;
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);
91 static char * GetDefinitionFileName( char *pszName)
94 char *defname = (char *)NULL;
96 char *msgPtr, *errPtr;
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);
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);
122 static void CreateFiles(void)
124 Boolean bHaveError = False;
127 char *msgPtr1, *msgPtr2, *fmtPtr, *bufPtr;
128 #ifdef UNDO_CMVC_3571
132 /******************************************************************/
133 /* Create Definition file name. */
134 /******************************************************************/
135 pszDefName = GetDefinitionFileName(AD.pszName);
140 /******************************************************************/
141 /* Create Definition file. */
142 /******************************************************************/
143 if ( !bHaveError && ((usRc = WriteDefinitionFile(pszDefName, &AD)) != 0) ) {
147 /******************************************************************/
148 /* Create Action file. */
149 /******************************************************************/
150 if ( !bHaveError && ((usRc = WriteActionFile(&AD)) != 0) ) {
154 /******************************************************************/
155 /* Copy icon files to home directory ~/.dt/icons */
156 /******************************************************************/
157 if ( !bHaveError && ((usRc = CopyIconFiles(&AD)) != 0) ) {
161 /*******************************************************************/
162 /* Reload action database and pop up confirmation message if */
163 /* operation was successful. */
164 /*******************************************************************/
166 _DtTurnOnHourGlass(CreateActionAppShell);
168 DtInitialize(UxDisplay, UxTopLevel, pszExecName, pszExecName);
172 DtActionInvoke(UxTopLevel, "ReloadActions",
173 NULL, 0, NULL, NULL, NULL, 0, NULL, NULL);
175 _DtTurnOffHourGlass(CreateActionAppShell);
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";
185 fmtPtr = "%s\n\n %s\n\n%s";
188 bufPtr = XtMalloc((strlen(msgPtr1) + strlen(msgPtr2) +
190 #ifdef UNDO_CMVC_3571
191 strlen(msgPtr3) + strlen(pszFile) +
193 strlen(fmtPtr) + 1) * sizeof(char));
195 sprintf(bufPtr, fmtPtr, msgPtr1, AD.pszName, msgPtr2
196 #ifdef UNDO_CMVC_3571
201 display_confirmed_message(CreateActionAppShell, bufPtr);
204 #ifdef UNDO_CMVC_3571
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 */
216 /*******************************************************************/
217 FreeAndClearAD(pMyCopyAD);
218 XtFree((char *) pMyCopyAD);
219 pMyCopyAD = copyAD(&AD);
224 static void questionCB_ReplaceFile(Widget UxWidget,
225 XtPointer UxClientData,
226 XtPointer UxCallbackArg)
229 XtDestroyWidget(XtParent(UxWidget));
232 static void questionCB_CancelSave(Widget UxWidget,
233 XtPointer UxClientData,
234 XtPointer UxCallbackArg)
236 XtDestroyWidget(XtParent(UxWidget));
240 void activateCB_CA_MB_FileSave(Widget UxWidget,
241 XtPointer UxClientData,
242 XtPointer UxCallbackArg)
247 char *msgPtr, *bufPtr;
248 Boolean bHaveError = FALSE;
253 /*********************************************************************/
254 /* Check that required fields are filled in for main window. */
255 /*********************************************************************/
256 if (!CreateActionAppShellCheckFields()) {
258 /*******************************************************************/
259 /* Query fields from main window and save into structure. */
260 /*******************************************************************/
263 /*******************************************************************/
264 /* Write the files. */
265 /*******************************************************************/
266 #ifdef UNDO_CMVC_4662
268 strcpy(pszFile, pszFileToEdit);
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);
281 sprintf(pszActionFile, "%s/%s", pszEnvVar, newName);
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);
293 /****************************************************************/
294 /* Check if action file exists and flag a warning if it does. */
295 /****************************************************************/
296 if ( (!bHaveError) &&
298 (!stat(pszActionFile, &statbuf)) ) {
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) *
308 sprintf(bufPtr, msgPtr, newName);
310 /* INTERNATIONALIZE */
311 display_question_message(CreateActionAppShell, bufPtr,
312 "Replace", questionCB_ReplaceFile,
313 "Cancel Save", questionCB_CancelSave,
314 (char *)NULL, (XtCallbackProc)NULL);
316 XtFree(pszActionFile);
320 /****************************************************************/
321 /* Now we are done with the newName variable and can free. */
322 /****************************************************************/
325 #ifdef UNDO_CMVC_4662
336 static void activateCB_CA_FiletypesDelete( Widget UxWidget,
337 XtPointer UxClientData,
338 XtPointer UxCallbackArg)
340 int *poslist, poscnt;
343 FiletypeData **papArray;
347 char *msgPtr1, *msgPtr2, *fmtPtr, *errPtr;
350 /**************************************************************************/
351 /* Determine the filetypes to delete and delete them. */
352 /**************************************************************************/
353 XtVaGetValues(FileTypes, XmNitems, &items, NULL);
354 if (XmListGetSelectedPos(FileTypes, &poslist, &poscnt)) {
358 /*********************************************************************/
359 /* Delete the filetype name from the listbox. */
360 /*********************************************************************/
361 XmListDeleteItem(FileTypes, items[*p -1]);
365 /***********************************************************************/
366 /* Remove the filetypes from the filetype array in the ActionData */
368 /***********************************************************************/
369 if ((AD.cFiletypes - poscnt) > 0) {
370 if ( papArray = (FiletypeData **) XtMalloc(sizeof(FiletypeData *) * (AD.cFiletypes - poscnt)) ) {
372 for (i = 0; i < AD.cFiletypes; i++) {
374 for (k = 0; k < poscnt; k++) {
375 if ((i + 1) == poslist[k]) {
380 /**************************************************************/
381 /* If did not find this element in the delete list, then add */
382 /* it back to our good list. */
383 /* Else do not include in the good list and free its memory. */
384 /**************************************************************/
386 papArray[cnt] = AD.papFiletypes[i];
389 free_Filetypedata(AD.papFiletypes[i]);
392 if (AD.papFiletypes) {
393 XtFree((XtPointer)AD.papFiletypes);
395 AD.papFiletypes = papArray;
399 /********************************************************************/
400 /* Delete the entire array. */
401 /********************************************************************/
402 for (i = 0; i < AD.cFiletypes; i++) {
403 free_Filetypedata(AD.papFiletypes[i]);
405 AD.papFiletypes = (FiletypeData **)NULL;
409 msgPtr1 = XtNewString(GETMESSAGE(5, 120,
410 "You have not selected a Datatype from the\n\
411 'Datatypes That Use This Action' list."));
412 msgPtr2 = XtNewString(GETMESSAGE(5, 125,
413 "Please select the Datatype you would like to Delete."));
415 len = (strlen(msgPtr1) + strlen(msgPtr2) + strlen(fmtPtr) + 2);
416 errPtr = XtMalloc(len);
417 snprintf(errPtr,len - 1, fmtPtr, msgPtr1, msgPtr2);
420 display_error_message(CreateActionAppShell, errPtr);
426 /*****************************************************************************/
428 /* valueChangedCB_CA_WinType */
430 /*****************************************************************************/
431 static void valueChangedCB_CA_WinType( Widget UxWidget,
432 XtPointer UxClientData,
433 XtPointer UxCallbackArg)
437 bSetToggle = ((XmToggleButtonCallbackStruct *)UxCallbackArg)->set;
439 printf("Wintype change before %X\n", AD.fsFlags);
441 switch ((int)UxClientData) {
442 case CA_WT_XWINDOWS :
443 if (bSetToggle) AD.fsFlags |= CA_WT_XWINDOWS;
444 else AD.fsFlags &= (~(CA_WT_XWINDOWS));
447 if (bSetToggle) AD.fsFlags |= CA_WT_TERM;
448 else AD.fsFlags &= (~(CA_WT_TERM));
450 case CA_WT_PERMTERM :
451 if (bSetToggle) AD.fsFlags |= CA_WT_PERMTERM;
452 else AD.fsFlags &= (~(CA_WT_PERMTERM));
456 printf("Wintype change after %X\n", AD.fsFlags);
461 /*****************************************************************************/
463 /* valueChangedCB_DroppableFiletypes */
465 /*****************************************************************************/
466 static void valueChangedCB_DroppableFiletypes( Widget UxWidget,
467 XtPointer UxClientData,
468 XtPointer UxCallbackArg)
470 if (((XmToggleButtonCallbackStruct *)UxCallbackArg)->set) {
471 AD.fsFlags |= CA_DF_ONLYFTFILES;
473 AD.fsFlags &= (~(CA_DF_ONLYFTFILES));
477 /*****************************************************************************/
479 /* simpleCB_WindowTypeOptionMenu */
481 /*****************************************************************************/
482 static void activateCB_WindowTypeOptionMenu( Widget UxWidget,
483 XtPointer UxClientData,
484 XtPointer UxCallbackArg)
486 AD.fsFlags &= (~(CA_WT_XWINDOWS | CA_WT_TERM | CA_WT_PERMTERM));
487 switch ((int)UxClientData) {
488 case CA_WT_XWINDOWS :
489 AD.fsFlags |= CA_WT_XWINDOWS;
492 AD.fsFlags |= CA_WT_TERM;
494 case CA_WT_PERMTERM :
495 AD.fsFlags |= CA_WT_PERMTERM;
500 /*******************************************************************************
501 The 'build_' function creates all the widgets
502 using the resource values specified in the Property Editor.
503 *******************************************************************************/
505 static Widget _Uxbuild_CreateActionAppShell(void)
508 Widget CA_MB_FileOption_shell;
509 Widget CA_MB_HelpOption_shell;
510 Widget CA_MB_Help_Sep1;
511 Widget CA_MB_Help_Sep2;
512 Widget CA_MB_OptionsOption_shell;
515 Widget CA_WindowType_OptionMenuShell;
516 Widget CA_WindowType_Pane;
517 Widget CA_WindowType_OptionMenu;
519 Dimension dim1, dim2;
520 Widget CA_MED_IconForm, CA_TINY_IconForm, CA_LRG_IconForm;
523 XmString emptyString;
524 char titleBuf[MAXBUFSIZE];
526 #define ICON_MIN_HEIGHT 83
527 #define FINDEDIT_SPACING 6
528 #define BORDER_OFFSET 3
530 /* Creation of CreateActionAppShell */
531 _UxParent = UxParent;
532 if ( _UxParent == NULL )
534 _UxParent = UxTopLevel;
537 strcpy(titleBuf, GETMESSAGE(3, 10, "Create Action"));
538 CreateActionAppShell = XtVaCreatePopupShell( "CreateActionAppShell",
539 applicationShellWidgetClass,
547 XmNiconName, titleBuf,
549 XmNallowShellResize, TRUE,
551 XmNdeleteResponse, XmDO_NOTHING, /* CDExc19440 */
554 /* CDExc19440 - make sure user doesn't accidentally lose work. */
555 XmAddWMProtocolCallback(CreateActionAppShell,
556 XmInternAtom(UxDisplay,
563 /* Creation of CreateActionMainWindow */
564 CreateActionMainWindow = XtVaCreateManagedWidget( "CreateActionMainWindow",
565 xmMainWindowWidgetClass,
566 CreateActionAppShell,
567 XmNunitType, XmPIXELS,
570 XmNscrollingPolicy, XmAUTOMATIC,
573 /* Creation of CreateActionMainWindow */
574 CreateActionMainWindow = XtVaCreateManagedWidget( "CreateActionMainWindow",
575 xmMainWindowWidgetClass,
576 CreateActionAppShell,
577 XmNunitType, XmPIXELS,
582 XtAddCallback( CreateActionMainWindow, XmNhelpCallback,
583 (XtCallbackProc) helpCB_general,
584 (XtPointer) HELP_ONITEM );
586 /*********************************************************************/
590 /*********************************************************************/
591 /* Creation of CA_MenuBar */
592 CA_MenuBar = XtVaCreateManagedWidget( "CA_MenuBar",
593 xmRowColumnWidgetClass,
594 CreateActionMainWindow,
595 XmNrowColumnType, XmMENU_BAR,
596 XmNmenuAccelerator, "<KeyUp>F10",
597 XmNpacking, XmPACK_TIGHT,
598 XmNentryAlignment, XmALIGNMENT_BEGINNING,
599 XmNorientation, XmHORIZONTAL,
602 /* Creation of CA_MB_FileOption */
603 CA_MB_FileOption_shell = XtVaCreatePopupShell ("CA_MB_FileOption_shell",
604 xmMenuShellWidgetClass, CA_MenuBar,
607 XmNallowShellResize, TRUE,
608 XmNoverrideRedirect, TRUE,
611 CA_MB_FileOption = XtVaCreateWidget( "CA_MB_FileOption",
612 xmRowColumnWidgetClass,
613 CA_MB_FileOption_shell,
614 XmNrowColumnType, XmMENU_PULLDOWN,
617 /* Creation of CA_MB_FileNew */
619 mnemonic = GETMESSAGE(2, 21, "N");
621 strcpy(mnemonic, GETMESSAGE(2, 21, "N"));
622 CA_MB_FileNew = XtVaCreateManagedWidget( "CA_MB_FileNew",
623 xmPushButtonWidgetClass,
625 RES_CONVERT( XmNlabelString, GETMESSAGE(2, 20, "New")),
626 XmNmnemonic, mnemonic[0],
628 XtAddCallback( CA_MB_FileNew, XmNactivateCallback,
629 (XtCallbackProc) activateCB_FileNew,
632 /* Creation of CA_MB_FileOpen */
634 mnemonic = GETMESSAGE(2, 16, "O");
636 strcpy(mnemonic, GETMESSAGE(2, 16, "O"));
637 CA_MB_FileOpen = XtVaCreateManagedWidget( "CA_MB_FileOpen",
638 xmPushButtonWidgetClass,
640 RES_CONVERT( XmNlabelString, GETMESSAGE(2, 15, "Open...")),
641 XmNmnemonic, mnemonic[0],
643 XtAddCallback( CA_MB_FileOpen, XmNactivateCallback,
644 (XtCallbackProc) activateCB_FileOpen,
647 /* Creation of CA_MB_FileSave */
649 mnemonic = GETMESSAGE(2, 26, "S");
651 strcpy(mnemonic, GETMESSAGE(2, 26, "S"));
652 CA_MB_FileSave = XtVaCreateManagedWidget( "CA_MB_FileSave",
653 xmPushButtonWidgetClass,
655 RES_CONVERT( XmNlabelString, GETMESSAGE(2, 25, "Save")),
656 XmNmnemonic, mnemonic[0],
658 XtAddCallback( CA_MB_FileSave, XmNactivateCallback,
659 (XtCallbackProc) activateCB_CA_MB_FileSave,
662 /* Creation of CA_MB_Sep */
663 CA_MB_Sep = XtVaCreateManagedWidget( "CA_MB_Sep",
664 xmSeparatorWidgetClass,
668 /* Creation of CA_MB_FileExit */
670 mnemonic = GETMESSAGE(2, 31, "x");
672 strcpy(mnemonic, GETMESSAGE(2, 31, "x"));
673 CA_MB_FileExit = XtVaCreateManagedWidget( "CA_MB_FileExit",
674 xmPushButtonWidgetClass,
676 RES_CONVERT( XmNlabelString, GETMESSAGE(2, 30, "Exit")),
677 XmNmnemonic, mnemonic[0],
679 XtAddCallback( CA_MB_FileExit, XmNactivateCallback,
680 (XtCallbackProc) activateCB_FileQuit,
683 /* Creation of CA_MB_FileTop */
685 mnemonic = GETMESSAGE(2, 11, "F");
687 strcpy(mnemonic, GETMESSAGE(2, 11, "F"));
688 CA_MB_FileTop = XtVaCreateManagedWidget( "CA_MB_FileTop",
689 xmCascadeButtonWidgetClass,
691 RES_CONVERT( XmNlabelString, GETMESSAGE(2, 10, "File")),
692 XmNmnemonic, mnemonic[0],
693 XmNsubMenuId, CA_MB_FileOption,
696 /* Creation of CA_MB_HelpOption */
697 CA_MB_HelpOption_shell = XtVaCreatePopupShell ("CA_MB_HelpOption_shell",
698 xmMenuShellWidgetClass, CA_MenuBar,
701 XmNallowShellResize, TRUE,
702 XmNoverrideRedirect, TRUE,
705 CA_MB_HelpOption = XtVaCreateWidget( "CA_MB_HelpOption",
706 xmRowColumnWidgetClass,
707 CA_MB_HelpOption_shell,
708 XmNrowColumnType, XmMENU_PULLDOWN,
712 * Creation of CA_MB_HelpOverview
714 strcpy(mnemonic, GETMESSAGE(2, 61, "v"));
715 CA_MB_HelpOverview = XtVaCreateManagedWidget( "CA_MB_HelpOverview",
716 xmPushButtonWidgetClass,
718 RES_CONVERT( XmNlabelString, GETMESSAGE(2, 60, "Overview")),
719 XmNmnemonic, mnemonic[0],
720 XmNuserData, CreateActionAppShell,
722 XtAddCallback( CA_MB_HelpOverview, XmNactivateCallback,
723 (XtCallbackProc) helpCB_general,
724 (XtPointer) HELP_OVERVIEW );
727 * Creation of CA_MB_HelpTasks
729 strcpy(mnemonic, GETMESSAGE(2, 71, "T"));
730 CA_MB_HelpTasks = XtVaCreateManagedWidget( "CA_MB_HelpTasks",
731 xmPushButtonWidgetClass,
733 RES_CONVERT( XmNlabelString, GETMESSAGE(2, 70, "Tasks")),
734 XmNmnemonic, mnemonic[0],
735 XmNuserData, CreateActionAppShell,
737 XtAddCallback( CA_MB_HelpTasks, XmNactivateCallback,
738 (XtCallbackProc) helpCB_general,
739 (XtPointer) HELP_TASKS );
742 /* Creation of CA_MB_HelpTOC */
744 mnemonic = GETMESSAGE(2, 66, "T");
746 strcpy(mnemonic, GETMESSAGE(2, 66, "T"));
747 CA_MB_HelpTOC = XtVaCreateManagedWidget( "CA_MB_HelpTOC",
748 xmPushButtonWidgetClass,
750 RES_CONVERT( XmNlabelString, GETMESSAGE(2, 65, "Table Of Contents...")),
751 XmNmnemonic, mnemonic[0],
752 XmNuserData, CreateActionAppShell,
756 * Creation of CA_MB_HelpReference
758 strcpy(mnemonic, GETMESSAGE(2, 76, "R"));
759 CA_MB_HelpReference = XtVaCreateManagedWidget( "CA_MB_HelpReference",
760 xmPushButtonWidgetClass,
762 RES_CONVERT( XmNlabelString, GETMESSAGE(2, 75, "Reference")),
763 XmNmnemonic, mnemonic[0],
764 XmNuserData, CreateActionAppShell,
766 XtAddCallback( CA_MB_HelpReference, XmNactivateCallback,
767 (XtCallbackProc) helpCB_general,
768 (XtPointer) HELP_REFERENCE );
771 * Creation of CA_MB_Help_Sep1
773 CA_MB_Help_Sep1 = XtVaCreateManagedWidget( "CA_MB_Help_Sep1",
774 xmSeparatorWidgetClass,
779 * Creation of CA_MB_HelpUsing
781 strcpy(mnemonic, GETMESSAGE(2, 81, "U"));
782 CA_MB_HelpUsing = XtVaCreateManagedWidget( "CA_MB_HelpUsing",
783 xmPushButtonWidgetClass,
785 RES_CONVERT( XmNlabelString, GETMESSAGE(2, 80, "Using Help")),
786 XmNmnemonic, mnemonic[0],
787 XmNuserData, CreateActionAppShell,
789 XtAddCallback( CA_MB_HelpUsing, XmNactivateCallback,
790 (XtCallbackProc) helpCB_general,
791 (XtPointer) HELP_USING );
794 * Creation of CA_MB_Help_Sep2
796 CA_MB_Help_Sep2 = XtVaCreateManagedWidget( "CA_MB_Help_Sep2",
797 xmSeparatorWidgetClass,
802 * Creation of CA_MB_HelpAbout
804 strcpy(mnemonic, GETMESSAGE(2, 86, "A"));
805 CA_MB_HelpAbout = XtVaCreateManagedWidget( "CA_MB_HelpAbout",
806 xmPushButtonWidgetClass,
808 RES_CONVERT( XmNlabelString, GETMESSAGE(2, 85, "About Create Action")),
809 XmNmnemonic, mnemonic[0],
810 XmNuserData, CreateActionAppShell,
812 XtAddCallback( CA_MB_HelpAbout, XmNactivateCallback,
813 (XtCallbackProc) helpCB_general,
814 (XtPointer) HELP_ABOUT );
817 * Creation of CA_MB_HelpTop
819 strcpy(mnemonic, GETMESSAGE(2, 54, "H"));
820 CA_MB_HelpTop = XtVaCreateManagedWidget( "CA_MB_HelpTop",
821 xmCascadeButtonWidgetClass,
823 RES_CONVERT( XmNlabelString, GETMESSAGE(2, 53, "Help")),
824 XmNmnemonic, mnemonic[0],
825 XmNsubMenuId, CA_MB_HelpOption,
826 XmNuserData, CreateActionAppShell,
829 /* Creation of CA_MB_OptionsOption */
830 CA_MB_OptionsOption_shell = XtVaCreatePopupShell ("CA_MB_OptionsOption_shell",
831 xmMenuShellWidgetClass, CA_MenuBar,
834 XmNallowShellResize, TRUE,
835 XmNoverrideRedirect, TRUE,
838 CA_MB_OptionsOption = XtVaCreateWidget( "CA_MB_OptionsOption",
839 xmRowColumnWidgetClass,
840 CA_MB_OptionsOption_shell,
841 XmNrowColumnType, XmMENU_PULLDOWN,
844 /* Creation of ColorMonoOption */
845 strcpy(mnemonic, GETMESSAGE(2, 50, "M"));
846 ColorMonoOption = XtVaCreateManagedWidget( "ColorMonoOption",
847 xmToggleButtonWidgetClass,
849 RES_CONVERT( XmNlabelString, GETMESSAGE(2, 49, "Show Monochrome Icons")),
850 XmNmnemonic, mnemonic[0],
851 XmNindicatorSize, 20,
852 XmNhighlightThickness, 0,
854 XtAddCallback( ColorMonoOption, XmNvalueChangedCallback,
855 (XtCallbackProc) valueChangedCB_ColorMonoOption,
857 createCB_ColorMonoOption(ColorMonoOption);
860 /* Creation of CA_MB_OptionTop */
861 strcpy(mnemonic, GETMESSAGE(2, 36, "O"));
862 CA_MB_OptionTop = XtVaCreateManagedWidget( "CA_MB_OptionTop",
863 xmCascadeButtonWidgetClass,
865 RES_CONVERT( XmNlabelString, GETMESSAGE(2, 35, "Options")),
866 XmNmnemonic, mnemonic[0],
867 XmNsubMenuId, CA_MB_OptionsOption,
870 /* Creation of CA_Form */
871 CA_Form = XtVaCreateManagedWidget( "CA_Form",
873 CreateActionMainWindow,
875 XmNresizePolicy, XmRESIZE_ANY,
878 /*********************************************************************/
882 /*********************************************************************/
883 /* Creation of CA_ActionNameLabel */
884 CA_ActionNameLabel = XtVaCreateManagedWidget( "CA_ActionNameLabel",
889 RES_CONVERT( XmNlabelString, GETMESSAGE(3, 12, "Action Name (Icon Label):")),
890 XmNalignment, XmALIGNMENT_BEGINNING,
892 XmNleftAttachment, XmATTACH_FORM,
894 XmNtopAttachment, XmATTACH_FORM,
896 XmNrightAttachment, XmATTACH_FORM,
899 /* Creation of CA_ActionNameTextField */
900 CA_ActionNameTextField = XtVaCreateManagedWidget( "CA_ActionNameTextField",
901 xmTextFieldWidgetClass,
906 XmNtopWidget, CA_ActionNameLabel,
907 XmNtopAttachment, XmATTACH_WIDGET,
909 XmNleftAttachment, XmATTACH_FORM,
911 XmNrightAttachment, XmATTACH_FORM,
914 XtAddCallback( CA_ActionNameTextField, XmNvalueChangedCallback,
915 (XtCallbackProc) valueChangedCB_CA_ActionNameTextField,
919 /*********************************************************************/
923 /*********************************************************************/
924 /* Creation of CA_ActionIconLabel */
925 CA_ActionIconLabel = XtVaCreateManagedWidget( "CA_ActionIconLabel",
930 RES_CONVERT( XmNlabelString, GETMESSAGE(3, 13, "Action Icons:")),
931 XmNalignment, XmALIGNMENT_BEGINNING,
933 XmNleftAttachment, XmATTACH_FORM,
935 XmNtopWidget, CA_ActionNameTextField,
936 XmNtopAttachment, XmATTACH_WIDGET,
938 XmNrightAttachment, XmATTACH_FORM,
941 /* Creation of CA_ActionIconForm */
942 CA_ActionIconForm = XtVaCreateManagedWidget( "CA_ActionIconForm",
945 XmNresizePolicy, XmRESIZE_NONE,
949 XmNnavigationType, XmTAB_GROUP,
951 XmNtopWidget, CA_ActionIconLabel,
952 XmNtopAttachment, XmATTACH_WIDGET,
954 XmNleftAttachment, XmATTACH_FORM,
956 XmNrightAttachment, XmATTACH_FORM,
957 XmNshadowThickness, 3,
958 XmNshadowType, XmSHADOW_ETCHED_IN,
959 XmNautoUnmanage, FALSE,
961 XmNallowOverlap, TRUE,
963 XmNverticalSpacing, 5,
966 CA_MED_IconForm = XtVaCreateManagedWidget( "CA_MED_IconForm",
969 XmNresizePolicy, XmRESIZE_NONE,
970 XmNborderWidth, ICON_BORDER_WIDTH,
973 XmNleftAttachment, XmATTACH_POSITION,
974 XmNbottomPosition, 88,
976 XmNbottomAttachment, XmATTACH_POSITION,
979 /* Creation of CA_MED_IconGadget */
980 emptyString = XmStringCreateLocalized("");
981 pIconData = (IconData *)XtMalloc(sizeof(IconData));
982 memset(pIconData, 0, sizeof(IconData));
983 IconDataList[CA_MED] = pIconData;
984 CA_MED_IconGadget = XtVaCreateManagedWidget( "CA_MED_IconGadget",
987 XmNalignment, XmALIGNMENT_CENTER,
988 XmNuserData, pIconData,
989 XmNstring, emptyString,
990 XmNrecomputeSize, TRUE,
991 XmNleftOffset, BORDER_OFFSET,
992 XmNleftAttachment, XmATTACH_FORM,
993 XmNrightOffset, BORDER_OFFSET,
994 XmNrightAttachment, XmATTACH_FORM,
995 XmNtopOffset, BORDER_OFFSET,
996 XmNtopAttachment, XmATTACH_FORM,
997 XmNbottomOffset, BORDER_OFFSET,
998 XmNbottomAttachment, XmATTACH_FORM,
1000 XmNleftPosition, 32,
1002 XmNleftAttachment, XmATTACH_POSITION,
1003 XmNbottomPosition, 88,
1005 XmNbottomAttachment, XmATTACH_POSITION,
1008 pIconData->wid = CA_MED_IconGadget;
1009 pIconData->size = Medium_Icon;
1010 XtAddCallback( CA_MED_IconGadget, XmNcallback,
1011 (XtCallbackProc) activateCB_action_icon,
1013 createCB_IconGadget( CA_MED_IconGadget, TRUE, Medium_Icon );
1014 last_action_pushed = CA_MED_IconGadget;
1016 CA_TINY_IconForm = XtVaCreateManagedWidget( "CA_TINY_IconForm",
1019 XmNresizePolicy, XmRESIZE_NONE,
1021 XmNleftPosition, 52,
1023 XmNleftAttachment, XmATTACH_POSITION,
1024 XmNbottomPosition, 88,
1026 XmNbottomAttachment, XmATTACH_POSITION,
1029 /* Creation of CA_TINY_IconGadget */
1030 pIconData = (IconData *)XtMalloc(sizeof(IconData));
1031 memset(pIconData, 0, sizeof(IconData));
1032 IconDataList[CA_TINY] = pIconData;
1033 CA_TINY_IconGadget = XtVaCreateManagedWidget( "CA_TINY_IconGadget",
1036 XmNalignment, XmALIGNMENT_CENTER,
1037 XmNuserData, pIconData,
1038 XmNrecomputeSize, TRUE,
1039 XmNstring, emptyString,
1040 XmNleftOffset, BORDER_OFFSET,
1041 XmNleftAttachment, XmATTACH_FORM,
1042 XmNrightOffset, BORDER_OFFSET,
1043 XmNrightAttachment, XmATTACH_FORM,
1044 XmNtopOffset, BORDER_OFFSET,
1045 XmNtopAttachment, XmATTACH_FORM,
1046 XmNbottomOffset, BORDER_OFFSET,
1047 XmNbottomAttachment, XmATTACH_FORM,
1049 pIconData->wid = CA_TINY_IconGadget;
1050 pIconData->size = Tiny_Icon;
1051 XtAddCallback( CA_TINY_IconGadget, XmNcallback,
1052 (XtCallbackProc) activateCB_action_icon,
1054 createCB_IconGadget( CA_TINY_IconGadget, TRUE, Tiny_Icon );
1056 CA_LRG_IconForm = XtVaCreateManagedWidget( "CA_LRG_IconForm",
1059 XmNresizePolicy, XmRESIZE_NONE,
1061 XmNleftPosition, 11,
1063 XmNleftAttachment, XmATTACH_POSITION,
1064 XmNbottomPosition, 88,
1066 XmNbottomAttachment, XmATTACH_POSITION,
1069 /* Creation of CA_LRG_IconGadget */
1070 pIconData = (IconData *)XtMalloc(sizeof(IconData));
1071 memset(pIconData, 0, sizeof(IconData));
1072 IconDataList[CA_LRG] = pIconData;
1073 CA_LRG_IconGadget = XtVaCreateManagedWidget( "CA_LRG_IconGadget",
1076 XmNalignment, XmALIGNMENT_CENTER,
1077 XmNuserData, pIconData,
1078 XmNstring, emptyString,
1079 XmNrecomputeSize, TRUE,
1080 XmNleftOffset, BORDER_OFFSET,
1081 XmNleftAttachment, XmATTACH_FORM,
1082 XmNrightOffset, BORDER_OFFSET,
1083 XmNrightAttachment, XmATTACH_FORM,
1084 XmNtopOffset, BORDER_OFFSET,
1085 XmNtopAttachment, XmATTACH_FORM,
1086 XmNbottomOffset, BORDER_OFFSET,
1087 XmNbottomAttachment, XmATTACH_FORM,
1089 pIconData->wid = CA_LRG_IconGadget;
1090 pIconData->size = Large_Icon;
1091 XtAddCallback( CA_LRG_IconGadget, XmNcallback,
1092 (XtCallbackProc) activateCB_action_icon,
1094 createCB_IconGadget( CA_LRG_IconGadget, TRUE, Large_Icon );
1096 XmStringFree(emptyString);
1098 /* Creation of CA_EditIcon_button */
1099 CA_EditIcon_button = XtVaCreateManagedWidget( "CA_EditIcon_button",
1100 xmPushButtonGadgetClass,
1102 RES_CONVERT( XmNlabelString, GETMESSAGE(6, 20, "Edit Icon...")),
1103 XmNalignment, XmALIGNMENT_BEGINNING,
1104 XmNleftPosition, 68,
1106 XmNleftAttachment, XmATTACH_POSITION,
1108 XmNtopOffset, (int)(FINDEDIT_SPACING / 2),
1109 XmNtopAttachment, XmATTACH_POSITION,
1111 XtAddCallback( CA_EditIcon_button, XmNactivateCallback,
1112 (XtCallbackProc) activateCB_edit_icon,
1113 (XtPointer) CA_ACTION_ICONS );
1115 /* Creation of CA_FindSet_button */
1116 CA_FindSet_button = XtVaCreateManagedWidget( "CA_FindSet_button",
1117 xmPushButtonGadgetClass,
1119 RES_CONVERT( XmNlabelString, GETMESSAGE(6, 19, "Find Set...")),
1120 XmNalignment, XmALIGNMENT_BEGINNING,
1121 XmNmultiClick, XmMULTICLICK_DISCARD,
1122 XmNleftPosition, 68,
1124 XmNleftAttachment, XmATTACH_POSITION,
1125 XmNbottomPosition, 50,
1126 XmNbottomOffset, (int)(FINDEDIT_SPACING / 2),
1127 XmNbottomAttachment, XmATTACH_POSITION,
1129 XtAddCallback( CA_FindSet_button, XmNactivateCallback,
1130 (XtCallbackProc) activateCB_open_FindSet,
1131 (XtPointer) CA_ACTION_ICONS );
1133 /******************************************************************/
1134 /* Determine which button is wider, and attach the short on to it */
1135 /******************************************************************/
1136 XtVaGetValues(CA_EditIcon_button, XmNwidth, &dim1, NULL);
1137 XtVaGetValues(CA_FindSet_button, XmNwidth, &dim2, NULL);
1139 XtVaSetValues(CA_FindSet_button,
1143 XtVaSetValues(CA_EditIcon_button,
1147 /******************************************************************/
1148 /* Determine vertical positioning for findset and edit buttons */
1149 /******************************************************************/
1150 XtVaGetValues(CA_EditIcon_button, XmNheight, &dim1, NULL);
1151 XtVaGetValues(CA_FindSet_button, XmNheight, &dim2, NULL);
1152 if ((int)(dim1 + dim2) + (3*(FINDEDIT_SPACING)) > ICON_MIN_HEIGHT) {
1153 XtVaSetValues(CA_EditIcon_button,
1154 XmNbottomOffset, FINDEDIT_SPACING,
1155 XmNbottomAttachment, XmATTACH_FORM,
1157 XtVaSetValues(CA_FindSet_button,
1158 XmNbottomOffset, FINDEDIT_SPACING,
1159 XmNbottomWidget, CA_EditIcon_button,
1160 XmNbottomAttachment, XmATTACH_WIDGET,
1161 XmNtopOffset, FINDEDIT_SPACING,
1162 XmNtopAttachment, XmATTACH_FORM,
1167 /******************************************************************/
1168 /* Bogus separator to keep ActionIconForm a minimum height */
1169 /******************************************************************/
1170 separator1 = XtVaCreateManagedWidget( "separator1",
1171 xmSeparatorWidgetClass,
1176 XmNheight, ICON_MIN_HEIGHT,
1177 XmNorientation, XmVERTICAL,
1178 XmNseparatorType, XmNO_LINE,
1180 XmNtopAttachment, XmATTACH_FORM,
1182 XmNbottomAttachment, XmATTACH_FORM,
1185 /*********************************************************************/
1189 /*********************************************************************/
1190 /* Creation of CA_DblClkLabel */
1191 CA_DblClkLabel = XtVaCreateManagedWidget( "CA_DblClkLabel",
1194 RES_CONVERT( XmNlabelString, GETMESSAGE(3, 22, "Command When Action Is Opened (Double-clicked):")),
1195 XmNalignment, XmALIGNMENT_BEGINNING,
1197 XmNleftAttachment, XmATTACH_FORM,
1199 XmNtopWidget, CA_ActionIconForm,
1200 XmNtopAttachment, XmATTACH_WIDGET,
1202 XmNrightAttachment, XmATTACH_FORM,
1205 /* Creation of CA_DblClkText */
1206 CA_DblClkText = XtVaCreateManagedWidget( "CA_DblClkText",
1207 xmTextFieldWidgetClass,
1209 XmNnavigationType, XmTAB_GROUP,
1211 XmNtopWidget, CA_DblClkLabel,
1212 XmNtopAttachment, XmATTACH_WIDGET,
1214 XmNleftAttachment, XmATTACH_FORM,
1216 XmNrightAttachment, XmATTACH_FORM,
1220 /*********************************************************************/
1222 /* Help Text Label */
1224 /*********************************************************************/
1225 /* Creation of CA_HlpTxtLabel */
1226 CA_HlpTxtLabel = XtVaCreateManagedWidget( "CA_HlpTxtLabel",
1229 RES_CONVERT( XmNlabelString, GETMESSAGE(3, 30, "Help Text For Action Icon:")),
1230 XmNalignment, XmALIGNMENT_BEGINNING,
1232 XmNleftAttachment, XmATTACH_FORM,
1234 XmNtopWidget, CA_DblClkText,
1235 XmNtopAttachment, XmATTACH_WIDGET,
1237 XmNrightAttachment, XmATTACH_FORM,
1240 /*********************************************************************/
1242 /* Advanced Features Area */
1244 /*********************************************************************/
1245 /* Creation of XprtOptionForm */
1246 XprtOptionForm = XtVaCreateManagedWidget( "XprtOptionForm",
1249 XmNresizePolicy, XmRESIZE_ANY,
1251 XmNleftAttachment, XmATTACH_FORM,
1253 XmNrightAttachment, XmATTACH_FORM,
1255 XmNbottomAttachment, XmATTACH_FORM,
1258 /*********************************************************************/
1260 /* Optional Separator */
1262 /*********************************************************************/
1264 /* Creation of CA_XprtSep1 */
1265 CA_XprtSep1 = XtVaCreateManagedWidget( "CA_XprtSep1",
1266 xmSeparatorWidgetClass,
1269 XmNleftAttachment, XmATTACH_FORM,
1271 XmNrightAttachment, XmATTACH_FORM,
1273 XmNtopAttachment, XmATTACH_FORM,
1276 /*********************************************************************/
1280 /*********************************************************************/
1281 /* Creation of CA_ActionOpenLabel */
1282 CA_ActionOpenLabel = XtVaCreateManagedWidget( "CA_ActionOpenLabel",
1285 RES_CONVERT( XmNlabelString, GETMESSAGE(4, 11, "When Action Opens, Ask Users for:")),
1286 XmNalignment, XmALIGNMENT_BEGINNING,
1288 XmNleftAttachment, XmATTACH_FORM,
1290 XmNrightAttachment, XmATTACH_FORM,
1292 XmNtopWidget, CA_XprtSep1,
1293 XmNtopAttachment, XmATTACH_WIDGET,
1296 /* Creation of CA_XprtActionOpenText */
1297 CA_XprtActionOpenText = XtVaCreateManagedWidget( "CA_XprtActionOpenText",
1301 XmNnavigationType, XmTAB_GROUP,
1303 XmNleftAttachment, XmATTACH_FORM,
1305 XmNrightAttachment, XmATTACH_FORM,
1307 XmNtopWidget, CA_ActionOpenLabel,
1308 XmNtopAttachment, XmATTACH_WIDGET,
1309 /*XmNeditMode, XmMULTI_LINE_EDIT,*/
1310 /*XmNwordWrap, TRUE,*/
1313 /*********************************************************************/
1315 /* Filetypes that use this Action area */
1317 /*********************************************************************/
1318 /* Creation of CA_FiletypesLabel */
1319 CA_FiletypesLabel = XtVaCreateManagedWidget( "CA_FiletypesLabel",
1324 RES_CONVERT( XmNlabelString, GETMESSAGE(4, 12, "Datatypes That Use This Action:")),
1325 XmNalignment, XmALIGNMENT_BEGINNING,
1327 XmNleftAttachment, XmATTACH_FORM,
1329 XmNrightAttachment, XmATTACH_FORM,
1331 XmNtopWidget, CA_XprtActionOpenText,
1332 XmNtopAttachment, XmATTACH_WIDGET,
1335 /*********************************************************************/
1337 /* Add, Delete, Edit buttons for Filetypes */
1339 /*********************************************************************/
1340 /* Creation of rowColumn1 */
1341 rowColumn1 = XtVaCreateManagedWidget( "rowColumn1",
1342 xmRowColumnWidgetClass,
1344 XmNnavigationType, XmTAB_GROUP,
1346 XmNtopWidget, CA_FiletypesLabel,
1347 XmNtopAttachment, XmATTACH_WIDGET,
1349 XmNrightAttachment, XmATTACH_FORM,
1352 /* Creation of CA_FiletypesAdd */
1353 CA_FiletypesAdd = XtVaCreateManagedWidget( "CA_FiletypesAdd",
1354 xmPushButtonGadgetClass,
1356 RES_CONVERT( XmNlabelString, GETMESSAGE(4, 13, "Add...")),
1357 XmNalignment, XmALIGNMENT_BEGINNING,
1361 XtAddCallback( CA_FiletypesAdd, XmNactivateCallback,
1362 (XtCallbackProc) activateCB_add_filetype,
1365 /* Creation of CA_FiletypesDelete */
1366 CA_FiletypesDelete = XtVaCreateManagedWidget( "CA_FiletypesDelete",
1367 xmPushButtonGadgetClass,
1369 RES_CONVERT( XmNlabelString, GETMESSAGE(4, 14, "Delete")),
1370 XmNalignment, XmALIGNMENT_BEGINNING,
1374 XtAddCallback( CA_FiletypesDelete, XmNactivateCallback,
1375 (XtCallbackProc) activateCB_CA_FiletypesDelete,
1378 /* Creation of CA_FiletypesEdit */
1379 CA_FiletypesEdit = XtVaCreateManagedWidget( "CA_FiletypesEdit",
1380 xmPushButtonGadgetClass,
1382 RES_CONVERT( XmNlabelString, GETMESSAGE(4, 15, "Edit...")),
1383 XmNalignment, XmALIGNMENT_BEGINNING,
1387 XtAddCallback( CA_FiletypesEdit, XmNactivateCallback,
1388 (XtCallbackProc) activateCB_edit_filetype,
1391 /*********************************************************************/
1393 /* Filetypes Listbox Area */
1395 /*********************************************************************/
1396 /* Creation of CA_FiletypesWindow */
1397 CA_FiletypesWindow = XtVaCreateManagedWidget( "CA_FiletypesWindow",
1398 xmScrolledWindowWidgetClass,
1402 XmNshadowThickness, 2,
1404 XmNleftAttachment, XmATTACH_FORM,
1406 XmNtopWidget, CA_FiletypesLabel,
1407 XmNtopAttachment, XmATTACH_WIDGET,
1409 XmNbottomWidget, rowColumn1,
1410 XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET,
1412 XmNrightWidget, rowColumn1,
1413 XmNrightAttachment, XmATTACH_WIDGET,
1416 /* Creation of CA_FiletypesList */
1417 CA_FiletypesList = XtVaCreateManagedWidget( "CA_FiletypesList",
1420 XmNselectionPolicy, XmSINGLE_SELECT,
1421 XmNshadowThickness, 0,
1424 /*********************************************************************/
1426 /* Droppable Filetypes Toggle Area */
1428 /*********************************************************************/
1429 /* Creation of CA_DroppableFiletypesLabel */
1430 CA_DroppableFiletypesLabel = XtVaCreateManagedWidget( "CA_DroppableFiletypesLabel",
1435 XmNalignment, XmALIGNMENT_BEGINNING,
1436 RES_CONVERT( XmNlabelString, GETMESSAGE(4, 16, "Dropable Datatypes:")),
1438 XmNleftAttachment, XmATTACH_FORM,
1440 XmNtopWidget, rowColumn1,
1441 XmNtopAttachment, XmATTACH_WIDGET,
1445 /* Creation of CA_DroppableFiletypesRowColumn */
1446 CA_DroppableFiletypesRowColumn = XtVaCreateManagedWidget( "CA_DroppableFiletypesRowColumn",
1447 xmRowColumnWidgetClass,
1451 RES_CONVERT( XmNlabelString, "" ),
1452 XmNorientation, XmHORIZONTAL,
1453 XmNpacking, XmPACK_TIGHT,
1454 XmNradioBehavior, TRUE,
1456 XmNnavigationType, XmTAB_GROUP,
1458 XmNtopWidget, CA_DroppableFiletypesLabel,
1459 XmNtopAttachment, XmATTACH_WIDGET,
1461 XmNbottomAttachment, XmATTACH_FORM,
1463 XmNleftAttachment, XmATTACH_FORM,
1465 XmNrightAttachment, XmATTACH_FORM,
1468 /* Creation of CA_DroppableFiletypesRowColumn */
1469 CA_DroppableFiletypesRowColumn = XtVaCreateManagedWidget( "CA_DroppableFiletypesRowColumn",
1470 xmRowColumnWidgetClass,
1472 RES_CONVERT( XmNlabelString, "" ),
1473 XmNorientation, XmHORIZONTAL,
1474 XmNpacking, XmPACK_TIGHT,
1475 XmNradioBehavior, TRUE,
1477 XmNnavigationType, XmTAB_GROUP,
1479 XmNtopWidget, CA_DroppableFiletypesLabel,
1480 XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET,
1482 XmNbottomAttachment, XmATTACH_FORM,
1484 XmNleftWidget, CA_DroppableFiletypesLabel,
1485 XmNleftAttachment, XmATTACH_WIDGET,
1487 XmNrightAttachment, XmATTACH_FORM,
1491 /* Creation of CA_AllFiletypesToggle */
1492 CA_AllFiletypesToggle = XtVaCreateManagedWidget( "CA_AllFiletypesToggle",
1493 xmToggleButtonWidgetClass,
1494 CA_DroppableFiletypesRowColumn,
1495 RES_CONVERT( XmNlabelString, GETMESSAGE(4, 17, "All Datatypes")),
1499 /* Creation of CA_FiletypesInListToggle */
1500 CA_FiletypesInListToggle = XtVaCreateManagedWidget( "CA_FiletypesInListToggle",
1501 xmToggleButtonWidgetClass,
1502 CA_DroppableFiletypesRowColumn,
1503 RES_CONVERT( XmNlabelString, GETMESSAGE(4, 18, "Only Above List")),
1505 XtAddCallback( CA_FiletypesInListToggle, XmNvalueChangedCallback,
1506 (XtCallbackProc) valueChangedCB_DroppableFiletypes,
1507 (XtPointer) CA_DF_ONLYFTFILES );
1510 /*********************************************************************/
1514 /*********************************************************************/
1515 CA_Expand = XtVaCreateManagedWidget( "CA_Expand",
1516 xmPushButtonWidgetClass,
1518 RES_CONVERT( XmNlabelString, GETMESSAGE(3, 50, "Advanced")),
1519 XmNmultiClick, XmMULTICLICK_DISCARD,
1520 XmNnavigationType, XmTAB_GROUP,
1524 XmNleftAttachment, XmATTACH_FORM,
1525 XmNbottomOffset, 20,
1526 XmNbottomWidget, XprtOptionForm,
1527 XmNbottomAttachment, XmATTACH_WIDGET,
1529 XtAddCallback( CA_Expand, XmNactivateCallback,
1530 (XtCallbackProc) activateCB_ExpertOption,
1533 /*********************************************************************/
1535 /* Start of WindowType Option Menu */
1537 /*********************************************************************/
1538 CA_WindowType_OptionMenuShell = XtVaCreatePopupShell ("CA_WindowType_OptionMenuShell",
1539 xmMenuShellWidgetClass,
1543 XmNallowShellResize, TRUE,
1544 XmNoverrideRedirect, TRUE,
1547 CA_WindowType_Pane = XtVaCreateWidget( "CA_WindowType_Pane",
1548 xmRowColumnWidgetClass,
1550 CA_WindowType_OptionMenuShell,
1551 XmNrowColumnType, XmMENU_PULLDOWN,
1554 CA_WinTypeX = XtVaCreateManagedWidget( "CA_WinTypeX",
1555 xmPushButtonWidgetClass,
1557 RES_CONVERT( XmNlabelString, GETMESSAGE(3, 34, "Graphical (X-Window)")),
1559 XtAddCallback( CA_WinTypeX, XmNactivateCallback,
1560 (XtCallbackProc) activateCB_WindowTypeOptionMenu,
1561 (XtPointer) CA_WT_XWINDOWS );
1563 CA_WinTypeAutoClose = XtVaCreateManagedWidget( "CA_WinTypeAutoClose",
1564 xmPushButtonWidgetClass,
1566 RES_CONVERT( XmNlabelString, GETMESSAGE(3, 36, "Terminal (Auto-Close)")),
1568 XtAddCallback( CA_WinTypeAutoClose, XmNactivateCallback,
1569 (XtCallbackProc) activateCB_WindowTypeOptionMenu,
1570 (XtPointer) CA_WT_TERM );
1572 CA_WinTypeManualClose = XtVaCreateManagedWidget( "CA_WinTypeManualClose",
1573 xmPushButtonWidgetClass,
1575 RES_CONVERT( XmNlabelString, GETMESSAGE(3, 38, "Terminal (Manual Close)")),
1577 XtAddCallback( CA_WinTypeManualClose, XmNactivateCallback,
1578 (XtCallbackProc) activateCB_WindowTypeOptionMenu,
1579 (XtPointer) CA_WT_PERMTERM );
1581 CA_WinTypeNoOutput = XtVaCreateManagedWidget( "CA_WinTypeNoOutput",
1582 xmPushButtonWidgetClass,
1584 RES_CONVERT( XmNlabelString, GETMESSAGE(3, 40, "No Output")),
1586 XtAddCallback( CA_WinTypeNoOutput, XmNactivateCallback,
1587 (XtCallbackProc) activateCB_WindowTypeOptionMenu,
1588 (XtPointer) CA_WT_XWINDOWS );
1590 CA_WindowType_OptionMenu = XtVaCreateManagedWidget( "CA_WindowType_OptionMenu",
1591 xmRowColumnWidgetClass,
1593 XmNrowColumnType, XmMENU_OPTION,
1594 XmNsubMenuId, CA_WindowType_Pane,
1595 RES_CONVERT( XmNlabelString, GETMESSAGE(3, 32, "Window Type: ")),
1596 XmNnavigationType, XmTAB_GROUP,
1598 XmNleftAttachment, XmATTACH_FORM,
1600 XmNrightAttachment, XmATTACH_FORM,
1601 XmNbottomOffset, 15,
1602 XmNbottomWidget, CA_Expand,
1603 XmNbottomAttachment, XmATTACH_WIDGET,
1605 CA_WindowTypeArea = CA_WindowType_OptionMenu;
1607 /*********************************************************************/
1609 /* Help Text Window */
1611 /*********************************************************************/
1612 /* Creation of CA_HelpTextWindow */
1613 CA_HelpTextWindow = XtVaCreateManagedWidget( "CA_HelpTextWindow",
1614 xmScrolledWindowWidgetClass,
1618 XmNshadowThickness, 0,
1620 XmNtopWidget, CA_HlpTxtLabel,
1621 XmNtopAttachment, XmATTACH_WIDGET,
1623 XmNleftAttachment, XmATTACH_FORM,
1625 XmNrightAttachment, XmATTACH_FORM,
1626 XmNbottomOffset, 15,
1627 XmNbottomWidget, CA_WindowTypeArea,
1628 XmNbottomAttachment, XmATTACH_WIDGET,
1631 /* Creation of CA_HelpText */
1632 CA_HelpText = XtVaCreateManagedWidget( "CA_HelpText",
1635 XmNeditMode, XmMULTI_LINE_EDIT ,
1636 XmNscrollVertical, TRUE,
1637 XmNscrollHorizontal, FALSE,
1644 /*********************************************************************/
1648 /*********************************************************************/
1649 XtVaSetValues(CA_MenuBar,
1650 XmNmenuHelpWidget, CA_MB_HelpTop,
1653 XtAddCallback( CreateActionAppShell, XmNdestroyCallback,
1654 (XtCallbackProc) UxDestroyContextCB,
1657 XmMainWindowSetAreas( CreateActionMainWindow, CA_MenuBar, (Widget) NULL,
1658 (Widget) NULL, (Widget) NULL, CA_Form );
1660 return ( CreateActionAppShell );
1663 /*******************************************************************************
1664 The following is the 'Interface function' which is the
1665 external entry point for creating this interface.
1666 This function should be called from your application or from
1667 a callback function.
1668 *******************************************************************************/
1670 Widget create_applicationShell1(swidget _UxUxParent)
1673 _UxCCreateActionAppShell *UxContext;
1674 Dimension dimHeight;
1679 UxCreateActionAppShellContext = UxContext =
1680 (_UxCCreateActionAppShell *) UxNewContext( sizeof(_UxCCreateActionAppShell), False );
1682 UxParent = _UxUxParent;
1684 rtrn = _Uxbuild_CreateActionAppShell();
1686 /******************************************************************/
1687 /* Need to realize app shell widget now, because we need to */
1688 /* determine initial geometry before the advanced area is */
1689 /* unmanaged in set_ca_dialog_height routine. */
1690 /******************************************************************/
1691 XtSetMappedWhenManaged(rtrn, False);
1692 XtRealizeWidget(rtrn);
1693 XmProcessTraversal(CA_ActionNameTextField, XmTRAVERSE_CURRENT);
1695 FileTypes = (Widget)CA_FiletypesList;
1697 set_ca_dialog_height ();
1699 if (sessiondata.useSession) {
1700 XtVaSetValues (CreateActionAppShell,
1701 XmNx, sessiondata.x,
1702 XmNy, sessiondata.y,
1703 XmNwidth, sessiondata.width,
1704 XmNheight, sessiondata.height,
1705 XmNinitialState, sessiondata.iconicState,
1708 /* display in workspace */
1710 if (sessiondata.workspaces[0])
1712 char *workspaces = sessiondata.workspaces;
1714 Atom * workspace_atoms = NULL;
1715 int num_workspaces = 0;
1718 ptr = strchr (workspaces, '*');
1719 if (ptr != NULL) *ptr = '\0';
1721 workspace_atoms = (Atom *) XtRealloc (
1722 (char *)workspace_atoms,
1723 sizeof (Atom) * (num_workspaces + 1));
1724 workspace_atoms[num_workspaces] = XmInternAtom(
1725 XtDisplay(CreateActionAppShell),
1732 workspaces = ptr + 1;
1734 } while (ptr != NULL);
1735 DtWsmSetWorkspacesOccupied( XtDisplay(CreateActionAppShell),
1736 XtWindow(CreateActionAppShell),
1739 XtFree ((char *) workspace_atoms);
1740 workspace_atoms = NULL;
1744 XtVaGetValues (CA_Form,
1745 XmNheight, &dimHeight,
1746 XmNwidth, &dimWidth,
1748 XtVaGetValues (CreateActionMainWindow,
1749 XmNverticalScrollBar, &widTmp,
1751 XtVaGetValues (widTmp,
1754 dimHeight += dimTmp;
1757 XtVaGetValues (CA_MenuBar,
1760 dimHeight += dimTmp;
1762 XtVaSetValues (CreateActionAppShell,
1763 XmNheight, dimHeight,
1768 XtSetMappedWhenManaged(rtrn, True);
1769 XtManageChild(rtrn);
1774 /*******************************************************************************
1776 *******************************************************************************/