CreateActionAppShell.c 77 KB

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