home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / x / volume16 / pan / part03 < prev    next >
Encoding:
Text File  |  1992-03-06  |  17.7 KB  |  637 lines

  1. Newsgroups: comp.sources.x
  2. Path: uunet!think.com!mips!msi!dcmartin
  3. From: jeff@rd1.interlan.com (Jeff Bailey)
  4. Subject: v16i139: pan - Post A Note (for Open Windows), Part03/06
  5. Message-ID: <1992Mar6.200338.8230@msi.com>
  6. Originator: dcmartin@fascet
  7. Sender: dcmartin@msi.com (David C. Martin - Moderator)
  8. Organization: Molecular Simulations, Inc.
  9. References: <csx-16i137-pan@uunet.UU.NET>
  10. Date: Fri, 6 Mar 1992 20:03:38 GMT
  11. Approved: dcmartin@msi.com
  12.  
  13. Submitted-by: jeff@rd1.interlan.com (Jeff Bailey)
  14. Posting-number: Volume 16, Issue 139
  15. Archive-name: pan/part03
  16.  
  17.  
  18. ---- Cut Here and feed the following to sh ----
  19. #!/bin/sh
  20. # This is part 03 of a multipart archive
  21. # ============= note.c ==============
  22. if test -f 'note.c' -a X"$1" != X"-c"; then
  23.     echo 'x - skipping note.c (File already exists)'
  24. else
  25. echo 'x - extracting note.c (Text)'
  26. sed 's/^X//' << 'SHAR_EOF' > 'note.c' &&
  27. /*
  28. Post A Note V2.4
  29. Copyright (c) 1992, Jeffrey W. Bailey
  30. All rights reserved.
  31. X
  32. Permission is granted to distribute this program in exact, complete
  33. source form, which includes this copyright notice, as long as no fee
  34. other than media and distribution cost is charged.
  35. X
  36. This program may not be used in whole, or in part, in any other manner
  37. without prior written permission from the author.
  38. X
  39. This program may not be distributed in modified form without prior
  40. written permission from the author.  In other words, patches may be
  41. distributed, but modified source may not be distributed.
  42. X
  43. If there are any questions, comments or suggestions, the author may be
  44. contacted at:
  45. X
  46. X    jeff@rd1.interlan.com
  47. X
  48. X    or
  49. X
  50. X    Jeffrey Bailey
  51. X    Racal-Datacom, Inc.
  52. X    Mail Stop E-110
  53. X    1601 N. Harrison Parkway
  54. X    Sunrise, FL  33323-2899
  55. */
  56. X
  57. #include "pan.h"
  58. X
  59. #include <X11/X.h>
  60. #include <X11/Xutil.h>
  61. X
  62. extern char *malloc();
  63. extern char *getenv();
  64. X
  65. extern int errno;
  66. extern char *sys_errlist[];
  67. X
  68. /*
  69. X    Routine called when new note button is selected
  70. */
  71. newnote(menu, mitem)
  72. X    Menu menu;
  73. X    Menu_item mitem;
  74. X    {
  75. X    Display *dpy;
  76. X    Xv_Screen screen;
  77. X    int  screen_num;
  78. X    int  screen_height;
  79. X    int  screen_width;
  80. X    Rect rect;
  81. X    struct SubDir *sp;
  82. X    struct Note *np;
  83. X    char *text;
  84. X    FILE *fp;
  85. X    char fname[MAXBUFLEN];
  86. X
  87. X    dpy = (Display *) xv_get(main_frame, XV_DISPLAY);
  88. X    screen = (Xv_Screen) xv_get(main_frame, XV_SCREEN);
  89. X    screen_num = xv_get(screen, SCREEN_NUMBER);
  90. X    screen_height = DisplayHeight(dpy, screen_num);
  91. X    screen_width = DisplayWidth(dpy, screen_num);
  92. X    frame_get_rect(main_frame, &rect);
  93. X    rect.r_left += DEFSPACING;
  94. X    if((rect.r_left + DEFWIDTH) > (screen_width - DEFSPACING))
  95. X        rect.r_left = screen_width - DEFWIDTH - DEFSPACING;
  96. X    if((rect.r_top + rect.r_height + 2 * DEFSPACING + DEFHEIGHT) <
  97. X       screen_height)
  98. X        rect.r_top += (rect.r_height + DEFSPACING);
  99. X    else
  100. X        rect.r_top -= (DEFHEIGHT + 2 * DEFSPACING);
  101. X
  102. X    text = (char *) xv_get(mitem, MENU_STRING);
  103. X    sp = (struct SubDir *)LLM_first(&subdir_rt);
  104. X    while(sp != NULL)
  105. X        {
  106. X        if(strcmp(text, sp->subdir) == 0) break;
  107. X        sp = (struct SubDir *)LLM_next(&subdir_rt);
  108. X        }
  109. X
  110. X    if(sp == NULL)
  111. X        {
  112. X        notice_prompt(main_frame, NULL,
  113. X            NOTICE_MESSAGE_STRINGS,
  114. X                "Internal failure - couldn't find subdir entry",
  115. X                NULL,
  116. X            NOTICE_BUTTON_YES, "Acknowledge",
  117. X            NOTICE_NO_BEEPING, noticenobeep,
  118. X            NULL);
  119. X        return;
  120. X        }
  121. X
  122. X    np = (struct Note *)add_sorted(&sp->note_rt, NOTITLE);
  123. X    if(np == NULL)
  124. X        {
  125. X        notice_prompt(main_frame, NULL,
  126. X            NOTICE_MESSAGE_STRINGS,
  127. X                "Internal failure - memory allocation failure",
  128. X                NULL,
  129. X            NOTICE_BUTTON_YES, "Acknowledge",
  130. X            NOTICE_NO_BEEPING, noticenobeep,
  131. X            NULL);
  132. X        return;
  133. X        }
  134. X
  135. X    memset((char *)np, 0, sizeof(struct Note));
  136. X
  137. X    sprintf(np->basename, NOTENAM, time(NULL), notecount++);
  138. X    np->sp = sp;
  139. X    np->crttime = time(NULL);
  140. X    np->state = Visible;
  141. X    np->rect.r_top = rect.r_top;
  142. X    np->rect.r_left = rect.r_left;
  143. X    np->rect.r_width = DEFWIDTH;
  144. X    np->rect.r_height = DEFHEIGHT;
  145. X    strcpy(np->ntitle, NOTITLE);
  146. X
  147. X    /* Make the file with 0 length */
  148. X    makename(fname, np);
  149. X    fp = fopen(fname, "w");
  150. X    if(fp != NULL) fclose(fp);
  151. X
  152. X    if(!buildnote(np)) return;
  153. X    reseticon(np);
  154. X
  155. X    updateinfo(np, FORCE);
  156. X    refresh_popups();
  157. X    }
  158. X
  159. /*
  160. X    Does the grunt work of setting up internals for the frame for
  161. X    restorenotes().  Only maps visible notes.
  162. */
  163. setnote(np)
  164. X    struct Note *np;
  165. X    {
  166. X    int  rl, rt, rw, rh;
  167. X    FILE *fp;
  168. X    char fname[MAXBUFLEN];
  169. X    char att[20];
  170. X    char title[MAXTITLELEN + 1];
  171. X    char cdate[100];
  172. X
  173. X    makeinfoname(fname, np);
  174. X    np->rect.r_left = 0;
  175. X    np->rect.r_top = 0;
  176. X    np->rect.r_width = DEFWIDTH;
  177. X    np->rect.r_height = DEFHEIGHT;
  178. X    fp = fopen(fname, "r");
  179. X    if(fp != NULL)
  180. X        {
  181. X        np->state = Visible;
  182. X
  183. X        fgets(title, sizeof(title), fp);
  184. X        (void) sscanf(title, "%d %d %d %d %7s", &rl,
  185. X            &rt, &rw, &rh, att);
  186. X        np->rect.r_left = rl;
  187. X        np->rect.r_top = rt;
  188. X        np->rect.r_width = rw;
  189. X        np->rect.r_height = rh;
  190. X        *title = 0;
  191. X        fgets(title, sizeof(title), fp);
  192. X        trim(title);
  193. X        *cdate = 0;
  194. X        if(fgets(cdate, sizeof(cdate), fp) != NULL)
  195. X            np->crttime = atoi(cdate);
  196. X
  197. X
  198. X        strcpy(np->ntitle, title);
  199. X
  200. X        if(strncmp(att, "HIDDEN", 6) == 0)
  201. X            np->state = Hidden;
  202. X        if(strncmp(att, "VISIBLE", 7) == 0)
  203. X            np->state = Visible;
  204. X
  205. X        if(np->state != Hidden)
  206. X            {
  207. X            if(!buildnote(np))
  208. X                {
  209. X                (void) fclose(fp);
  210. X                return;
  211. X                }
  212. X            xv_set(np->title, PANEL_VALUE, np->ntitle, NULL);
  213. X            xv_set(np->frame, XV_LABEL, np->ntitle, NULL);
  214. X            reseticon(np);
  215. X            }
  216. X        else np->mapped = 0;
  217. X
  218. X        (void) fclose(fp);
  219. X        }
  220. X    else
  221. X        {
  222. X        notice_prompt(main_frame, NULL,
  223. X            NOTICE_MESSAGE_STRINGS,
  224. X                "Couldn't open note geometry file",
  225. X                fname,
  226. X                sys_errlist[errno],
  227. X                NULL,
  228. X            NOTICE_BUTTON_YES, "Acknowledge",
  229. X            NOTICE_NO_BEEPING, noticenobeep,
  230. X            NULL);
  231. X        if(!buildnote(np)) return;
  232. X        np->state = Visible;
  233. X        }
  234. X    }
  235. X
  236. /*
  237. X    Creates the actual Xview frame and items for a note.  Called by newnote()
  238. X    and restorenotes().
  239. */
  240. buildnote(np)
  241. X    struct Note *np;
  242. X    {
  243. X    Server_image image;
  244. X    static XClassHint chint;
  245. X    struct tm *tmptr;
  246. X    char title[MAXTITLELEN + 1];
  247. X    char fname[MAXBUFLEN];
  248. X    char buf [30];
  249. X
  250. X    strcpy(title, NOTITLE);
  251. X
  252. X    if(get_win(np))
  253. X        {
  254. X        frame_set_rect(np->frame, &np->rect);
  255. X
  256. X        if(np->crttime != 0)
  257. X            {
  258. X            tmptr = localtime(&np->crttime);
  259. X            sprintf(buf, "Created: %02d/%02d/%02d", tmptr->tm_mon + 1,
  260. X                tmptr->tm_mday, tmptr->tm_year);
  261. X            }
  262. X        else strcpy(buf, "No create time");
  263. X        xv_set(np->cdate, PANEL_LABEL_STRING, buf, NULL);
  264. X
  265. X        if(np->crttime != 0)
  266. X            {
  267. X            tmptr = localtime(&np->crttime);
  268. X            sprintf(buf, "Time:    %02d:%02d:%02d", tmptr->tm_hour,
  269. X                tmptr->tm_min, tmptr->tm_sec);
  270. X            }
  271. X        else *buf = 0;
  272. X        xv_set(np->ctime, PANEL_LABEL_STRING, buf, NULL);
  273. X
  274. X        makename(fname, np);
  275. X        xv_set(np->textsw, TEXTSW_FILE, fname, TEXTSW_FIRST, 0, NULL);
  276. X        xv_set(np->frame, XV_LABEL, title, NULL);
  277. X
  278. X        xv_set(np->panel, PANEL_CARET_ITEM, np->title, NULL);
  279. X
  280. X        xv_set(np->title, PANEL_CLIENT_DATA, np, NULL);
  281. X        xv_set(np->hide, PANEL_CLIENT_DATA, np, NULL);
  282. X        xv_set(np->destroy, PANEL_CLIENT_DATA, np, NULL);
  283. X
  284. X        xv_set(np->frame, XV_SHOW, TRUE, NULL);
  285. X        np->mapped = 1;
  286. X        return(1);
  287. X        }
  288. X
  289. X    np->frame = xv_create(main_frame, FRAME,
  290. X                              XV_LABEL, title,
  291. X                              XV_WIDTH, DEFWIDTH,
  292. X                              XV_HEIGHT, DEFHEIGHT,
  293. X                              FRAME_DONE_PROC, dismissed,
  294. X                              NULL);
  295. X    if(np->frame == NULL)
  296. X        {
  297. X        notice_prompt(main_frame, NULL,
  298. X            NOTICE_MESSAGE_STRINGS,
  299. X                "Couldn't create a new frame (internal error)",
  300. X                NULL,
  301. X            NOTICE_BUTTON_YES, "Acknowledge",
  302. X            NOTICE_NO_BEEPING, noticenobeep,
  303. X            NULL);
  304. X        return(0);
  305. X        }
  306. X
  307. X    /* Set up the X class since xview doesn't */
  308. X    chint.res_name = "pannote";
  309. X    chint.res_class = "PanNote";
  310. X    XSetClassHint(xv_get(np->frame, XV_DISPLAY), xv_get(np->frame, XV_XID),
  311. X        &chint);
  312. X
  313. X    frame_set_rect(np->frame, &np->rect);
  314. X
  315. X    xv_set(np->frame, WIN_EVENT_PROC, frameexit, WIN_CONSUME_EVENTS,
  316. X        LOC_WINEXIT, NULL,
  317. X        NULL);
  318. X
  319. X    np->panel = (Panel) xv_create(np->frame, PANEL,
  320. X                     WIN_RETAINED, FALSE, 
  321. X                     NULL);
  322. X
  323. X    if(np->panel == NULL)
  324. X        {
  325. X        xv_destroy_safe(np->frame);
  326. X        return(0);
  327. X        }
  328. X
  329. X    np->title = xv_create(np->panel, PANEL_TEXT,
  330. X                     PANEL_LABEL_STRING, "Title:",
  331. X                     PANEL_VALUE, "",
  332. X                     PANEL_VALUE_DISPLAY_LENGTH, MAXTITLEDISLEN + 1,
  333. X                     PANEL_VALUE_STORED_LENGTH, MAXTITLELEN,
  334. X                     PANEL_NOTIFY_PROC, newtitle,
  335. X                     PANEL_CLIENT_DATA, np,
  336. X                     NULL);
  337. X    if(np->title == NULL)
  338. X        {
  339. X        xv_destroy_safe(np->frame);
  340. X        return(0);
  341. X        }
  342. X
  343. X    if(np->crttime != 0)
  344. X        {
  345. X        tmptr = localtime(&np->crttime);
  346. X        sprintf(buf, "Created: %02d/%02d/%02d", tmptr->tm_mon + 1,
  347. X            tmptr->tm_mday, tmptr->tm_year);
  348. X        }
  349. X    else
  350. X       {
  351. X       strcpy(buf, "No create time");
  352. X       }
  353. X    np->cdate = xv_create(np->panel, PANEL_MESSAGE,
  354. X                 PANEL_LABEL_STRING, buf,
  355. X                 NULL);
  356. X
  357. X    np->hide = xv_create(np->panel, PANEL_BUTTON,
  358. X                     PANEL_NEXT_ROW, -1,
  359. X                     PANEL_LABEL_STRING, "Hide",
  360. X                     PANEL_NOTIFY_PROC, hidenote, 
  361. X                     PANEL_CLIENT_DATA, np,
  362. X                     NULL);
  363. X    if(np->hide == NULL)
  364. X        {
  365. X        xv_destroy_safe(np->frame);
  366. X        return(0);
  367. X        }
  368. X    np->destroy = xv_create(np->panel, PANEL_BUTTON, PANEL_LABEL_STRING, 
  369. X                     "Destroy", PANEL_NOTIFY_PROC, removenote, 
  370. X                     PANEL_CLIENT_DATA, np,
  371. X                     NULL);
  372. X    if(np->destroy == NULL)
  373. X        {
  374. X        xv_destroy_safe(np->frame);
  375. X        return(0);
  376. X        }
  377. X
  378. X    if(np->crttime != 0)
  379. X        {
  380. X        tmptr = localtime(&np->crttime);
  381. X        sprintf(buf, "Time:    %02d:%02d:%02d", tmptr->tm_hour,
  382. X            tmptr->tm_min, tmptr->tm_sec);
  383. X        }
  384. X    else *buf = 0;
  385. X    np->ctime = xv_create(np->panel, PANEL_MESSAGE,
  386. X             PANEL_LABEL_STRING, buf,
  387. X             NULL);
  388. X
  389. X    window_fit_height(np->panel);
  390. X
  391. X    np->textsw = xv_create(np->frame, TEXTSW,
  392. X                     NULL);
  393. X    if(np->textsw == NULL)
  394. X        {
  395. X        xv_destroy_safe(np->frame);
  396. X        return(0);
  397. X        }
  398. X
  399. X
  400. X    xv_set(xv_get(np->textsw, OPENWIN_NTH_VIEW, 0), 
  401. X        WIN_EVENT_PROC, dragdrop,
  402. X        WIN_CONSUME_EVENTS,
  403. X            ACTION_DRAG_LOAD|ACTION_GO_PAGE_FORWARD|ACTION_GO_PAGE_BACKWARD,
  404. X            KBD_DONE,
  405. X            NULL,
  406. X        WIN_RETAINED, FALSE,
  407. X        NULL);
  408. X
  409. X    window_fit(np->frame);
  410. X
  411. X    image = xv_create(NULL, SERVER_IMAGE, XV_WIDTH, 64, XV_HEIGHT, 64,
  412. X                      SERVER_IMAGE_BITS, myicon, NULL);
  413. X    if(image == NULL)
  414. X        {
  415. X        xv_destroy_safe(np->frame);
  416. X        return(0);
  417. X        }
  418. X    np->icon = xv_create(NULL, ICON,
  419. X                     ICON_IMAGE, image,
  420. X                     ICON_LABEL, title,
  421. X                     ICON_TRANSPARENT, icontransparent,
  422. X                     NULL);
  423. X    if(np->icon == NULL)
  424. X        {
  425. X        xv_destroy_safe(np->frame);
  426. X        return(0);
  427. X        }
  428. X    xv_set(np->frame, FRAME_ICON, np->icon, NULL);
  429. X
  430. X    makename(fname, np);
  431. X    xv_set(np->textsw, TEXTSW_FILE, fname, TEXTSW_FIRST, 0, NULL);
  432. X    xv_set(np->frame, XV_SHOW, TRUE, NULL);
  433. X    np->mapped = 1;
  434. X
  435. X    return(1);
  436. X    }
  437. X
  438. /*
  439. X    Sets the icon label of a note to its title.
  440. */
  441. reseticon(np)
  442. X    struct Note *np;
  443. X    {
  444. X    char title[MAXTITLELEN + 1];
  445. X
  446. X    *title = 0;
  447. X    strcpy(title, np->ntitle);
  448. X    if(strlen(title) == 0) strcpy(title, NOTITLE);
  449. X
  450. X    xv_set(np->icon, ICON_LABEL, title, NULL);
  451. X    }
  452. X
  453. /*
  454. X   Called when the user enters a new title for a note.
  455. */
  456. newtitle(item, event)
  457. X    Panel_item item;
  458. X    Event *event;
  459. X    {
  460. X    Xv_Window window;
  461. X    struct Note *np;
  462. X    char title[MAXTITLELEN + 1];
  463. X    char ntitle[MAXBUFLEN];
  464. X
  465. X    np = (struct Note *)xv_get(item, PANEL_CLIENT_DATA);
  466. X
  467. X    strcpy(title, (char *) xv_get(np->title, PANEL_VALUE));
  468. X    trim(title);
  469. X    if(strlen(title))
  470. X        {
  471. X        strcpy(ntitle, title);
  472. X        }
  473. X    else
  474. X        {
  475. X        strcpy(ntitle, NOTITLE);
  476. X        }
  477. X    xv_set(np->frame, XV_LABEL, ntitle, NULL);
  478. X    strcpy(np->ntitle, ntitle);
  479. X    reseticon(np);
  480. X    adjust_sorted(np);
  481. X
  482. X    xv_set(item, PANEL_INACTIVE, TRUE, NULL);
  483. X    window = (Xv_Window) xv_get(np->textsw, OPENWIN_NTH_VIEW, 0);
  484. X    win_set_kbd_focus(window, xv_get(window, XV_XID));
  485. X    xv_set(item, PANEL_INACTIVE, FALSE, NULL);
  486. X    updateinfo(np, FORCE);
  487. X    refresh_popups();
  488. X    return((int)PANEL_NONE);
  489. X    }
  490. X
  491. /*
  492. X    Called when the user wants to create a new folder.
  493. */
  494. newfolder(item, event)
  495. X    Panel_item item;
  496. X    Event *event;
  497. X    {
  498. X    char *cp;
  499. X    struct SubDir *sp;
  500. X    Menu_item mi;
  501. X
  502. X    char new_dir[MAXBUFLEN];
  503. X
  504. X    strcpy(new_dir, (char *) xv_get(folder_item, PANEL_VALUE));
  505. X    trim(new_dir);
  506. X    if(xv_get(folder_frame, FRAME_CMD_PUSHPIN_IN) == FALSE)
  507. X        {
  508. X        xv_destroy_safe(folder_frame);
  509. X        (void) xv_set(folder_mitem, MENU_INACTIVE, FALSE, NULL);
  510. X        }
  511. X    if(strlen(new_dir) == 0)
  512. X        {
  513. X        notice_prompt(main_frame, NULL,
  514. X            NOTICE_MESSAGE_STRINGS,
  515. X                "No folder name entered",
  516. X                NULL,
  517. X            NOTICE_BUTTON_YES, "Acknowledge",
  518. X            NOTICE_NO_BEEPING, noticenobeep,
  519. X            NULL);
  520. X        return;
  521. X        }
  522. X
  523. X    cp = new_dir;
  524. X    if(*cp == '.')
  525. X        {
  526. X        notice_prompt(main_frame, NULL,
  527. X            NOTICE_MESSAGE_STRINGS,
  528. X                "Folder name cannot begin with a '.'",
  529. X                NULL,
  530. X            NOTICE_BUTTON_YES, "Acknowledge",
  531. X            NOTICE_NO_BEEPING, noticenobeep,
  532. X            NULL);
  533. X        return;
  534. X        }
  535. X
  536. X    while(*cp)
  537. X        {
  538. X        if(*cp == '/')
  539. X            {
  540. X            notice_prompt(main_frame, NULL,
  541. X                NOTICE_MESSAGE_STRINGS,
  542. X                    "Folder name cannot contain a '/'",
  543. X                    NULL,
  544. X                NOTICE_BUTTON_YES, "Acknowledge",
  545. X                NOTICE_NO_BEEPING, noticenobeep,
  546. X                NULL);
  547. X            return;
  548. X            }
  549. X        if(*cp == ' ' || *cp == '\t')
  550. X            {
  551. X            notice_prompt(main_frame, NULL,
  552. X                NOTICE_MESSAGE_STRINGS,
  553. X                    "Folder name cannot contain spaces or tabs",
  554. X                    NULL,
  555. X                NOTICE_BUTTON_YES, "Acknowledge",
  556. X                NOTICE_NO_BEEPING, noticenobeep,
  557. X                NULL);
  558. X            return;
  559. X            }
  560. X        cp++;
  561. X        }
  562. X
  563. X    if(mkdir(new_dir, 0700) < 0)
  564. X        {
  565. X        notice_prompt(main_frame, NULL,
  566. X            NOTICE_MESSAGE_STRINGS,
  567. X                "Cannot create the new folder",
  568. X                new_dir,
  569. X                sys_errlist[errno],
  570. X                NULL,
  571. X            NOTICE_BUTTON_YES, "Acknowledge",
  572. X            NOTICE_NO_BEEPING, noticenobeep,
  573. X            NULL);
  574. X        return;
  575. X        }
  576. X    sp = (struct SubDir *) LLM_add(&subdir_rt);
  577. X    if(sp == NULL)
  578. X        {
  579. X        notice_prompt(main_frame, NULL,
  580. X            NOTICE_MESSAGE_STRINGS,
  581. X                "Cannot create the new folder",
  582. X                new_dir,
  583. X                sys_errlist[errno],
  584. X                NULL,
  585. X            NOTICE_BUTTON_YES, "Acknowledge",
  586. X            NOTICE_NO_BEEPING, noticenobeep,
  587. X            NULL);
  588. X        return;
  589. X        }
  590. X    memset((char *)sp, 0, sizeof(struct SubDir));
  591. X    strcpy(sp->subdir, new_dir);
  592. X    LLM_init(&sp->note_rt, sizeof(struct Note));
  593. X    mi = xv_create(NULL, MENUITEM,
  594. X        MENU_STRING, sp->subdir,
  595. X        MENU_NOTIFY_PROC, newnote,
  596. X        NULL);
  597. X    xv_set(main_newnote, MENU_APPEND_ITEM, mi, NULL);
  598. X    mi = xv_create(NULL, MENUITEM,
  599. X        MENU_STRING, sp->subdir,
  600. X        MENU_GEN_PULLRIGHT, gen_exposemenu,
  601. X        NULL);
  602. X    xv_set(main_expose, MENU_APPEND_ITEM, mi, NULL);
  603. X    mi = xv_create(NULL, MENUITEM,
  604. X        MENU_STRING, sp->subdir,
  605. X        MENU_GEN_PULLRIGHT, gen_prtmenu,
  606. X        NULL);
  607. X    xv_set(main_print, MENU_APPEND_ITEM, mi, NULL);
  608. X
  609. X    refresh_popups();
  610. X    }
  611. X
  612. /*
  613. X    Called when the user dismisses the change folder window without applying
  614. X    a change.
  615. */
  616. folderdone()
  617. X    {
  618. X    xv_destroy_safe(folder_frame);
  619. X    (void) xv_set(folder_mitem, MENU_INACTIVE, FALSE, NULL);
  620. X    }
  621. X
  622. SHAR_EOF
  623. chmod 0644 note.c ||
  624. echo 'restore of note.c failed'
  625. Wc_c="`wc -c < 'note.c'`"
  626. test 16239 -eq "$Wc_c" ||
  627.     echo 'note.c: original size 16239, current size' "$Wc_c"
  628. fi
  629. true || echo 'restore of pan.c failed'
  630. echo End of part 3, continue with part 4
  631. exit 0
  632. -- 
  633. --
  634. Molecular Simulations, Inc.            mail: dcmartin@msi.com
  635. 796 N. Pastoria Avenue                uucp: uunet!dcmartin
  636. Sunnyvale, California 94086            at&t: 408/522-9236
  637.