home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / sun / volume2 / calentool / patch5c / patches05c
Encoding:
Text File  |  1990-02-04  |  56.1 KB  |  2,148 lines

  1. *** /tmp/,RCSt1a16911    Fri Dec 15 17:22:26 1989
  2. --- calentool.c    Fri Dec 15 17:17:03 1989
  3. ***************
  4. *** 1,5
  5.   /*
  6. !  * $Header: calentool.c,v 2.2 89/07/19 20:25:41 billr Exp $
  7.    */
  8.   /*
  9.    * calentool.c
  10.  
  11. --- 1,5 -----
  12.   /*
  13. !  * $Header: calentool.c,v 2.3 89/12/15 17:16:58 billr Exp $
  14.    */
  15.   /*
  16.    * calentool.c
  17. ***************
  18. *** 33,39
  19.   
  20.   extern Pixfont *font, *sfont;
  21.   extern char apts_pathname[], tmpapts_pathname[];
  22. ! extern char todays_date[];
  23.   extern char version[];
  24.   extern Panel_item clock_pi;
  25.   extern Frame fframe;
  26.  
  27. --- 33,39 -----
  28.   
  29.   extern Pixfont *font, *sfont;
  30.   extern char apts_pathname[], tmpapts_pathname[];
  31. ! extern char clockstr[];
  32.   extern char version[];
  33.   extern char *smonthnames[];
  34.   extern Panel_item clock_pi;
  35. ***************
  36. *** 35,40
  37.   extern char apts_pathname[], tmpapts_pathname[];
  38.   extern char todays_date[];
  39.   extern char version[];
  40.   extern Panel_item clock_pi;
  41.   extern Frame fframe;
  42.   extern Panel panel;
  43.  
  44. --- 35,41 -----
  45.   extern char apts_pathname[], tmpapts_pathname[];
  46.   extern char clockstr[];
  47.   extern char version[];
  48. + extern char *smonthnames[];
  49.   extern Panel_item clock_pi;
  50.   extern Frame fframe;
  51.   extern Panel panel;
  52. ***************
  53. *** 38,43
  54.   extern Panel_item clock_pi;
  55.   extern Frame fframe;
  56.   extern Panel panel;
  57.   #ifndef NO_SUN_MOON
  58.   extern Frame sframe;
  59.   #endif
  60.  
  61. --- 39,45 -----
  62.   extern Panel_item clock_pi;
  63.   extern Frame fframe;
  64.   extern Panel panel;
  65. + extern Rect *closed_rect;
  66.   #ifndef NO_SUN_MOON
  67.   extern Frame sframe;
  68.   #endif
  69. ***************
  70. *** 71,77
  71.   int one_based = 0, new_entry = 0, version2 = 0;
  72.   int otherfile = 0;
  73.   char *othername;
  74. ! int beep = 0, show_time = 0;
  75.   int include_old = 0, save_old = 0;
  76.   #ifndef NO_HOLIDAYS
  77.   int holiday_a = 0, holiday_c = 0, holiday_i = 0;
  78.  
  79. --- 73,79 -----
  80.   int one_based = 0, new_entry = 0, version2 = 0;
  81.   int otherfile = 0;
  82.   char *othername;
  83. ! int beep = 0, show_time = 0, beep_open = 0;
  84.   int include_old = 0, save_old = 0;
  85.   #ifndef NO_HOLIDAYS
  86.   int holiday_a = 0, holiday_c = 0, holiday_i = 0;
  87. ***************
  88. *** 86,92
  89.   Cursor wait_cursor;
  90.   char orig_apts_pathname[160];
  91.   int orig_ro;
  92. ! char timestr[16], datestr_day[3], datestr_mon[4];
  93.   struct pr_prpos where;
  94.   int working_msg;
  95.   
  96.  
  97. --- 88,94 -----
  98.   Cursor wait_cursor;
  99.   char orig_apts_pathname[160];
  100.   int orig_ro;
  101. ! char timestr[16], datestr_day[3];
  102.   struct pr_prpos where;
  103.   int working_msg;
  104.   int hour24, monday_first, day_first;
  105. ***************
  106. *** 89,94
  107.   char timestr[16], datestr_day[3], datestr_mon[4];
  108.   struct pr_prpos where;
  109.   int working_msg;
  110.   
  111.   static short icon_data[] = {
  112.   #include "std.icon"
  113.  
  114. --- 91,98 -----
  115.   char timestr[16], datestr_day[3];
  116.   struct pr_prpos where;
  117.   int working_msg;
  118. + int hour24, monday_first, day_first;
  119. + int expire_days = 0;
  120.   
  121.   static short icon_data[] = {
  122.   #include "std.icon"
  123. ***************
  124. *** 146,152
  125.   mpr_static(tri_right_pr, 16, 16, 1, tri_right_data);
  126.   
  127.   char *strcpy(), *strcat(), *rindex();
  128. ! static Notify_value cleanup(), itimer_handler();
  129.   Notify_value myframe_interposer();
  130.   
  131.   main(argc,argv)
  132.  
  133. --- 150,156 -----
  134.   mpr_static(tri_right_pr, 16, 16, 1, tri_right_data);
  135.   
  136.   char *strcpy(), *strcat(), *rindex();
  137. ! static Notify_value leave(), itimer_handler();
  138.   Notify_value myframe_interposer();
  139.   
  140.   main(argc,argv)
  141. ***************
  142. *** 164,169
  143.           progname = *argv;
  144.   
  145.       nr_weekdays = NR_WEEKDAYS;
  146.       n_tslots = (N_TSLOTS > N_SLOTS ? N_SLOTS : N_TSLOTS);
  147.   
  148.       get_today();    /* initial day is today */
  149.  
  150. --- 168,175 -----
  151.           progname = *argv;
  152.   
  153.       nr_weekdays = NR_WEEKDAYS;
  154. +     monday_first = MON_FIRST;
  155. +     hour24 = HOUR_24;
  156.       n_tslots = (N_TSLOTS > N_SLOTS ? N_SLOTS : N_TSLOTS);
  157.   
  158.       get_today();    /* initial day is today */
  159. ***************
  160. *** 169,175
  161.       get_today();    /* initial day is today */
  162.       current = today;
  163.       read_only = 0;
  164. !     working_msg = 1;
  165.   
  166.       /*
  167.        * Check for -p, -P or -m option, which means we don't want
  168.  
  169. --- 175,181 -----
  170.       get_today();    /* initial day is today */
  171.       current = today;
  172.       read_only = 0;
  173. !     working_msg = 0;
  174.   
  175.       /*
  176.        * Check for -p, -P, -m or -M option, which means we don't want
  177. ***************
  178. *** 172,178
  179.       working_msg = 1;
  180.   
  181.       /*
  182. !      * Check for -p, -P or -m option, which means we don't want
  183.        * to create the tool. Also check for -Wp so we can supply
  184.        * a resonable default if the user doesn't supply one.
  185.        */
  186.  
  187. --- 178,184 -----
  188.       working_msg = 0;
  189.   
  190.       /*
  191. !      * Check for -p, -P, -m or -M option, which means we don't want
  192.        * to create the tool. Also check for -Wp so we can supply
  193.        * a resonable default if the user doesn't supply one.
  194.        */
  195. ***************
  196. *** 179,185
  197.       i = argc;
  198.       while (--i > 0) {
  199.           if (!strncmp(argv[i], "-p", 2) || !strcmp(argv[i], "-m")
  200. !             || !strncmp(argv[i], "-P", 2)) {
  201.               /* standard getopt doesn't allow optional
  202.                * arguments, so we do a check here for
  203.                * obsolete usage of the -p option
  204.  
  205. --- 185,191 -----
  206.       i = argc;
  207.       while (--i > 0) {
  208.           if (!strncmp(argv[i], "-p", 2) || !strcmp(argv[i], "-m")
  209. !             || !strncmp(argv[i], "-P", 2) || !strcmp(argv[i], "-M")) {
  210.               /* standard getopt doesn't allow optional
  211.                * arguments, so we do a check here for
  212.                * obsolete usage of the -p option
  213. ***************
  214. *** 205,211
  215.                   0);
  216.       }
  217.   
  218. !     while ((flag = getopt(argc, argv, "57bd:f:im:op:P:rtu:zH:h:w")) != EOF)
  219.           switch (flag) {   
  220.               case 'f':    /* use this file */
  221.               otherfile = 1;
  222.  
  223. --- 211,217 -----
  224.                   0);
  225.       }
  226.   
  227. !     while ((flag = getopt(argc, argv, "1:2:567bBd:eEf:im:M:op:P:rtu:zH:h:wx:")) != EOF)
  228.           switch (flag) {   
  229.               case 'f':    /* use this file */
  230.               otherfile = 1;
  231. ***************
  232. *** 220,225
  233.               read_only = 1;
  234.               break;
  235.               
  236.               case 'p':    /* print and exit */
  237.               read_only = 1;
  238.               switch (*optarg) {
  239.  
  240. --- 226,251 -----
  241.               read_only = 1;
  242.               break;
  243.               
  244. +             case '1':    /* -12 -- 12 hour time */
  245. +             if (*optarg == '2')
  246. +                 hour24 = FALSE;
  247. +             break;
  248. +             case '2':    /* -24 -- 24 hour time */
  249. +             if (*optarg == '4')
  250. +                 hour24 = TRUE;
  251. +             break;
  252. +             case 'e':    /* European calendar Mon-Sun */
  253. +             monday_first = TRUE;
  254. +             break;
  255. +             case 'E':    /* European style */
  256. +             monday_first = TRUE;
  257. +             hour24 = TRUE;
  258. +             day_first = TRUE;
  259. +             break;
  260.               case 'p':    /* print and exit */
  261.               read_only = 1;
  262.               switch (*optarg) {
  263. ***************
  264. *** 268,273
  265.   
  266.               case 'm':    /* mail today's appts and exit */
  267.               read_only = 1;
  268.               printit_dst = DST_MAIL;
  269.               mailto = optarg;
  270.               break;
  271.  
  272. --- 294,301 -----
  273.   
  274.               case 'm':    /* mail today's appts and exit */
  275.               read_only = 1;
  276. +             if (!printit)
  277. +                 printit = PRI_DAY;
  278.               printit_dst = DST_MAIL;
  279.               mailto = optarg;
  280.               break;
  281. ***************
  282. *** 272,277
  283.               mailto = optarg;
  284.               break;
  285.   
  286.               case 'b':    /* beep to console for pending appt */
  287.               beep = 1;
  288.               break;
  289.  
  290. --- 300,314 -----
  291.               mailto = optarg;
  292.               break;
  293.   
  294. +             case 'M':    /* mail today's appts and exit (ignore
  295. +                    some notes) */
  296. +             read_only = 1;
  297. +             if (!printit)
  298. +                 printit = PRI_DAY_XNOTES;
  299. +             printit_dst = DST_MAIL;
  300. +             mailto = optarg;
  301. +             break;
  302.               case 'b':    /* beep to console for pending appt */
  303.               beep = 1;
  304.               break;
  305. ***************
  306. *** 276,281
  307.               beep = 1;
  308.               break;
  309.   
  310.               case 'i':    /* include old appt files */
  311.               include_old = 1;
  312.               break;
  313.  
  314. --- 313,322 -----
  315.               beep = 1;
  316.               break;
  317.   
  318. +             case 'B':    /* beep then open wondow */
  319. +             beep_open = 1;
  320. +             break;
  321.               case 'i':    /* include old appt files */
  322.               include_old = 1;
  323.               break;
  324. ***************
  325. *** 280,286
  326.               include_old = 1;
  327.               break;
  328.   
  329. !             case 'o':    /* save outdate appts to another file */
  330.               save_old = 1;
  331.               break;
  332.   
  333.  
  334. --- 321,327 -----
  335.               include_old = 1;
  336.               break;
  337.   
  338. !             case 'o':    /* save outdated appts to another file */
  339.               save_old = 1;
  340.               break;
  341.   
  342. ***************
  343. *** 292,298
  344.               nr_weekdays = 5;
  345.               break;
  346.   
  347. !             case '7':    /* Sun - Sat week display */
  348.               nr_weekdays = 7;
  349.               break;
  350.   
  351.  
  352. --- 333,343 -----
  353.               nr_weekdays = 5;
  354.               break;
  355.   
  356. !             case '6':    /* Mon - Sat week display */
  357. !             nr_weekdays = 6;
  358. !             break;
  359. !             case '7':    /* Sun - Sat (or Mon-Sun) week display */
  360.               nr_weekdays = 7;
  361.               break;
  362.   
  363. ***************
  364. *** 300,307
  365.               update_interval = atoi(optarg);
  366.               break;
  367.   
  368. !             case 'w':    /* don't display Working! message */
  369. !             working_msg = 0;
  370.               break;
  371.   
  372.               case 'z':    /* zero offset -- new style appts file */
  373.  
  374. --- 345,352 -----
  375.               update_interval = atoi(optarg);
  376.               break;
  377.   
  378. !             case 'w':    /* display Working! message */
  379. !             working_msg = 1;
  380.               break;
  381.   
  382.               case 'x':    /* eXpire appts after so many days */
  383. ***************
  384. *** 304,309
  385.               working_msg = 0;
  386.               break;
  387.   
  388.               case 'z':    /* zero offset -- new style appts file */
  389.               one_based = 1;
  390.               break;
  391.  
  392. --- 349,358 -----
  393.               working_msg = 1;
  394.               break;
  395.   
  396. +             case 'x':    /* eXpire appts after so many days */
  397. +             expire_days = atoi(optarg);
  398. +             break;
  399.               case 'z':    /* zero offset -- new style appts file */
  400.               one_based = 1;
  401.               break;
  402. ***************
  403. *** 390,396
  404.               fprintf(stderr, " -p <dwm>    // print selected day [d], week [w] or month [m] appts and exit\n");
  405.               fprintf(stderr, " -P <dwm>    // like -p, only don't print marked notes\n");
  406.               fprintf(stderr, " -m <user>    // mail selected days appts to <user>\n");
  407. !             fprintf(stderr, " [-5|-7]    // 5-day or 7-day week display\n");
  408.               fprintf(stderr, " -d <date>    // display appts for <date>\n");
  409.               fprintf(stderr, " -b        // beep and display message when appt is pending\n");
  410.               fprintf(stderr, " -i        // auto-include outdated appts files\n");
  411.  
  412. --- 439,447 -----
  413.               fprintf(stderr, " -p <dwm>    // print selected day [d], week [w] or month [m] appts and exit\n");
  414.               fprintf(stderr, " -P <dwm>    // like -p, only don't print marked notes\n");
  415.               fprintf(stderr, " -m <user>    // mail selected days appts to <user>\n");
  416. !             fprintf(stderr, " -M <user>    // like -m, only don't mail marked notes\n");
  417. !             fprintf(stderr, " [-5|-6|-7]    // 5, 6 or 7-day week display\n");
  418. !             fprintf(stderr, " [-12|-24]    // 12 or 24 hour time format\n");
  419.               fprintf(stderr, " -d <date>    // display appts for <date>\n");
  420.               fprintf(stderr, " -b        // beep and display message when appt is pending\n");
  421.               fprintf(stderr, " -B        // beep and open window when appt is pending\n");
  422. ***************
  423. *** 393,398
  424.               fprintf(stderr, " [-5|-7]    // 5-day or 7-day week display\n");
  425.               fprintf(stderr, " -d <date>    // display appts for <date>\n");
  426.               fprintf(stderr, " -b        // beep and display message when appt is pending\n");
  427.               fprintf(stderr, " -i        // auto-include outdated appts files\n");
  428.               fprintf(stderr, " -o        // create outdated include files\n");
  429.               fprintf(stderr, " -t        // display time below icon\n");
  430.  
  431. --- 444,450 -----
  432.               fprintf(stderr, " [-12|-24]    // 12 or 24 hour time format\n");
  433.               fprintf(stderr, " -d <date>    // display appts for <date>\n");
  434.               fprintf(stderr, " -b        // beep and display message when appt is pending\n");
  435. +             fprintf(stderr, " -B        // beep and open window when appt is pending\n");
  436.               fprintf(stderr, " -i        // auto-include outdated appts files\n");
  437.               fprintf(stderr, " -o        // create outdated include files\n");
  438.               fprintf(stderr, " -t        // display time below icon\n");
  439. ***************
  440. *** 397,403
  441.               fprintf(stderr, " -o        // create outdated include files\n");
  442.               fprintf(stderr, " -t        // display time below icon\n");
  443.               fprintf(stderr, " -u <interval>    // time update interval (seconds)\n");
  444. !             fprintf(stderr, " -w        // don't display 'Working!' message\n");
  445.   #ifndef NO_HOLIDAYS
  446.               fprintf(stderr, " -h <Aacijs>    // display selected computed holidays\n");
  447.               fprintf(stderr, "        // A=All, a=astronomical, c=Christian,\n");
  448.  
  449. --- 449,457 -----
  450.               fprintf(stderr, " -o        // create outdated include files\n");
  451.               fprintf(stderr, " -t        // display time below icon\n");
  452.               fprintf(stderr, " -u <interval>    // time update interval (seconds)\n");
  453. !             fprintf(stderr, " -w        // display 'Working!' message\n");
  454. !             fprintf(stderr, " -e        // Mon-Sun week display\n");
  455. !             fprintf(stderr, " -E        // European options (-e, -24)\n");
  456.   #ifndef NO_HOLIDAYS
  457.               fprintf(stderr, " -h <Aacijs>    // display selected computed holidays\n");
  458.               fprintf(stderr, "        // A=All, a=astronomical, c=Christian,\n");
  459. ***************
  460. *** 404,409
  461.               fprintf(stderr, "        // i=Islamic, j=Jewish, s=secular\n");
  462.               fprintf(stderr, " -H <Aacijs>    // like -h, only flag them as marked\n");
  463.   #endif
  464.               fprintf(stderr, " -z        // conversion flag (see INSTALL)\n");
  465.               fprintf(stderr, " <window_opts>    // Suntools -W options\n");
  466.               exit(1);
  467.  
  468. --- 458,464 -----
  469.               fprintf(stderr, "        // i=Islamic, j=Jewish, s=secular\n");
  470.               fprintf(stderr, " -H <Aacijs>    // like -h, only flag them as marked\n");
  471.   #endif
  472. +             fprintf(stderr, " -x <days>    // expire appts after <days> days\n");
  473.               fprintf(stderr, " -z        // conversion flag (see INSTALL)\n");
  474.               fprintf(stderr, " <window_opts>    // Suntools -W options\n");
  475.               exit(1);
  476. ***************
  477. *** 410,416
  478.               break;
  479.           }
  480.   
  481.       if (toolrunning) {
  482.           (void) notify_set_signal_func(frame, cleanup, SIGHUP, NOTIFY_ASYNC);
  483.           (void) notify_set_signal_func(frame, cleanup, SIGINT, NOTIFY_ASYNC);
  484.  
  485. --- 465,474 -----
  486.               break;
  487.           }
  488.   
  489. !     if (printit_dst == DST_MAIL && (printit == PRI_MONTH || printit == PRI_MONTH_XNOTES)) {
  490. !         fprintf(stderr, "calentool: can't mail month calendar\n");
  491. !         exit(1);
  492. !     }
  493.       if (toolrunning) {
  494.           (void) notify_set_signal_func(frame, leave, SIGHUP, NOTIFY_ASYNC);
  495.           (void) notify_set_signal_func(frame, leave, SIGINT, NOTIFY_ASYNC);
  496. ***************
  497. *** 412,420
  498.   
  499.   
  500.       if (toolrunning) {
  501. !         (void) notify_set_signal_func(frame, cleanup, SIGHUP, NOTIFY_ASYNC);
  502. !         (void) notify_set_signal_func(frame, cleanup, SIGINT, NOTIFY_ASYNC);
  503. !         (void) notify_set_signal_func(frame, cleanup, SIGTERM, NOTIFY_ASYNC);
  504.       }
  505.   
  506.       /* 
  507.  
  508. --- 470,478 -----
  509.           exit(1);
  510.       }
  511.       if (toolrunning) {
  512. !         (void) notify_set_signal_func(frame, leave, SIGHUP, NOTIFY_ASYNC);
  513. !         (void) notify_set_signal_func(frame, leave, SIGINT, NOTIFY_ASYNC);
  514. !         (void) notify_set_signal_func(frame, leave, SIGTERM, NOTIFY_ASYNC);
  515.       }
  516.   
  517.       /* 
  518. ***************
  519. *** 429,434
  520.       
  521.       if (printit) {
  522.           print_apts(printit, printit_dst);
  523.           exit(0);
  524.       }
  525.   
  526.  
  527. --- 487,494 -----
  528.       
  529.       if (printit) {
  530.           print_apts(printit, printit_dst);
  531. +         if (save_old || expire_days)
  532. +             expire(expire_days);
  533.           exit(0);
  534.       }
  535.   
  536. ***************
  537. *** 478,487
  538.       icon = icon_create(0);
  539.       rev_icon = icon_create(0);
  540.       na_icon = icon_create(0);
  541. !     strncpy(datestr_mon, todays_date+4, 3);
  542. !     datestr_mon[3] = '\0';
  543. !     strncpy(datestr_day, todays_date+8, 2);
  544. !     datestr_day[2] = '\0';
  545.       /* the basic standard icon */
  546.       pr_rop(ic_pr, 0, 0, 64, 64, PIX_SRC, &ic_mpr, 0, 0);
  547.       if (show_time) {
  548.  
  549. --- 538,544 -----
  550.       icon = icon_create(0);
  551.       rev_icon = icon_create(0);
  552.       na_icon = icon_create(0);
  553. !     sprintf(datestr_day, "%2d", today.tm_mday);
  554.       /* the basic standard icon */
  555.       pr_rop(ic_pr, 0, 0, 64, 64, PIX_SRC, &ic_mpr, 0, 0);
  556.       if (show_time) {
  557. ***************
  558. *** 486,495
  559.       pr_rop(ic_pr, 0, 0, 64, 64, PIX_SRC, &ic_mpr, 0, 0);
  560.       if (show_time) {
  561.           /* time string displayed below icon */
  562. !         strcpy(timestr, todays_date+10);
  563. !         if (update_interval == 60) {
  564. !             /* display hh:mm */
  565. !             timestr[6] = '\0';
  566.               ilabel_rect.r_left += 2*sfont->pf_defaultsize.x - 2;
  567.               ilabel_rect.r_width -= 2*sfont->pf_defaultsize.x;
  568.           } else
  569.  
  570. --- 543,551 -----
  571.       pr_rop(ic_pr, 0, 0, 64, 64, PIX_SRC, &ic_mpr, 0, 0);
  572.       if (show_time) {
  573.           /* time string displayed below icon */
  574. !         format_icon_time();
  575. !         if (update_interval >= 60) {
  576. !             /* no seconds displayed, adjust label position */
  577.               ilabel_rect.r_left += 2*sfont->pf_defaultsize.x - 2;
  578.               ilabel_rect.r_width -= 2*sfont->pf_defaultsize.x;
  579.           }
  580. ***************
  581. *** 492,500
  582.               timestr[6] = '\0';
  583.               ilabel_rect.r_left += 2*sfont->pf_defaultsize.x - 2;
  584.               ilabel_rect.r_width -= 2*sfont->pf_defaultsize.x;
  585. !         } else
  586. !             /* display hh:mm:ss */
  587. !             timestr[9] = '\0';
  588.           /* draw a box around the time appendage */
  589.           pr_vector(ic_pr, 0, 64, 63, 64, PIX_SET, 1);
  590.           pr_vector(ic_pr, 63, 64, 63, 76, PIX_SET, 1);
  591.  
  592. --- 548,559 -----
  593.               /* no seconds displayed, adjust label position */
  594.               ilabel_rect.r_left += 2*sfont->pf_defaultsize.x - 2;
  595.               ilabel_rect.r_width -= 2*sfont->pf_defaultsize.x;
  596. !         }
  597. !         if (!hour24) {
  598. !             /* am/pm, increase size of label rect */
  599. !             ilabel_rect.r_left -= sfont->pf_defaultsize.x;
  600. !             ilabel_rect.r_width += sfont->pf_defaultsize.x;
  601. !         }
  602.           /* draw a box around the time appendage */
  603.           pr_vector(ic_pr, 0, 64, 63, 64, PIX_SET, 1);
  604.           pr_vector(ic_pr, 63, 64, 63, 76, PIX_SET, 1);
  605. ***************
  606. *** 520,526
  607.       pf_ttext(where, PIX_SRC, sfont, datestr_day);
  608.       where.pos.x = 39;
  609.       where.pr = ic_pr;
  610. !     pf_ttext(where, PIX_NOT(PIX_SRC), sfont, datestr_mon);
  611.       where.pr = na_ic_pr;
  612.       pf_ttext(where, PIX_NOT(PIX_SRC), sfont, datestr_mon);
  613.       where.pr = rev_ic_pr;
  614.  
  615. --- 579,585 -----
  616.       pf_ttext(where, PIX_SRC, sfont, datestr_day);
  617.       where.pos.x = 39;
  618.       where.pr = ic_pr;
  619. !     pf_ttext(where, PIX_NOT(PIX_SRC), sfont, smonthnames[today.tm_mon]);
  620.       where.pr = na_ic_pr;
  621.       pf_ttext(where, PIX_NOT(PIX_SRC), sfont, smonthnames[today.tm_mon]);
  622.       where.pr = rev_ic_pr;
  623. ***************
  624. *** 522,528
  625.       where.pr = ic_pr;
  626.       pf_ttext(where, PIX_NOT(PIX_SRC), sfont, datestr_mon);
  627.       where.pr = na_ic_pr;
  628. !     pf_ttext(where, PIX_NOT(PIX_SRC), sfont, datestr_mon);
  629.       where.pr = rev_ic_pr;
  630.       pf_ttext(where, PIX_SRC, sfont, datestr_mon);
  631.       (void)icon_init_from_pr(icon, ic_pr);
  632.  
  633. --- 581,587 -----
  634.       where.pr = ic_pr;
  635.       pf_ttext(where, PIX_NOT(PIX_SRC), sfont, smonthnames[today.tm_mon]);
  636.       where.pr = na_ic_pr;
  637. !     pf_ttext(where, PIX_NOT(PIX_SRC), sfont, smonthnames[today.tm_mon]);
  638.       where.pr = rev_ic_pr;
  639.       pf_ttext(where, PIX_SRC, sfont, smonthnames[today.tm_mon]);
  640.       (void)icon_init_from_pr(icon, ic_pr);
  641. ***************
  642. *** 524,530
  643.       where.pr = na_ic_pr;
  644.       pf_ttext(where, PIX_NOT(PIX_SRC), sfont, datestr_mon);
  645.       where.pr = rev_ic_pr;
  646. !     pf_ttext(where, PIX_SRC, sfont, datestr_mon);
  647.       (void)icon_init_from_pr(icon, ic_pr);
  648.       (void)icon_init_from_pr(rev_icon, rev_ic_pr);
  649.       (void)icon_init_from_pr(na_icon, na_ic_pr);
  650.  
  651. --- 583,589 -----
  652.       where.pr = na_ic_pr;
  653.       pf_ttext(where, PIX_NOT(PIX_SRC), sfont, smonthnames[today.tm_mon]);
  654.       where.pr = rev_ic_pr;
  655. !     pf_ttext(where, PIX_SRC, sfont, smonthnames[today.tm_mon]);
  656.       (void)icon_init_from_pr(icon, ic_pr);
  657.       (void)icon_init_from_pr(rev_icon, rev_ic_pr);
  658.       (void)icon_init_from_pr(na_icon, na_ic_pr);
  659. ***************
  660. *** 569,574
  661.                FRAME_ICON, icon,
  662.                0);
  663.   
  664.       create_panel();
  665.       create_main_window();
  666.       create_attr_frame();    /* normally hidden */
  667.  
  668. --- 628,634 -----
  669.                FRAME_ICON, icon,
  670.                0);
  671.   
  672. +     closed_rect = (Rect *)window_get(frame, FRAME_CLOSED_RECT);
  673.       create_panel();
  674.       create_main_window();
  675.       create_attr_frame();    /* normally hidden */
  676. ***************
  677. *** 594,600
  678.   
  679.       window_main_loop(frame);
  680.   
  681. !     cleanup();
  682.   }            
  683.                
  684.   
  685.  
  686. --- 654,660 -----
  687.   
  688.       window_main_loop(frame);
  689.   
  690. !     leave();
  691.   }            
  692.                
  693.   
  694. ***************
  695. *** 613,631
  696.       (void) notify_set_itimer_func(frame, itimer_handler, ITIMER_REAL, &cal_timer, NULL);
  697.       get_today();
  698.       /* update date/time displayed in the panel */
  699. !     panel_set(clock_pi, PANEL_LABEL_STRING, todays_date, 0);
  700. !     if (show_time && (int)window_get(frame, FRAME_CLOSED)) {
  701. !         strcpy(timestr, todays_date+10);
  702. !         if (update_interval == 60)
  703. !             /* display hh:mm */
  704. !             timestr[6] = '\0';
  705. !         else
  706. !             /* display hh:mm:ss */
  707. !             timestr[9] = '\0';
  708. !         cur_icon = (Icon) window_get(frame, FRAME_ICON);
  709. !         icon_set(cur_icon, ICON_LABEL, timestr, 0);
  710. !         window_set(frame, FRAME_ICON, cur_icon, 0);
  711. !     }
  712.   #ifndef NO_SUN_MOON
  713.       /* update data in Sun Data frame (if it's open) */
  714.       if (sframe)
  715.  
  716. --- 673,681 -----
  717.       (void) notify_set_itimer_func(frame, itimer_handler, ITIMER_REAL, &cal_timer, NULL);
  718.       get_today();
  719.       /* update date/time displayed in the panel */
  720. !     panel_set(clock_pi, PANEL_LABEL_STRING, clockstr, 0);
  721. !     if (show_time && (int)window_get(frame, FRAME_CLOSED))
  722. !         update_icon_time();
  723.   #ifndef NO_SUN_MOON
  724.       /* update data in Sun Data frame (if it's open) */
  725.       if (sframe)
  726. ***************
  727. *** 739,745
  728.           }
  729.       } else {
  730.            /* notify the user via the console (once) ... */
  731. !         if (beep && sno != echoed_sno) {
  732.               echoed_sno = sno;
  733.               window_bell(frame);
  734.               if ((console = fopen("/dev/console", "w")) != NULL) {
  735.  
  736. --- 789,795 -----
  737.           }
  738.       } else {
  739.            /* notify the user via the console (once) ... */
  740. !         if ((beep || beep_open) && sno != echoed_sno) {
  741.               echoed_sno = sno;
  742.               window_bell(frame);
  743.               if (beep_open)
  744. ***************
  745. *** 742,751
  746.           if (beep && sno != echoed_sno) {
  747.               echoed_sno = sno;
  748.               window_bell(frame);
  749. !             if ((console = fopen("/dev/console", "w")) != NULL) {
  750. !                 fprintf(console, "%s\n", slots[sno].cur_appt->str);
  751. !                 fclose(console);
  752. !             }
  753.               /*
  754.                * also put a copy in ~/.msgfile, in case
  755.                * nlock(1) is running
  756.  
  757. --- 792,804 -----
  758.           if ((beep || beep_open) && sno != echoed_sno) {
  759.               echoed_sno = sno;
  760.               window_bell(frame);
  761. !             if (beep_open)
  762. !                 window_set(frame, FRAME_CLOSED, FALSE, 0);
  763. !             if (beep)
  764. !                 if ((console = fopen("/dev/console", "w")) != NULL) {
  765. !                     fprintf(console, "<< %s >> %s\n", progname, slots[sno].cur_appt->str);
  766. !                     fclose(console);
  767. !                 }
  768.               /*
  769.                * also put a copy in ~/.msgfile, in case
  770.                * nlock(1) is running
  771. ***************
  772. *** 771,778
  773.               /* so that it opens on today */
  774.               olddate = current = today;
  775.               /* update date field of the icons */
  776. !             strncpy(datestr_mon, todays_date+4, 3);
  777. !             strncpy(datestr_day, todays_date+8, 2);
  778.               /* replace the date */
  779.               where.pr = ic_pr;
  780.               where.pos.x = 13;
  781.  
  782. --- 824,830 -----
  783.               /* so that it opens on today */
  784.               olddate = current = today;
  785.               /* update date field of the icons */
  786. !             sprintf(datestr_day, "%d", today.tm_mday);
  787.               /* replace the date */
  788.               where.pr = ic_pr;
  789.               where.pos.x = 13;
  790. ***************
  791. *** 790,796
  792.               pf_ttext(where, PIX_SRC, sfont, datestr_day);
  793.               where.pos.x = 39;
  794.               where.pr = ic_pr;
  795. !             pf_ttext(where, PIX_NOT(PIX_SRC), sfont, datestr_mon);
  796.               where.pr = na_ic_pr;
  797.               pf_ttext(where, PIX_NOT(PIX_SRC), sfont, datestr_mon);
  798.               where.pr = rev_ic_pr;
  799.  
  800. --- 842,848 -----
  801.               pf_ttext(where, PIX_SRC, sfont, datestr_day);
  802.               where.pos.x = 39;
  803.               where.pr = ic_pr;
  804. !             pf_ttext(where, PIX_NOT(PIX_SRC), sfont, smonthnames[today.tm_mon]);
  805.               where.pr = na_ic_pr;
  806.               pf_ttext(where, PIX_NOT(PIX_SRC), sfont, smonthnames[today.tm_mon]);
  807.               where.pr = rev_ic_pr;
  808. ***************
  809. *** 792,798
  810.               where.pr = ic_pr;
  811.               pf_ttext(where, PIX_NOT(PIX_SRC), sfont, datestr_mon);
  812.               where.pr = na_ic_pr;
  813. !             pf_ttext(where, PIX_NOT(PIX_SRC), sfont, datestr_mon);
  814.               where.pr = rev_ic_pr;
  815.               pf_ttext(where, PIX_SRC, sfont, datestr_mon);
  816.               icon_set(icon, ICON_IMAGE, ic_pr, 0);
  817.  
  818. --- 844,850 -----
  819.               where.pr = ic_pr;
  820.               pf_ttext(where, PIX_NOT(PIX_SRC), sfont, smonthnames[today.tm_mon]);
  821.               where.pr = na_ic_pr;
  822. !             pf_ttext(where, PIX_NOT(PIX_SRC), sfont, smonthnames[today.tm_mon]);
  823.               where.pr = rev_ic_pr;
  824.               pf_ttext(where, PIX_SRC, sfont, smonthnames[today.tm_mon]);
  825.               icon_set(icon, ICON_IMAGE, ic_pr, 0);
  826. ***************
  827. *** 794,800
  828.               where.pr = na_ic_pr;
  829.               pf_ttext(where, PIX_NOT(PIX_SRC), sfont, datestr_mon);
  830.               where.pr = rev_ic_pr;
  831. !             pf_ttext(where, PIX_SRC, sfont, datestr_mon);
  832.               icon_set(icon, ICON_IMAGE, ic_pr, 0);
  833.               icon_set(rev_icon, ICON_IMAGE, rev_ic_pr, 0);
  834.               icon_set(na_icon, ICON_IMAGE, na_ic_pr, 0);
  835.  
  836. --- 846,852 -----
  837.               where.pr = na_ic_pr;
  838.               pf_ttext(where, PIX_NOT(PIX_SRC), sfont, smonthnames[today.tm_mon]);
  839.               where.pr = rev_ic_pr;
  840. !             pf_ttext(where, PIX_SRC, sfont, smonthnames[today.tm_mon]);
  841.               icon_set(icon, ICON_IMAGE, ic_pr, 0);
  842.               icon_set(rev_icon, ICON_IMAGE, rev_ic_pr, 0);
  843.               icon_set(na_icon, ICON_IMAGE, na_ic_pr, 0);
  844. ***************
  845. *** 824,830
  846.   }
  847.   
  848.   static Notify_value
  849. ! cleanup(me, signal, when)
  850.   Notify_client me;
  851.   int signal;
  852.   Notify_signal_mode when;
  853.  
  854. --- 876,882 -----
  855.   }
  856.   
  857.   static Notify_value
  858. ! leave(me, signal, when)
  859.   Notify_client me;
  860.   int signal;
  861.   Notify_signal_mode when;
  862. ***************
  863. *** 831,836
  864.   {
  865.       if (day_is_open)
  866.           close_day();
  867.       if (access(tmpapts_pathname, R_OK) == 0 && unlink(tmpapts_pathname) < 0)
  868.           perror(tmpapts_pathname);
  869.       exit(0);
  870.  
  871. --- 883,894 -----
  872.   {
  873.       if (day_is_open)
  874.           close_day();
  875. +     /* create outdated include files (if necessary) */
  876. +     if (save_old || expire_days)
  877. +         expire(expire_days);
  878. +     /* delete tmp file */
  879.       if (access(tmpapts_pathname, R_OK) == 0 && unlink(tmpapts_pathname) < 0)
  880.           perror(tmpapts_pathname);
  881.       exit(0);
  882. *** /tmp/,RCSt1a16942    Fri Dec 15 17:23:02 1989
  883. --- holidays.c    Fri Dec 15 17:17:37 1989
  884. ***************
  885. *** 1,5
  886.   /*
  887. !  * $Header: holidays.c,v 2.1 89/05/09 14:19:10 billr Exp $
  888.    */
  889.   /*
  890.    * holidays.c
  891.  
  892. --- 1,5 -----
  893.   /*
  894. !  * $Header: holidays.c,v 2.2 89/12/15 17:17:34 billr Exp $
  895.    */
  896.   /*
  897.    * holidays.c
  898. ***************
  899. *** 81,86
  900.   
  901.   extern struct tm current;    /* current day displayed from calentool */
  902.   int    marked_note;
  903.   
  904.   int
  905.   a_dates(appt, flag)
  906.  
  907. --- 81,87 -----
  908.   
  909.   extern struct tm current;    /* current day displayed from calentool */
  910.   int    marked_note;
  911. + int    save_year = -1;
  912.   
  913.   int
  914.   a_dates(appt, flag)
  915. ***************
  916. *** 277,282
  917.       double    day, hday;
  918.       char     *julian_time();
  919.   
  920.       hday = (*func)(current.tm_year+1900);
  921.       gregorian_date(&day, &month, &year, hday);
  922.       if (current.tm_mon == --month && current.tm_mday == (int)day) {
  923.  
  924. --- 278,287 -----
  925.       double    day, hday;
  926.       char     *julian_time();
  927.   
  928. +     if (current.tm_year != save_year) {
  929. +         datelib_init(current.tm_year+1900);
  930. +         save_year = current.tm_year;
  931. +     }
  932.       hday = (*func)(current.tm_year+1900);
  933.       gregorian_date(&day, &month, &year, hday);
  934.       if (current.tm_mon == --month && current.tm_mday == (int)day) {
  935. ***************
  936. *** 284,289
  937.           aptr->month = current.tm_mon;
  938.           aptr->day = current.tm_mday;
  939.           aptr->arrows = aptr->repeat = aptr->lookahead = 0;
  940.           aptr->flags = (A_NOTE | READONLY);
  941.           if (marked_note)
  942.               aptr->flags |= MARKED;
  943.  
  944. --- 289,295 -----
  945.           aptr->month = current.tm_mon;
  946.           aptr->day = current.tm_mday;
  947.           aptr->arrows = aptr->repeat = aptr->lookahead = 0;
  948. +         aptr->runlength = 0;
  949.           aptr->flags = (A_NOTE | READONLY);
  950.           if (marked_note)
  951.               aptr->flags |= MARKED;
  952. ***************
  953. *** 311,316
  954.       int    month, year;
  955.       int    match = 0;
  956.   
  957.       (void)(*func)(current.tm_year+1900, &nr_dates, &date1, &date2, &year1, &year2);
  958.       gregorian_date(&day, &month, &year, date1);
  959.       if (current.tm_mon == --month && current.tm_mday == (int)day)
  960.  
  961. --- 317,326 -----
  962.       int    month, year;
  963.       int    match = 0;
  964.   
  965. +     if (current.tm_year != save_year) {
  966. +         datelib_init(current.tm_year+1900);
  967. +         save_year = current.tm_year;
  968. +     }
  969.       (void)(*func)(current.tm_year+1900, &nr_dates, &date1, &date2, &year1, &year2);
  970.       gregorian_date(&day, &month, &year, date1);
  971.       if (current.tm_mon == --month && current.tm_mday == (int)day)
  972. ***************
  973. *** 325,330
  974.           aptr->month = current.tm_mon;
  975.           aptr->day = current.tm_mday;
  976.           aptr->arrows = aptr->repeat = aptr->lookahead = 0;
  977.           aptr->flags = (A_NOTE | READONLY);
  978.           if (marked_note)
  979.               aptr->flags |= MARKED;
  980.  
  981. --- 335,341 -----
  982.           aptr->month = current.tm_mon;
  983.           aptr->day = current.tm_mday;
  984.           aptr->arrows = aptr->repeat = aptr->lookahead = 0;
  985. +         aptr->runlength = 0;
  986.           aptr->flags = (A_NOTE | READONLY);
  987.           if (marked_note)
  988.               aptr->flags |= MARKED;
  989. ***************
  990. *** 352,357
  991.       double    hday, day;
  992.       char    buf[32];
  993.   
  994.       hday = (*func)(current.tm_year+1900, &jyear);
  995.       gregorian_date(&day, &month, &year, hday);
  996.       if (current.tm_mon == --month && current.tm_mday == (int)day) {
  997.  
  998. --- 363,372 -----
  999.       double    hday, day;
  1000.       char    buf[32];
  1001.   
  1002. +     if (current.tm_year != save_year) {
  1003. +         datelib_init(current.tm_year+1900);
  1004. +         save_year = current.tm_year;
  1005. +     }
  1006.       hday = (*func)(current.tm_year+1900, &jyear);
  1007.       gregorian_date(&day, &month, &year, hday);
  1008.       if (current.tm_mon == --month && current.tm_mday == (int)day) {
  1009. ***************
  1010. *** 360,365
  1011.           aptr->month = current.tm_mon;
  1012.           aptr->day = current.tm_mday;
  1013.           aptr->arrows = aptr->repeat = aptr->lookahead = 0;
  1014.           aptr->flags = (A_NOTE | READONLY);
  1015.           if (marked_note)
  1016.               aptr->flags |= MARKED;
  1017.  
  1018. --- 375,381 -----
  1019.           aptr->month = current.tm_mon;
  1020.           aptr->day = current.tm_mday;
  1021.           aptr->arrows = aptr->repeat = aptr->lookahead = 0;
  1022. +         aptr->runlength = 0;
  1023.           aptr->flags = (A_NOTE | READONLY);
  1024.           if (marked_note)
  1025.               aptr->flags |= MARKED;
  1026. *** /tmp/,RCSt1a16948    Fri Dec 15 17:23:08 1989
  1027. --- init.c    Fri Dec 15 17:17:43 1989
  1028. ***************
  1029. *** 1,5
  1030.   /*
  1031. !  * $Header: init.c,v 2.2 89/07/19 20:27:59 billr Exp $
  1032.    */
  1033.   /*
  1034.    * init.c
  1035.  
  1036. --- 1,5 -----
  1037.   /*
  1038. !  * $Header: init.c,v 2.3 89/12/15 17:17:39 billr Exp $
  1039.    */
  1040.   /*
  1041.    * init.c
  1042. ***************
  1043. *** 424,431
  1044.                   return(1);
  1045.           }
  1046.       }
  1047. !     if (access(apts_pathname, W_OK) == -1)
  1048. !         read_only = 1;
  1049.       /*
  1050.        * set permissions on tmp file based on .appointments file
  1051.        * with the expception that we need at least write permission
  1052.  
  1053. --- 424,432 -----
  1054.                   return(1);
  1055.           }
  1056.       }
  1057. !     if (!read_only)
  1058. !         if (access(apts_pathname, W_OK) == -1)
  1059. !             read_only = 1;
  1060.       /*
  1061.        * set permissions on tmp file based on .appointments file
  1062.        * with the expception that we need at least write permission
  1063. *** /tmp/,RCSt1a16953    Fri Dec 15 17:23:13 1989
  1064. --- mpaint.c    Fri Dec 15 17:17:47 1989
  1065. ***************
  1066. *** 1,5
  1067.   /*
  1068. !  * $Header: mpaint.c,v 2.2 89/07/19 20:29:01 billr Exp $
  1069.    */
  1070.   /*
  1071.    * mpaint.c
  1072.  
  1073. --- 1,5 -----
  1074.   /*
  1075. !  * $Header: mpaint.c,v 2.3 89/12/15 17:17:44 billr Exp $
  1076.    */
  1077.   /*
  1078.    * mpaint.c
  1079. ***************
  1080. *** 52,57
  1081.       int read_stat;
  1082.       struct tm Save;
  1083.       struct appt_entry appt;
  1084.   
  1085.       lock_cursors();
  1086.       /* destory future appts popup, if it exists */
  1087.  
  1088. --- 52,58 -----
  1089.       int read_stat;
  1090.       struct tm Save;
  1091.       struct appt_entry appt;
  1092. +     int runl;
  1093.   
  1094.       lock_cursors();
  1095.       /* destory future appts popup, if it exists */
  1096. ***************
  1097. *** 91,97
  1098.       fix_current_day();
  1099.       Last = current;
  1100.       working(FALSE);
  1101. !     while ((read_stat = get_aentry(apts, &appt)) != EOF) {
  1102.           if (read_stat)
  1103.               continue;    /* read error (ignore) */
  1104.           if (appt.flags & A_COMMENT)
  1105.  
  1106. --- 92,98 -----
  1107.       fix_current_day();
  1108.       Last = current;
  1109.       working(FALSE);
  1110. !     while ((read_stat = get_aentry(apts, &appt, FALSE)) != EOF) {
  1111.           if (read_stat)
  1112.               continue;    /* read error (ignore) */
  1113.           if (appt.flags & A_COMMENT)
  1114. ***************
  1115. *** 125,133
  1116.           } else if ((appt.flags & REPEAT) && !(appt.flags & ALL_DAYS)) {
  1117.               if (appt.flags & EVERY_SOMEDAY)
  1118.                   continue;
  1119. !             while (ymd_compare(current, First) < 0) {
  1120. !                 current.tm_mday += appt.repeat;
  1121. !                 fix_current_day();
  1122.               }
  1123.               while (ymd_compare(current, Last) <= 0) {
  1124.                   busy_today[current.tm_mday-1]++;
  1125.  
  1126. --- 126,142 -----
  1127.           } else if ((appt.flags & REPEAT) && !(appt.flags & ALL_DAYS)) {
  1128.               if (appt.flags & EVERY_SOMEDAY)
  1129.                   continue;
  1130. !             if (appt.flags & RUN)
  1131. !                 runl = appt.runlength;
  1132. !             else
  1133. !                 runl = 1;
  1134. !             while (ymd_compare(current, First) < 0 && runl) {
  1135. !                 if (appt.flags & RUN)
  1136. !                     --runl;
  1137. !                 if (runl) {
  1138. !                     current.tm_mday += appt.repeat;
  1139. !                     fix_current_day();
  1140. !                 }
  1141.               }
  1142.               while (ymd_compare(current, Last) <= 0 && runl) {
  1143.                   if (runl) {
  1144. ***************
  1145. *** 129,138
  1146.                   current.tm_mday += appt.repeat;
  1147.                   fix_current_day();
  1148.               }
  1149. !             while (ymd_compare(current, Last) <= 0) {
  1150. !                 busy_today[current.tm_mday-1]++;
  1151. !                 current.tm_mday += appt.repeat;
  1152. !                 fix_current_day();
  1153.               }
  1154.           } else if (current.tm_year == First.tm_year 
  1155.               && current.tm_mon == First.tm_mon) {
  1156.  
  1157. --- 138,151 -----
  1158.                       fix_current_day();
  1159.                   }
  1160.               }
  1161. !             while (ymd_compare(current, Last) <= 0 && runl) {
  1162. !                 if (runl) {
  1163. !                     busy_today[current.tm_mday-1]++;
  1164. !                     current.tm_mday += appt.repeat;
  1165. !                     fix_current_day();
  1166. !                     if (appt.flags & RUN)
  1167. !                         --runl;
  1168. !                 }
  1169.               }
  1170.           } else if (current.tm_year == First.tm_year 
  1171.               && current.tm_mon == First.tm_mon) {
  1172. ***************
  1173. *** 177,184
  1174.   #endif
  1175.   
  1176.       y = top_border;                /* Draw all day boxes. */
  1177. !     x = 64*start_dow + left_border;
  1178. !         days_in_week = start_dow;
  1179.           c[0] = ' ';
  1180.           c[1] = '1';
  1181.           c[2] = ' ';
  1182.  
  1183. --- 190,207 -----
  1184.   #endif
  1185.   
  1186.       y = top_border;                /* Draw all day boxes. */
  1187. !     if (monday_first) {
  1188. !         if (start_dow == SUN) {
  1189. !             x = 64*6 + left_border;
  1190. !             days_in_week = 6;
  1191. !         } else {
  1192. !             x = 64*(start_dow - 1) + left_border;
  1193. !             days_in_week = start_dow -1 ;
  1194. !         }
  1195. !     } else {
  1196. !         x = 64*start_dow + left_border;
  1197. !         days_in_week = start_dow;
  1198. !     }
  1199.           c[0] = ' ';
  1200.           c[1] = '1';
  1201.           c[2] = ' ';
  1202. ***************
  1203. *** 218,226
  1204.           }
  1205.           x = left_border + 27;
  1206.           y = top_border - 16;
  1207. !     for (i=0; i<7; i++) {        /* Sun Mon ... Sat */
  1208. !         pw_char(main_pixwin,x,y,PIX_SRC,bigfont,daynames[i][0]);
  1209. !                 x += 64;
  1210.           }
  1211.   
  1212.       bottom_border = boxlims[n_days-1].highy;
  1213.  
  1214. --- 241,257 -----
  1215.           }
  1216.           x = left_border + 27;
  1217.           y = top_border - 16;
  1218. !     if (monday_first) {
  1219. !         for (i=1; i<7; i++) {        /* Mon ... Sat Sun */
  1220. !             pw_char(main_pixwin,x,y,PIX_SRC,bigfont,daynames[i][0]);
  1221. !             x += 64;
  1222. !         }
  1223. !         pw_char(main_pixwin,x,y,PIX_SRC,bigfont,daynames[0][0]);
  1224. !     } else {
  1225. !         for (i=0; i<7; i++) {        /* Sun Mon ... Sat */
  1226. !             pw_char(main_pixwin,x,y,PIX_SRC,bigfont,daynames[i][0]);
  1227. !             x += 64;
  1228. !         }
  1229.           }
  1230.   
  1231.       bottom_border = boxlims[n_days-1].highy;
  1232. *** /tmp/,RCSt1a16958    Fri Dec 15 17:23:18 1989
  1233. --- notify.c    Fri Dec 15 17:17:55 1989
  1234. ***************
  1235. *** 1,5
  1236.   /*
  1237. !  * $Header: notify.c,v 2.1 89/05/09 14:23:13 billr Exp $
  1238.    */
  1239.   /*
  1240.    * notify.c
  1241.  
  1242. --- 1,5 -----
  1243.   /*
  1244. !  * $Header: notify.c,v 2.2 89/12/15 17:17:49 billr Exp $
  1245.    */
  1246.   /*
  1247.    * notify.c
  1248. ***************
  1249. *** 53,58
  1250.   extern Panel_item repeat_pi, remind_pi, daysel_pi;
  1251.   extern Panel_item everyx_pi, whichwk_pi, marked_pi;
  1252.   extern Panel_item del_choice_pi, setdate_pi;
  1253.   #ifndef NO_SUN_MOON
  1254.   extern Frame mframe, sframe;
  1255.   extern Panel_item moonbutton_pi, sunbutton_pi;
  1256.  
  1257. --- 53,59 -----
  1258.   extern Panel_item repeat_pi, remind_pi, daysel_pi;
  1259.   extern Panel_item everyx_pi, whichwk_pi, marked_pi;
  1260.   extern Panel_item del_choice_pi, setdate_pi;
  1261. + extern Panel_item runl_pi;
  1262.   #ifndef NO_SUN_MOON
  1263.   extern Frame mframe, sframe;
  1264.   extern Panel_item moonbutton_pi, sunbutton_pi;
  1265. ***************
  1266. *** 77,83
  1267.   extern int show_future;
  1268.   extern int show_time;
  1269.   extern int update_interval;
  1270. - extern char todays_date[], timestr[];
  1271.   extern struct appt_entry shelf_appt;
  1272.   
  1273.   int i;
  1274.  
  1275. --- 78,83 -----
  1276.   extern int show_future;
  1277.   extern int show_time;
  1278.   extern int update_interval;
  1279.   extern struct appt_entry shelf_appt;
  1280.   extern int day_first;
  1281.   
  1282. ***************
  1283. *** 79,84
  1284.   extern int update_interval;
  1285.   extern char todays_date[], timestr[];
  1286.   extern struct appt_entry shelf_appt;
  1287.   
  1288.   int i;
  1289.   
  1290.  
  1291. --- 79,85 -----
  1292.   extern int show_time;
  1293.   extern int update_interval;
  1294.   extern struct appt_entry shelf_appt;
  1295. + extern int day_first;
  1296.   
  1297.   int i;
  1298.   
  1299. ***************
  1300. *** 419,425
  1301.                   break;
  1302.   
  1303.               case 5:    /* change date */
  1304. !                 sprintf(date, "%d/%d/%02d", Save.tm_mon+1, Save.tm_mday, Save.tm_year);
  1305.                   panel_set_value(setdate_pi, date);
  1306.                   do {
  1307.                       window_loop(date_frame);
  1308.  
  1309. --- 420,429 -----
  1310.                   break;
  1311.   
  1312.               case 5:    /* change date */
  1313. !                 if (day_first)
  1314. !                     sprintf(date, "%d/%d/%02d", Save.tm_mday, Save.tm_mon+1, Save.tm_year);
  1315. !                 else
  1316. !                     sprintf(date, "%d/%d/%02d", Save.tm_mon+1, Save.tm_mday, Save.tm_year);
  1317.                   panel_set_value(setdate_pi, date);
  1318.                   do {
  1319.                       window_loop(date_frame);
  1320. ***************
  1321. *** 1018,1023
  1322.               new_entry = 1;
  1323.               flag |= LOOKAHEAD;
  1324.               apt->lookahead = value;
  1325.           }
  1326.       }
  1327.   
  1328.  
  1329. --- 1022,1037 -----
  1330.               new_entry = 1;
  1331.               flag |= LOOKAHEAD;
  1332.               apt->lookahead = value;
  1333. +         }
  1334. +     }
  1335. +     /* get runlength value */
  1336. +     value = atoi((char *)panel_get_value(runl_pi));
  1337. +     if (value > 0) {
  1338. +         if (apt->runlength != value) {
  1339. +             new_entry = 1;
  1340. +             flag |= RUN;
  1341. +             apt->runlength = value;
  1342.           }
  1343.       }
  1344.   
  1345. *** /tmp/,RCSt1a16963    Fri Dec 15 17:23:25 1989
  1346. --- paint.h    Fri Dec 15 17:17:59 1989
  1347. ***************
  1348. *** 1,5
  1349.   /*
  1350. !  * $Header: paint.h,v 2.1 89/05/09 14:25:24 billr Exp $
  1351.    */
  1352.   /*
  1353.    * paint.h
  1354.  
  1355. --- 1,5 -----
  1356.   /*
  1357. !  * $Header: paint.h,v 2.2 89/12/15 17:17:57 billr Exp $
  1358.    */
  1359.   /*
  1360.    * paint.h
  1361. ***************
  1362. *** 22,27
  1363.    * notice remains intact.
  1364.    */
  1365.   
  1366.   #include <suntool/panel.h>
  1367.   
  1368.   extern Pixfont *font, *bigfont;
  1369.  
  1370. --- 22,28 -----
  1371.    * notice remains intact.
  1372.    */
  1373.   
  1374. + #ifndef NOTOOL
  1375.   #include <suntool/panel.h>
  1376.   
  1377.   extern Pixfont *font, *bigfont;
  1378. ***************
  1379. *** 27,34
  1380.   extern Pixfont *font, *bigfont;
  1381.   extern Canvas canvas;
  1382.   extern Pixwin *main_pixwin;
  1383. - extern struct tm current, today, First, Last;
  1384. - extern struct dayslot slots[];
  1385.   extern Pixrect *timeslot_pr, *daybox_pr, *weekarrow_pr,  *weekslot_pr;
  1386.   extern Pixrect *weekarrowshaft_pr, *weekarrowhead_pr;
  1387.   extern Pixrect *triangle_pr;
  1388.  
  1389. --- 28,33 -----
  1390.   extern Pixfont *font, *bigfont;
  1391.   extern Canvas canvas;
  1392.   extern Pixwin *main_pixwin;
  1393.   extern Pixrect *timeslot_pr, *daybox_pr, *weekarrow_pr,  *weekslot_pr;
  1394.   extern Pixrect *weekarrowshaft_pr, *weekarrowhead_pr;
  1395.   extern Pixrect *triangle_pr;
  1396. ***************
  1397. *** 38,44
  1398.   extern struct weekrect week_boxes[];
  1399.   extern int x_coord, y_coord, startx, starty;
  1400.   extern int mainsw_state;
  1401. - extern int dayslot_width, nr_weekdays, max_strlen, n_tslots;
  1402.   extern int dayslot_height, weekslot_height, weekslot_width;
  1403.   extern int ybox_height, ybox_width;
  1404.   extern struct rect_limits boxlims[];
  1405.  
  1406. --- 37,42 -----
  1407.   extern struct weekrect week_boxes[];
  1408.   extern int x_coord, y_coord, startx, starty;
  1409.   extern int mainsw_state;
  1410.   extern int dayslot_height, weekslot_height, weekslot_width;
  1411.   extern int ybox_height, ybox_width;
  1412.   extern struct rect_limits boxlims[];
  1413. ***************
  1414. *** 44,49
  1415.   extern struct rect_limits boxlims[];
  1416.   extern struct rect_limits mboxlims[];
  1417.   extern struct week_arrow week_arrows[];
  1418.   extern char apts_pathname[], tmpapts_pathname[];
  1419.   extern int read_only, day_is_open, version2;
  1420.   extern char *progname;
  1421.  
  1422. --- 42,50 -----
  1423.   extern struct rect_limits boxlims[];
  1424.   extern struct rect_limits mboxlims[];
  1425.   extern struct week_arrow week_arrows[];
  1426. + extern Frame fframe;
  1427. + extern int hour24, monday_first, day_first;
  1428. + #endif  /* NOTOOL */
  1429.   extern char apts_pathname[], tmpapts_pathname[];
  1430.   extern int read_only, day_is_open, version2;
  1431.   extern char *progname;
  1432. ***************
  1433. *** 47,53
  1434.   extern char apts_pathname[], tmpapts_pathname[];
  1435.   extern int read_only, day_is_open, version2;
  1436.   extern char *progname;
  1437. - extern Frame fframe;
  1438.   extern char *daynames[], *monthnames[];
  1439.   #ifndef NO_HOLIDAYS
  1440.   extern int holiday_a, holiday_c, holiday_i, holiday_j, holiday_s;
  1441.  
  1442. --- 48,53 -----
  1443.   extern char apts_pathname[], tmpapts_pathname[];
  1444.   extern int read_only, day_is_open, version2;
  1445.   extern char *progname;
  1446.   extern char *daynames[], *monthnames[];
  1447.   extern int dayslot_width, nr_weekdays, max_strlen, n_tslots;
  1448.   extern struct tm current, today, First, Last;
  1449. ***************
  1450. *** 49,54
  1451.   extern char *progname;
  1452.   extern Frame fframe;
  1453.   extern char *daynames[], *monthnames[];
  1454.   #ifndef NO_HOLIDAYS
  1455.   extern int holiday_a, holiday_c, holiday_i, holiday_j, holiday_s;
  1456.   
  1457.  
  1458. --- 49,57 -----
  1459.   extern int read_only, day_is_open, version2;
  1460.   extern char *progname;
  1461.   extern char *daynames[], *monthnames[];
  1462. + extern int dayslot_width, nr_weekdays, max_strlen, n_tslots;
  1463. + extern struct tm current, today, First, Last;
  1464. + extern struct dayslot slots[];
  1465.   #ifndef NO_HOLIDAYS
  1466.   extern int holiday_a, holiday_c, holiday_i, holiday_j, holiday_s;
  1467.   
  1468. *** /tmp/,RCSt1a16968    Fri Dec 15 17:23:28 1989
  1469. --- patchlevel.h    Fri Dec 15 17:18:02 1989
  1470. ***************
  1471. *** 1,5
  1472.   /*
  1473. !  * $Header: patchlevel.h,v 2.5 89/09/19 06:19:56 billr Exp $
  1474.    */
  1475.   /*
  1476.    * patchlevel.h - current patchlevel of calentool program
  1477.  
  1478. --- 1,5 -----
  1479.   /*
  1480. !  * $Header: patchlevel.h,v 2.6 89/12/15 17:18:00 billr Exp $
  1481.    */
  1482.   /*
  1483.    * patchlevel.h - current patchlevel of calentool program
  1484. ***************
  1485. *** 5,8
  1486.    * patchlevel.h - current patchlevel of calentool program
  1487.    */
  1488.   
  1489. ! #define PATCHLEVEL    4
  1490.  
  1491. --- 5,8 -----
  1492.    * patchlevel.h - current patchlevel of calentool program
  1493.    */
  1494.   
  1495. ! #define PATCHLEVEL    5
  1496. *** /tmp/,RCSt1a16973    Fri Dec 15 17:23:32 1989
  1497. --- put_aentry.c    Fri Dec 15 17:18:06 1989
  1498. ***************
  1499. *** 1,5
  1500.   /*
  1501. !  * $Header: put_aentry.c,v 2.1 89/05/09 14:19:36 billr Exp $
  1502.    */
  1503.   /*
  1504.    * put_aentry - write calentool style files
  1505.  
  1506. --- 1,5 -----
  1507.   /*
  1508. !  * $Header: put_aentry.c,v 2.2 89/12/15 17:18:04 billr Exp $
  1509.    */
  1510.   /*
  1511.    * put_aentry - write calentool style files
  1512. ***************
  1513. *** 91,96
  1514.   
  1515.       if (appt->flags & LOOKAHEAD)
  1516.           fprintf(apts_file, "<%d> ", appt->lookahead);
  1517.       if (appt->flags & DELETED)
  1518.           fprintf(apts_file, "# %s", appt->str);
  1519.       else
  1520.  
  1521. --- 91,98 -----
  1522.   
  1523.       if (appt->flags & LOOKAHEAD)
  1524.           fprintf(apts_file, "<%d> ", appt->lookahead);
  1525. +     if (appt->flags & RUN)
  1526. +         fprintf(apts_file, "+%d ", appt->runlength);
  1527.       if (appt->flags & DELETED)
  1528.           fprintf(apts_file, "# %s", appt->str);
  1529.       else
  1530. *** /tmp/,RCSt1a16978    Fri Dec 15 17:23:36 1989
  1531. --- ras2ps.c    Fri Dec 15 17:18:10 1989
  1532. ***************
  1533. *** 1,5
  1534.   /*
  1535. !  * $Header: ras2ps.c,v 2.2 89/07/19 20:30:25 billr Exp $
  1536.    */
  1537.   /*
  1538.    * ras2ps - convert Sun raster file to RLL Postscript file
  1539.  
  1540. --- 1,5 -----
  1541.   /*
  1542. !  * $Header: ras2ps.c,v 2.3 89/12/15 17:18:07 billr Exp $
  1543.    */
  1544.   /*
  1545.    * ras2ps - convert Sun raster file to RLL Postscript file
  1546. ***************
  1547. *** 91,97
  1548.        sizey = 10.0;
  1549.        transx = transy = 0.5;
  1550.        inv = 0;
  1551. !      rotate = 90.0;
  1552.        ofile = outfile;
  1553.        
  1554.        if (pr_load_header(infile, &rh) != 0)
  1555.  
  1556. --- 91,97 -----
  1557.        sizey = 10.0;
  1558.        transx = transy = 0.5;
  1559.        inv = 0;
  1560. !      rotate = 0.0;
  1561.        ofile = outfile;
  1562.        
  1563.        if (pr_load_header(infile, &rh) != 0)
  1564. *** /tmp/,RCSt1a16983    Fri Dec 15 17:23:40 1989
  1565. --- riseset.c    Fri Dec 15 17:18:14 1989
  1566. ***************
  1567. *** 1,5
  1568.   /*
  1569. !  * $Header: riseset.c,v 2.2 89/07/19 20:31:05 billr Exp $
  1570.    */
  1571.   /*
  1572.    * riseset.c
  1573.  
  1574. --- 1,5 -----
  1575.   /*
  1576. !  * $Header: riseset.c,v 2.3 89/12/15 17:18:11 billr Exp $
  1577.    */
  1578.   /*
  1579.    * riseset.c
  1580. ***************
  1581. *** 46,51
  1582.   #include "riseset.h"
  1583.   
  1584.   extern char *daynames[], *monthnames[];
  1585.   
  1586.   long    UTC, TDT, tim, tim2;
  1587.   double    Julian_Day, MJD, Tu, Ru, T70, Local, GMST, LST;
  1588.  
  1589. --- 46,52 -----
  1590.   #include "riseset.h"
  1591.   
  1592.   extern char *daynames[], *monthnames[];
  1593. + extern int day_first;
  1594.   
  1595.   long    UTC, TDT, tim, tim2;
  1596.   double    Julian_Day, MJD, Tu, Ru, T70, Local, GMST, LST;
  1597. ***************
  1598. *** 134,141
  1599.       ltm = localtime(&UTC);
  1600.       sprintf(riseset_buf[B_LCT], "%.24s Local Civil Time", asctime(ltm));
  1601.   
  1602. !     sprintf(riseset_buf[B_DMY], "%s %s %d, %d", daynames[ltm->tm_wday],
  1603. !         monthnames[ltm->tm_mon], ltm->tm_mday, ltm->tm_year+1900);
  1604.       tim2 = UTC + (long)(Local + Round);    /* Compute Local Solar Time */
  1605.       tdate= gmctime(&tim2);
  1606.       *(tdate+19) = '\0';
  1607.  
  1608. --- 135,146 -----
  1609.       ltm = localtime(&UTC);
  1610.       sprintf(riseset_buf[B_LCT], "%.24s Local Civil Time", asctime(ltm));
  1611.   
  1612. !     if (day_first)
  1613. !         sprintf(riseset_buf[B_DMY], "%s %d %s %d", daynames[ltm->tm_wday],
  1614. !             ltm->tm_mday, monthnames[ltm->tm_mon], ltm->tm_year+1900);
  1615. !     else
  1616. !         sprintf(riseset_buf[B_DMY], "%s %s %d, %d", daynames[ltm->tm_wday],
  1617. !             monthnames[ltm->tm_mon], ltm->tm_mday, ltm->tm_year+1900);
  1618.       tim2 = UTC + (long)(Local + Round);    /* Compute Local Solar Time */
  1619.       tdate= gmctime(&tim2);
  1620.       *(tdate+19) = '\0';
  1621. *** /tmp/,RCSt1a16988    Fri Dec 15 17:23:45 1989
  1622. --- tool.c    Fri Dec 15 17:18:22 1989
  1623. ***************
  1624. *** 1,5
  1625.   /*
  1626. !  * $Header: tool.c,v 2.2 89/07/19 20:31:31 billr Exp $
  1627.    */
  1628.   /*
  1629.    * tool.c
  1630.  
  1631. --- 1,5 -----
  1632.   /*
  1633. !  * $Header: tool.c,v 2.3 89/12/15 17:18:15 billr Exp $
  1634.    */
  1635.   /*
  1636.    * tool.c
  1637. ***************
  1638. *** 45,50
  1639.   Panel_item monthmenu_pi, yearmenu_pi, weekbutton_pi, daybutton_pi;
  1640.   Panel_item previous_pi, next_pi, current_pi, filebutton_pi;
  1641.   Panel_item clock_pi;
  1642.   #ifndef NO_PRINTER
  1643.   Panel_item printbutton_pi;
  1644.   #endif
  1645.  
  1646. --- 45,51 -----
  1647.   Panel_item monthmenu_pi, yearmenu_pi, weekbutton_pi, daybutton_pi;
  1648.   Panel_item previous_pi, next_pi, current_pi, filebutton_pi;
  1649.   Panel_item clock_pi;
  1650. + Panel_item runl_pi;
  1651.   #ifndef NO_PRINTER
  1652.   Panel_item printbutton_pi;
  1653.   #endif
  1654. ***************
  1655. *** 125,130
  1656.   Notify_value check_close();
  1657.   int monthlength();
  1658.   char year_str[NR_YEARS][5]; /* holds strings for year menu */
  1659.   extern Pixwin *main_pixwin;
  1660.   extern Cursor day_cursor, wait_cursor;
  1661.   extern int day_is_open, mainsw_state;
  1662.  
  1663. --- 126,132 -----
  1664.   Notify_value check_close();
  1665.   int monthlength();
  1666.   char year_str[NR_YEARS][5]; /* holds strings for year menu */
  1667. + Rect *closed_rect;
  1668.   extern Pixwin *main_pixwin;
  1669.   extern Cursor day_cursor, wait_cursor;
  1670.   extern int day_is_open, mainsw_state;
  1671. ***************
  1672. *** 128,134
  1673.   extern Pixwin *main_pixwin;
  1674.   extern Cursor day_cursor, wait_cursor;
  1675.   extern int day_is_open, mainsw_state;
  1676. ! extern char todays_date[];
  1677.   extern struct appt_entry future[];
  1678.   extern int findex;
  1679.   extern struct dayslot slots[];
  1680.  
  1681. --- 130,136 -----
  1682.   extern Pixwin *main_pixwin;
  1683.   extern Cursor day_cursor, wait_cursor;
  1684.   extern int day_is_open, mainsw_state;
  1685. ! extern char clockstr[];
  1686.   extern struct appt_entry future[];
  1687.   extern int findex;
  1688.   extern struct dayslot slots[];
  1689. ***************
  1690. *** 136,141
  1691.   extern Pixrect moon_icon_pr, sun_icon_pr;
  1692.   #endif
  1693.   extern char printer[];
  1694.   
  1695.   /* Create and init control panel */
  1696.   create_panel()
  1697.  
  1698. --- 138,144 -----
  1699.   extern Pixrect moon_icon_pr, sun_icon_pr;
  1700.   #endif
  1701.   extern char printer[];
  1702. + extern int day_first;
  1703.   
  1704.   /* Create and init control panel */
  1705.   create_panel()
  1706. ***************
  1707. *** 288,293
  1708.   
  1709.       width = (int)window_get(panel, WIN_WIDTH);
  1710.   
  1711.       clock_pi = panel_create_item(panel, PANEL_MESSAGE,
  1712.               PANEL_ITEM_X, width-150-(strlen(todays_date)*font->pf_defaultsize.x),
  1713.               PANEL_ITEM_Y, ATTR_ROW(2)+3,
  1714.  
  1715. --- 291,297 -----
  1716.   
  1717.       width = (int)window_get(panel, WIN_WIDTH);
  1718.   
  1719. +     get_today();    /* get current date and time */
  1720.       clock_pi = panel_create_item(panel, PANEL_MESSAGE,
  1721.               PANEL_ITEM_X, width-150-(strlen(clockstr)*font->pf_defaultsize.x),
  1722.               PANEL_ITEM_Y, ATTR_ROW(2)+3,
  1723. ***************
  1724. *** 289,295
  1725.       width = (int)window_get(panel, WIN_WIDTH);
  1726.   
  1727.       clock_pi = panel_create_item(panel, PANEL_MESSAGE,
  1728. !             PANEL_ITEM_X, width-150-(strlen(todays_date)*font->pf_defaultsize.x),
  1729.               PANEL_ITEM_Y, ATTR_ROW(2)+3,
  1730.               PANEL_LABEL_STRING, todays_date,
  1731.               PANEL_LABEL_FONT, font,
  1732.  
  1733. --- 293,299 -----
  1734.   
  1735.       get_today();    /* get current date and time */
  1736.       clock_pi = panel_create_item(panel, PANEL_MESSAGE,
  1737. !             PANEL_ITEM_X, width-150-(strlen(clockstr)*font->pf_defaultsize.x),
  1738.               PANEL_ITEM_Y, ATTR_ROW(2)+3,
  1739.               PANEL_LABEL_STRING, clockstr,
  1740.               PANEL_LABEL_FONT, font,
  1741. ***************
  1742. *** 291,297
  1743.       clock_pi = panel_create_item(panel, PANEL_MESSAGE,
  1744.               PANEL_ITEM_X, width-150-(strlen(todays_date)*font->pf_defaultsize.x),
  1745.               PANEL_ITEM_Y, ATTR_ROW(2)+3,
  1746. !             PANEL_LABEL_STRING, todays_date,
  1747.               PANEL_LABEL_FONT, font,
  1748.               0);
  1749.   
  1750.  
  1751. --- 295,301 -----
  1752.       clock_pi = panel_create_item(panel, PANEL_MESSAGE,
  1753.               PANEL_ITEM_X, width-150-(strlen(clockstr)*font->pf_defaultsize.x),
  1754.               PANEL_ITEM_Y, ATTR_ROW(2)+3,
  1755. !             PANEL_LABEL_STRING, clockstr,
  1756.               PANEL_LABEL_FONT, font,
  1757.               0);
  1758.   
  1759. ***************
  1760. *** 479,485
  1761.       if (!fframe) {
  1762.           /* create new frame and control panel */
  1763.           fframe = window_create(frame, FRAME, FRAME_NO_CONFIRM, TRUE,
  1764. !                 WIN_SHOW, TRUE, WIN_X, ATTR_COL(12),
  1765.                   WIN_Y, slots[N_SLOTS-4].slot_pos.top,
  1766.                   FRAME_LABEL, "Future Appointments",
  1767.                   FRAME_SHOW_LABEL, TRUE,
  1768.  
  1769. --- 483,489 -----
  1770.       if (!fframe) {
  1771.           /* create new frame and control panel */
  1772.           fframe = window_create(frame, FRAME, FRAME_NO_CONFIRM, TRUE,
  1773. !                 WIN_X, ATTR_COL(12),
  1774.                   WIN_Y, slots[N_SLOTS-4].slot_pos.top,
  1775.                   FRAME_LABEL, "Future Appointments",
  1776.                   FRAME_SHOW_LABEL, TRUE,
  1777. ***************
  1778. *** 484,489
  1779.                   FRAME_LABEL, "Future Appointments",
  1780.                   FRAME_SHOW_LABEL, TRUE,
  1781.                   WIN_ERROR_MSG, "Can't create future frame.",
  1782.                   0);
  1783.   
  1784.           fcpanel = window_create(fframe, PANEL, 0);
  1785.  
  1786. --- 488,494 -----
  1787.                   FRAME_LABEL, "Future Appointments",
  1788.                   FRAME_SHOW_LABEL, TRUE,
  1789.                   WIN_ERROR_MSG, "Can't create future frame.",
  1790. +                 FRAME_CLOSED_RECT, closed_rect,
  1791.                   0);
  1792.   
  1793.           fcpanel = window_create(fframe, PANEL, 0);
  1794. ***************
  1795. *** 553,558
  1796.                   0);
  1797.       }
  1798.       window_fit(fframe);
  1799.   }
  1800.   
  1801.   /*
  1802.  
  1803. --- 558,564 -----
  1804.                   0);
  1805.       }
  1806.       window_fit(fframe);
  1807. +     window_set(fframe, WIN_SHOW, TRUE, 0);
  1808.   }
  1809.   
  1810.   /*
  1811. ***************
  1812. *** 567,572
  1813.       attr_frame = window_create(frame, FRAME, FRAME_NO_CONFIRM, TRUE,
  1814.               FRAME_SHOW_LABEL, FALSE,
  1815.               WIN_ERROR_MSG, "Can't create attributes frame.",
  1816.               0);
  1817.   
  1818.       attr_panel = window_create(attr_frame, PANEL,
  1819.  
  1820. --- 573,579 -----
  1821.       attr_frame = window_create(frame, FRAME, FRAME_NO_CONFIRM, TRUE,
  1822.               FRAME_SHOW_LABEL, FALSE,
  1823.               WIN_ERROR_MSG, "Can't create attributes frame.",
  1824. +             FRAME_CLOSED_RECT, closed_rect,
  1825.               0);
  1826.   
  1827.       attr_panel = window_create(attr_frame, PANEL,
  1828. ***************
  1829. *** 631,636
  1830.               PANEL_BLINK_CARET, TRUE,
  1831.               0);
  1832.       
  1833.       remind_pi = panel_create_item(attr_panel, PANEL_TEXT,
  1834.               PANEL_SHOW_ITEM, TRUE,
  1835.               PANEL_LABEL_STRING,
  1836.  
  1837. --- 638,654 -----
  1838.               PANEL_BLINK_CARET, TRUE,
  1839.               0);
  1840.       
  1841. +     runl_pi = panel_create_item(attr_panel, PANEL_TEXT,
  1842. +             PANEL_SHOW_ITEM, TRUE,
  1843. +             PANEL_LABEL_STRING,
  1844. +             "Repeat specified number of times (default forever):",
  1845. +             PANEL_VALUE, 0, PANEL_VALUE_STORED_LENGTH, 4,
  1846. +             PANEL_VALUE_DISPLAY_LENGTH, 4,
  1847. +             PANEL_ITEM_X, ATTR_COL(1),
  1848. +             PANEL_ITEM_Y, ATTR_ROW(4),
  1849. +             PANEL_BLINK_CARET, TRUE,
  1850. +             0);
  1851.       remind_pi = panel_create_item(attr_panel, PANEL_TEXT,
  1852.               PANEL_SHOW_ITEM, TRUE,
  1853.               PANEL_LABEL_STRING,
  1854. ***************
  1855. *** 638,644
  1856.               PANEL_VALUE, 0, PANEL_VALUE_STORED_LENGTH, 4,
  1857.               PANEL_VALUE_DISPLAY_LENGTH, 4,
  1858.               PANEL_ITEM_X, ATTR_COL(1),
  1859. !             PANEL_ITEM_Y, ATTR_ROW(4),
  1860.               PANEL_BLINK_CARET, TRUE,
  1861.               0);
  1862.   
  1863.  
  1864. --- 656,662 -----
  1865.               PANEL_VALUE, 0, PANEL_VALUE_STORED_LENGTH, 4,
  1866.               PANEL_VALUE_DISPLAY_LENGTH, 4,
  1867.               PANEL_ITEM_X, ATTR_COL(1),
  1868. !             PANEL_ITEM_Y, ATTR_ROW(5),
  1869.               PANEL_BLINK_CARET, TRUE,
  1870.               0);
  1871.   
  1872. ***************
  1873. *** 651,657
  1874.               "Mark in month/year display:",
  1875.               PANEL_CHOICE_STRINGS, "Yes", "No", 0,
  1876.               PANEL_ITEM_X, ATTR_COL(1),
  1877. !             PANEL_ITEM_Y, ATTR_ROW(5),
  1878.               0);
  1879.   
  1880.       window_fit(attr_panel);
  1881.  
  1882. --- 669,675 -----
  1883.               "Mark in month/year display:",
  1884.               PANEL_CHOICE_STRINGS, "Yes", "No", 0,
  1885.               PANEL_ITEM_X, ATTR_COL(1),
  1886. !             PANEL_ITEM_Y, ATTR_ROW(6),
  1887.               0);
  1888.   
  1889.       window_fit(attr_panel);
  1890. ***************
  1891. *** 667,672
  1892.       del_frame = window_create(frame, FRAME, FRAME_NO_CONFIRM, TRUE,
  1893.               FRAME_SHOW_LABEL, FALSE,
  1894.               WIN_ERROR_MSG, "Can't create delete frame.",
  1895.               0);
  1896.   
  1897.       del_panel = window_create(del_frame, PANEL,
  1898.  
  1899. --- 685,691 -----
  1900.       del_frame = window_create(frame, FRAME, FRAME_NO_CONFIRM, TRUE,
  1901.               FRAME_SHOW_LABEL, FALSE,
  1902.               WIN_ERROR_MSG, "Can't create delete frame.",
  1903. +             FRAME_CLOSED_RECT, closed_rect,
  1904.               0);
  1905.   
  1906.       del_panel = window_create(del_frame, PANEL,
  1907. ***************
  1908. *** 720,726
  1909.       /* create new frame and canvas */
  1910.       if (!sframe) {
  1911.           sframe = window_create(frame, FRAME, FRAME_NO_CONFIRM, TRUE,
  1912. !                 WIN_SHOW, TRUE, WIN_X, ATTR_COL(12),
  1913.                   FRAME_LABEL, "Solar Data",
  1914.                   FRAME_SHOW_LABEL, TRUE,
  1915.                   FRAME_DONE_PROC, sframe_done,
  1916.  
  1917. --- 739,745 -----
  1918.       /* create new frame and canvas */
  1919.       if (!sframe) {
  1920.           sframe = window_create(frame, FRAME, FRAME_NO_CONFIRM, TRUE,
  1921. !                 WIN_X, ATTR_COL(12),
  1922.                   FRAME_LABEL, "Solar Data",
  1923.                   FRAME_SHOW_LABEL, TRUE,
  1924.                   FRAME_DONE_PROC, sframe_done,
  1925. ***************
  1926. *** 725,730
  1927.                   FRAME_SHOW_LABEL, TRUE,
  1928.                   FRAME_DONE_PROC, sframe_done,
  1929.                   WIN_ERROR_MSG, "Can't create sun data frame.",
  1930.                   0);
  1931.   
  1932.           spanel = window_create(sframe, PANEL, WIN_FONT, font,
  1933.  
  1934. --- 744,750 -----
  1935.                   FRAME_SHOW_LABEL, TRUE,
  1936.                   FRAME_DONE_PROC, sframe_done,
  1937.                   WIN_ERROR_MSG, "Can't create sun data frame.",
  1938. +                 FRAME_CLOSED_RECT, closed_rect,
  1939.                   0);
  1940.   
  1941.           spanel = window_create(sframe, PANEL, WIN_FONT, font,
  1942. ***************
  1943. *** 759,764
  1944.       
  1945.           write_sun_data();
  1946.           window_fit(sframe);
  1947.       } else
  1948.           write_sun_data();
  1949.   }
  1950.  
  1951. --- 779,785 -----
  1952.       
  1953.           write_sun_data();
  1954.           window_fit(sframe);
  1955. +         window_set(sframe, WIN_SHOW, TRUE, 0);
  1956.       } else
  1957.           write_sun_data();
  1958.   }
  1959. ***************
  1960. *** 773,779
  1961.       /* create new frame and canvas */
  1962.       if (!mframe) {
  1963.           mframe = window_create(frame, FRAME, FRAME_NO_CONFIRM, TRUE,
  1964. !                 WIN_SHOW, TRUE, WIN_X, ATTR_COL(12),
  1965.                   FRAME_LABEL, "Lunar Data",
  1966.                   FRAME_SHOW_LABEL, TRUE,
  1967.                   FRAME_INHERIT_COLORS, TRUE,
  1968.  
  1969. --- 794,800 -----
  1970.       /* create new frame and canvas */
  1971.       if (!mframe) {
  1972.           mframe = window_create(frame, FRAME, FRAME_NO_CONFIRM, TRUE,
  1973. !                 WIN_X, ATTR_COL(12),
  1974.                   FRAME_LABEL, "Lunar Data",
  1975.                   FRAME_SHOW_LABEL, TRUE,
  1976.                   FRAME_FOREGROUND_COLOR, &fg_default,
  1977. ***************
  1978. *** 776,782
  1979.                   WIN_SHOW, TRUE, WIN_X, ATTR_COL(12),
  1980.                   FRAME_LABEL, "Lunar Data",
  1981.                   FRAME_SHOW_LABEL, TRUE,
  1982. -                 FRAME_INHERIT_COLORS, TRUE,
  1983.                   FRAME_FOREGROUND_COLOR, &fg_default,
  1984.                   FRAME_BACKGROUND_COLOR, &bg_default,
  1985.                   FRAME_DONE_PROC, mframe_done,
  1986.  
  1987. --- 797,802 -----
  1988.                   WIN_X, ATTR_COL(12),
  1989.                   FRAME_LABEL, "Lunar Data",
  1990.                   FRAME_SHOW_LABEL, TRUE,
  1991.                   FRAME_FOREGROUND_COLOR, &fg_default,
  1992.                   FRAME_BACKGROUND_COLOR, &bg_default,
  1993.                   FRAME_DONE_PROC, mframe_done,
  1994. ***************
  1995. *** 781,786
  1996.                   FRAME_BACKGROUND_COLOR, &bg_default,
  1997.                   FRAME_DONE_PROC, mframe_done,
  1998.                   WIN_ERROR_MSG, "Can't create moon data frame.",
  1999.                   0);
  2000.   
  2001.           mpanel = window_create(mframe, PANEL, WIN_FONT, font,
  2002.  
  2003. --- 801,807 -----
  2004.                   FRAME_BACKGROUND_COLOR, &bg_default,
  2005.                   FRAME_DONE_PROC, mframe_done,
  2006.                   WIN_ERROR_MSG, "Can't create moon data frame.",
  2007. +                 FRAME_CLOSED_RECT, closed_rect,
  2008.                   0);
  2009.   
  2010.           mpanel = window_create(mframe, PANEL, WIN_FONT, font,
  2011. ***************
  2012. *** 816,821
  2013.       
  2014.           write_moon_data();
  2015.           window_fit(mframe);
  2016.       } else
  2017.           write_moon_data();
  2018.   }
  2019.  
  2020. --- 837,843 -----
  2021.       
  2022.           write_moon_data();
  2023.           window_fit(mframe);
  2024. +         window_set(mframe, WIN_SHOW, TRUE, 0);
  2025.       } else
  2026.           write_moon_data();
  2027.   }
  2028. ***************
  2029. *** 833,838
  2030.               FRAME_SHOW_LABEL, TRUE,
  2031.               FRAME_DONE_PROC, fileframe_done,
  2032.               WIN_ERROR_MSG, "Can't create file frame.",
  2033.               0);
  2034.   
  2035.       filepanel = window_create(fileframe, PANEL, WIN_FONT, font,
  2036.  
  2037. --- 855,861 -----
  2038.               FRAME_SHOW_LABEL, TRUE,
  2039.               FRAME_DONE_PROC, fileframe_done,
  2040.               WIN_ERROR_MSG, "Can't create file frame.",
  2041. +             FRAME_CLOSED_RECT, closed_rect,
  2042.               0);
  2043.   
  2044.       filepanel = window_create(fileframe, PANEL, WIN_FONT, font,
  2045. ***************
  2046. *** 925,930
  2047.                   WIN_SHOW, TRUE,
  2048.                   WIN_X, ATTR_COL(15), WIN_Y, ATTR_ROW(15),
  2049.                   WIN_ERROR_MSG, "Can't create error frame.",
  2050.                   0);
  2051.   
  2052.           prompt_panel = window_create(prompt_frame, PANEL,
  2053.  
  2054. --- 948,954 -----
  2055.                   WIN_SHOW, TRUE,
  2056.                   WIN_X, ATTR_COL(15), WIN_Y, ATTR_ROW(15),
  2057.                   WIN_ERROR_MSG, "Can't create error frame.",
  2058. +                 FRAME_CLOSED_RECT, closed_rect,
  2059.                   0);
  2060.   
  2061.           prompt_panel = window_create(prompt_frame, PANEL,
  2062. ***************
  2063. *** 995,1000
  2064.               FRAME_SHOW_LABEL, TRUE,
  2065.               FRAME_DONE_PROC, prframe_done,
  2066.               WIN_ERROR_MSG, "Can't create printer frame.",
  2067.               0);
  2068.   
  2069.       prpanel = window_create(prframe, PANEL, WIN_FONT, font,
  2070.  
  2071. --- 1019,1025 -----
  2072.               FRAME_SHOW_LABEL, TRUE,
  2073.               FRAME_DONE_PROC, prframe_done,
  2074.               WIN_ERROR_MSG, "Can't create printer frame.",
  2075. +             FRAME_CLOSED_RECT, closed_rect,
  2076.               0);
  2077.   
  2078.       prpanel = window_create(prframe, PANEL, WIN_FONT, font,
  2079. ***************
  2080. *** 1039,1044
  2081.               FRAME_SHOW_LABEL, TRUE,
  2082.               FRAME_DONE_PROC, dtframe_done,
  2083.               WIN_ERROR_MSG, "Can't create date frame.",
  2084.               0);
  2085.   
  2086.       dtpanel = window_create(date_frame, PANEL, WIN_FONT, font,
  2087.  
  2088. --- 1064,1070 -----
  2089.               FRAME_SHOW_LABEL, TRUE,
  2090.               FRAME_DONE_PROC, dtframe_done,
  2091.               WIN_ERROR_MSG, "Can't create date frame.",
  2092. +             FRAME_CLOSED_RECT, closed_rect,
  2093.               0);
  2094.   
  2095.       dtpanel = window_create(date_frame, PANEL, WIN_FONT, font,
  2096. ***************
  2097. *** 1057,1063
  2098.               PANEL_SHOW_ITEM, TRUE,
  2099.               PANEL_ITEM_X, ATTR_COL(1),
  2100.               PANEL_ITEM_Y, ATTR_ROW(1)+5,
  2101. !             PANEL_LABEL_STRING, "Enter date (D, M/D, or M/D/Y):",
  2102.               PANEL_LABEL_FONT, font,
  2103.               PANEL_LABEL_BOLD, TRUE,
  2104.               PANEL_VALUE_STORED_LENGTH, 10,
  2105.  
  2106. --- 1083,1089 -----
  2107.               PANEL_SHOW_ITEM, TRUE,
  2108.               PANEL_ITEM_X, ATTR_COL(1),
  2109.               PANEL_ITEM_Y, ATTR_ROW(1)+5,
  2110. !             PANEL_LABEL_STRING, (day_first ? "Enter date (D, D/M, or D/M/Y):" : "Enter date (D, M/D, or M/D/Y):"),
  2111.               PANEL_LABEL_FONT, font,
  2112.               PANEL_LABEL_BOLD, TRUE,
  2113.               PANEL_VALUE_STORED_LENGTH, 10,
  2114. ***************
  2115. *** 1065,1071
  2116.               PANEL_BLINK_CARET, TRUE,
  2117.               0);
  2118.       
  2119. !     sprintf(date, "%d/%d/%02d", current.tm_mon+1, current.tm_mday, current.tm_year);
  2120.       panel_set_value(setdate_pi, date);
  2121.       window_fit(dtpanel);
  2122.       window_fit(date_frame);
  2123.  
  2124. --- 1091,1100 -----
  2125.               PANEL_BLINK_CARET, TRUE,
  2126.               0);
  2127.       
  2128. !     if (day_first)
  2129. !         sprintf(date, "%d/%d/%02d", current.tm_mday, current.tm_mon+1, current.tm_year);
  2130. !     else
  2131. !         sprintf(date, "%d/%d/%02d", current.tm_mon+1, current.tm_mday, current.tm_year);
  2132.       panel_set_value(setdate_pi, date);
  2133.       window_fit(dtpanel);
  2134.       window_fit(date_frame);
  2135.