home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume17 / calentool / part08 / dpaint.c
Encoding:
C/C++ Source or Header  |  1991-04-06  |  15.7 KB  |  527 lines

  1. /*
  2.  * $Header: dpaint.c,v 2.7 91/03/27 16:45:29 billr Exp $
  3.  */
  4. /*
  5.  * dpaint.c
  6.  *
  7.  * Author: Philip Heller, Sun Microsystems. Inc. <terrapin!heller@sun.com>
  8.  *
  9.  * Original source Copyright (C) 1987, Sun Microsystems, Inc.
  10.  *    All Rights Reserved
  11.  * Permission is hereby granted to use and modify this program in source
  12.  * or binary form as long as it is not sold for profit and this copyright
  13.  * notice remains intact.
  14.  *
  15.  *
  16.  * Changes/additions by: Bill Randle, Tektronix, Inc. <billr@saab.CNA.TEK.COM>
  17.  *
  18.  * Changes and additions Copyright (C) 1988, 1989, 1991 Tektronix, Inc.
  19.  *    All Rights Reserved
  20.  * Permission is hereby granted to use and modify the modifications in source
  21.  * or binary form as long as they are not sold for profit and this copyright
  22.  * notice remains intact.
  23.  */
  24. /***************************************************
  25.  *                           *
  26.  *    Artistic routines that draw in the main    *
  27.  * subwindow for the day display.           *
  28.  *                           *
  29.  ***************************************************/
  30.  
  31. #include <ctype.h>
  32. #include <sys/time.h>
  33. #include <stdio.h>
  34. #ifndef NOTOOL
  35. #include <suntool/sunview.h>
  36. #include <suntool/canvas.h>
  37. #endif
  38. #include "ct.h"
  39. #include "paint.h"
  40. #ifndef NOTOOL
  41. #include "riseset.h"
  42. #define J1970   2440587.5 /* VAX clock Epoch 1970 Jan 1 (0h UT) */
  43.  
  44. #ifndef NO_SUN_MOON
  45. extern Frame mframe, sframe;
  46. extern Canvas mcanvas, scanvas;
  47. extern Panel_item mdate_pi, sdate_pi;
  48. #endif  /* NO_SUN_MOON */
  49. extern Pixrect *leftarrow, *rightarrow;
  50. extern Pixrect *arrowshaft_pr, *arrowhead_pr;
  51. extern Pixrect *gr_arrowshaft_pr, *gr_arrowhead_pr;
  52. extern char riseset_buf[][64];
  53. extern int old_slot;
  54. #endif  /* NOTOOL */
  55. extern int day_message_size;
  56. extern int show_future;
  57. extern int new_entry;
  58. extern int findex;        /* index into struct future array */
  59. extern struct appt_entry future[];
  60.  
  61.  
  62. #ifndef NOTOOL
  63. /*
  64.  * This one draws the current selected day in the
  65.  * main subwindow.
  66.  */
  67.  
  68. draw_day()
  69. {
  70.     draw_day1();
  71.     draw_future_appts();
  72. #ifndef NO_SUN_MOON
  73.     if (sframe)
  74.         write_sun_data();
  75.     if (mframe)
  76.         write_moon_data();
  77. #endif
  78. }
  79.  
  80. /*
  81.  * Draw main day page without future appts or Sun/Moon data
  82.  */
  83. draw_day1()
  84. {
  85.     int i;
  86.  
  87.     lock_cursors();
  88.     fix_current_day();
  89.     working(TRUE);
  90.     pw_batch_on(main_pixwin);
  91.     draw_day_outline();
  92.     pw_batch_off(main_pixwin);
  93.     i = get_day_appts();
  94.     working(FALSE);
  95.     if (i) {
  96.         draw_day_appts();
  97.     }
  98.     day_is_open = TRUE;
  99.     unlock_cursors();
  100. }
  101.  
  102. /*
  103.  * Utility for draw_day ... draws the outline of a day.
  104.  */
  105. draw_day_outline()
  106. {
  107.     char timestring[6], daystring[31], buf[64], *src;
  108.     int x, y, starty, i, d;
  109.     Rect *rect;
  110.  
  111.     /* First erase the window. */
  112.     rect = (Rect *) window_get(canvas, WIN_RECT);
  113.         pw_writebackground(main_pixwin, 0, 0,
  114.       rect->r_width, rect->r_height, PIX_CLR);
  115.     old_slot = -1;    /* text cursor no longer displayed */
  116.  
  117.     /* Calculate coords of top-left corner of big box. */
  118.     x = (rect->r_width - dayslot_width) / 2;
  119.     starty = y = (rect->r_height - (n_slots * dayslot_height)) / 2;
  120.  
  121.     /* Format daystring to say, for example, */
  122.     if (day_first)
  123.         /* Tuesday, 13 March 1990 */
  124.         sprintf(daystring, "%s %d %s %d",
  125.             daynames[current.tm_wday], current.tm_mday,
  126.             monthnames[current.tm_mon], 1900 + current.tm_year);
  127.     else
  128.         /* Tuesday, March 13, 1990 */
  129.         sprintf(daystring, "%s %s %d, %d",
  130.             daynames[current.tm_wday], monthnames[current.tm_mon],
  131.             current.tm_mday, 1900 + current.tm_year);
  132.     pw_text(main_pixwin, (rect->r_width - bigfont->pf_defaultsize.x*strlen(daystring))/2, starty/2 + 7,
  133.       PIX_SRC, bigfont, daystring);
  134.  
  135.     for (i=0; i<n_slots; i++) {    /* Init and draw each 30 minute slot. */
  136.                 slots[i].slot_pos.top = y;
  137.         slots[i].slot_pos.left = x;
  138.         slots[i].slot_pos.bottom = y + dayslot_height + 1;
  139.         slots[i].slot_pos.right = x + dayslot_width + 1;
  140.         slots[i].moreb_pos.top = y;
  141.         slots[i].moreb_pos.left = rect->r_width - 8 - morebutton->pr_size.x;
  142.         slots[i].moreb_pos.bottom = y + morebutton->pr_size.y;
  143.         slots[i].moreb_pos.right = rect->r_width - 8;
  144.         slots[i].larrow_pos.top = slots[i].slot_pos.top+(dayslot_height-leftarrow->pr_size.y)/2;
  145.         slots[i].larrow_pos.left = slots[i].slot_pos.right + 8;
  146.         slots[i].larrow_pos.bottom = slots[i].larrow_pos.top + leftarrow->pr_size.y;
  147.         slots[i].larrow_pos.right = slots[i].larrow_pos.left + leftarrow->pr_size.x;
  148.         slots[i].rarrow_pos.top = slots[i].larrow_pos.top;
  149.         slots[i].rarrow_pos.left = slots[i].larrow_pos.right + 8;
  150.         slots[i].rarrow_pos.bottom = slots[i].larrow_pos.bottom;
  151.         slots[i].rarrow_pos.right = slots[i].rarrow_pos.left + rightarrow->pr_size.x;
  152.         if (!ymd_compare(current, today))
  153.             pw_write(main_pixwin,x,y,dayslot_width,dayslot_height,PIX_SRC,timeslot_td_pr,0,0);
  154.         else
  155.             pw_write(main_pixwin,x,y,dayslot_width,dayslot_height,PIX_SRC,timeslot_pr,0,0);
  156.         if (i < n_tslots) {
  157.             /* display time */
  158.             if (hour24)
  159.                 sprintf(timestring, "%2d:%s",
  160.                     start_hour+(i/2),
  161.                     i%2 == 0 ? "00" : "30");
  162.             else
  163.                 sprintf(timestring, "%2d:%s%s",
  164.                     (start_hour+(i/2))%12 == 0 ? 12 : (start_hour+(i/2))%12,
  165.                     i%2 == 0 ? "00" : "30", (start_hour+(i/2) < 12 ? "am" : "pm"));
  166.         } else if (i == n_tslots) {
  167.             sprintf(timestring, "Notes");
  168.         } else {
  169.             sprintf(timestring, "     ");
  170.         }
  171.         pw_text(main_pixwin,x-9*font->pf_defaultsize.x,y+font->pf_defaultsize.y,PIX_SRC,font,timestring);
  172.         y += dayslot_height - 1;
  173.     }
  174.  
  175.     pw_vector(main_pixwin,x,starty,x+dayslot_width-1,starty,PIX_SET,1);
  176.         pw_vector(main_pixwin,x,y,x+dayslot_width-1,y,PIX_SET,1);
  177.     y += (dayslot_height - 1) * 2;
  178.     sprintf(buf,
  179.         "Day of year: %d  --  %d days remaining.      Week number: %d",
  180.         day_of_year((double)current.tm_mday, current.tm_mon+1, current.tm_year+1900),
  181.         days_remaining_in_year((double)current.tm_mday, current.tm_mon+1, current.tm_year+1900),
  182.         week_number());
  183.     pw_text(main_pixwin, x, y, PIX_SRC, font, buf);
  184.     sun_moon_buttons(TRUE);
  185.     print_button(TRUE);
  186. }
  187. #endif  /* NOTOOL */
  188.  
  189. #ifndef NOTOOL
  190. /* draw in todays appointments */
  191. draw_day_appts()
  192. {
  193.     int slotno, narrows, i;
  194.     int offset, x, y;
  195.  
  196.     pw_batch_on(main_pixwin);
  197.     /* first clear all the slots */
  198.     for (slotno=0; slotno<n_slots; slotno++) {
  199.         slots[slotno].arrow_pos = 0;
  200.         x = slots[slotno].slot_pos.left;
  201.                 y = slots[slotno].slot_pos.top;
  202.         if (!ymd_compare(current, today))
  203.             pw_write(main_pixwin,x,y,dayslot_width,
  204.               dayslot_height,PIX_SRC,timeslot_td_pr,0,0);
  205.         else
  206.             pw_write(main_pixwin,x+1,y+1,dayslot_width-2,
  207.               dayslot_height-2,PIX_CLR,NULL,0,0);
  208.     }
  209.  
  210.     /* draw in current info */
  211.     for (slotno=0; slotno<n_slots; slotno++) {
  212.         if (slots[slotno].active) {
  213.             rewrite_string(slotno, JUSTIFY_LEFT);
  214.             if ((narrows = slots[slotno].cur_appt->arrows) > 0) {
  215.                 /* find first free position for arrow */
  216.                 offset = 0;
  217.                 while (slots[slotno].arrow_pos & 1<<offset)
  218.                     offset++;
  219.                 slots[slotno].arrow_pos |= 1<<offset;
  220.                 i = slotno + narrows;
  221.                 draw_arrowhead(i, offset, FALSE);
  222.                 while (--narrows > 0)
  223.                     draw_arrowshaft(--i, offset, FALSE);
  224.             }
  225.             more_check(slotno);
  226.         }
  227.     }
  228.     pw_batch_off(main_pixwin);
  229. }
  230.  
  231. /* Blacks out day-slot and then re-writes string. */
  232. rewrite_string(bi, justify)
  233. int bi, justify;  
  234. {
  235.     char slot_str[MAX_STRLEN];
  236.     char *ptr;
  237.     int strl, *iptr;
  238.  
  239.     strl = strlen(slots[bi].cur_appt->str);
  240.     iptr = &slots[bi].cur_appt->sindex;
  241.     if (strl < day_message_size) {
  242.         *iptr = 0; /* just in case */
  243.         strcpy(slot_str, slots[bi].cur_appt->str);
  244.         /* erase any previously existing scroll arrows */
  245.         pw_writebackground(main_pixwin, slots[bi].larrow_pos.left,
  246.             slots[bi].larrow_pos.top, slots[bi].rarrow_pos.right-slots[bi].larrow_pos.left,
  247.             slots[bi].larrow_pos.bottom-slots[bi].larrow_pos.top,
  248.             PIX_CLR);
  249.     } else {
  250.         if (justify == JUSTIFY_RIGHT) {
  251.             /* show trailing part */
  252.             ptr = &slots[bi].cur_appt->str[strl - day_message_size + 1];
  253.             *iptr = strl - day_message_size + 1;
  254.             strcpy(slot_str, ptr);
  255.         } else {
  256.             /* show leading or indexed part */
  257.             if (justify == JUSTIFY_LEFT)
  258.                 *iptr = 0;
  259.             if (*iptr > (strl - day_message_size + 1))
  260.                 *iptr = strl - day_message_size + 1;
  261.             if (strlen(&slots[bi].cur_appt->str[*iptr]) >= day_message_size-1) {
  262.                 strncpy(slot_str, &slots[bi].cur_appt->str[*iptr], day_message_size-1);
  263.                 slot_str[day_message_size-1] = '\0';
  264.             } else
  265.                 strcpy(slot_str, &slots[bi].cur_appt->str[*iptr]);
  266.         }
  267.         /* display scroll arrows */
  268.         pw_write(main_pixwin, slots[bi].larrow_pos.left,
  269.             slots[bi].larrow_pos.top, leftarrow->pr_size.x,
  270.             leftarrow->pr_size.y, PIX_SRC, leftarrow, 0, 0);
  271.         pw_write(main_pixwin, slots[bi].rarrow_pos.left,
  272.             slots[bi].rarrow_pos.top, rightarrow->pr_size.x,
  273.             rightarrow->pr_size.y, PIX_SRC, rightarrow, 0, 0);
  274.     }
  275.         pw_write(main_pixwin, slots[bi].slot_pos.left+1, slots[bi].slot_pos.top+1,
  276.                 dayslot_width-2, dayslot_height-2, PIX_SET, NULL, 0, 0);
  277.         pw_text(main_pixwin, slots[bi].slot_pos.left+5, slots[bi].slot_pos.top+font->pf_defaultsize.y,
  278.                 PIX_NOT(PIX_SRC), font, slot_str);
  279. }
  280.  
  281. /* display "more" button if necessary */
  282. more_check(slotno)
  283. int slotno;
  284. {
  285.     int x, y, w, i, offset;
  286.     int narrows;
  287.     struct appt_entry *aptr;
  288.  
  289.     x = morebutton->pr_size.x;
  290.     y = morebutton->pr_size.y;
  291.  
  292.     /* clear any previous button that may be there */
  293.     pw_write(main_pixwin, slots[slotno].moreb_pos.left, slots[slotno].moreb_pos.top,
  294.         x, y, PIX_CLR, NULL, 0, 0);
  295.     /* button displayed when more than 1 reference
  296.      * and at least one real appt for this slot.
  297.      */
  298.     if (slots[slotno].active > 1) {
  299.         for (aptr=slots[slotno].first; aptr; aptr=aptr->next) {
  300.             if (aptr == slots[slotno].cur_appt)
  301.                 continue;  /* already did this one */
  302.             if (chk_deleted(&slots[slotno], aptr))
  303.                 continue;  /* ignore deleted appts */
  304.             if ((narrows = aptr->arrows) > 0) {
  305.                 /* find first free position for arrow */
  306.                 offset = 0;
  307.                 while (slots[slotno].arrow_pos & 1<<offset)
  308.                     offset++;
  309.                 slots[slotno].arrow_pos |= 1<<offset;
  310.                 i = slotno + narrows;
  311.                 draw_arrowhead(i, offset, TRUE);
  312.                 while (--narrows > 0)
  313.                     draw_arrowshaft(--i, offset, TRUE);
  314.             }
  315.         }
  316.         /* display more button to right of slot */
  317.         pw_write(main_pixwin, slots[slotno].moreb_pos.left, slots[slotno].moreb_pos.top,
  318.             x, y, PIX_SRC, morebutton, 0, 0);
  319.     }
  320. }
  321.  
  322. draw_arrowshaft(i, offset, gray)
  323. int i;
  324. int offset;
  325. int gray;
  326. {
  327.     /* mark this position as used */
  328.     slots[i].arrow_pos |= 1<<offset;
  329.     /* translate to screen coordinates */
  330.     offset = (offset + 1) * 40;
  331.     pw_rop(main_pixwin, slots[i].slot_pos.left+1+offset, slots[i].slot_pos.top,
  332.       16, dayslot_height, PIX_SRC|PIX_DST,
  333.       (gray ? gr_arrowshaft_pr : arrowshaft_pr), 0, 0);
  334. }
  335.  
  336.  
  337.  
  338. draw_arrowhead(i, offset, gray)
  339. int i;
  340. int offset;
  341. int gray;
  342. {
  343.     /* mark this position as used */
  344.     slots[i].arrow_pos |= 1<<offset;
  345.     /* translate to screen coordinates */
  346.     offset = (offset + 1) * 40;
  347.         pw_rop(main_pixwin, slots[i].slot_pos.left+1+offset, slots[i].slot_pos.top,
  348.           16, dayslot_height, PIX_SRC|PIX_DST,
  349.       (gray ? gr_arrowhead_pr : arrowhead_pr), 0, 0);
  350. }
  351.  
  352. /*
  353.  * Routine to create popup window with future appts shown in it
  354.  */
  355. draw_future_appts()
  356. {
  357.     if (show_future && findex && (ymd_compare(current, today) == 0)) {
  358.         create_future_popup();
  359.     } else {
  360.         /* nothing to show */
  361.         /* destroy future appts popup, if it exists */
  362.         if (fframe) {
  363.             window_destroy(fframe);
  364.             fframe = 0;
  365.         }
  366.     }
  367. }
  368. #endif  /* NOTOOL */
  369.  
  370. #ifndef NO_SUN_MOON
  371. /*
  372.  * write sun data to the popup canvas
  373.  */
  374. write_sun_data()
  375. {
  376.     int    x, y, height;
  377.     char    buf[64];
  378.     Pixwin    *spixwin;
  379.     Rect    *rect;
  380.     struct    timeval tp;
  381.     double    jdays, secs, offset;
  382.     double    julian_day();
  383.     char    *sunlight;
  384.     
  385.     /* first erase the window. */
  386.     spixwin = (Pixwin *)canvas_pixwin(scanvas);
  387.     rect = (Rect *) window_get(scanvas, WIN_RECT);
  388.         pw_writebackground(spixwin, 0, 0,
  389.       rect->r_width, rect->r_height, PIX_CLR);
  390.  
  391.     x = font->pf_defaultsize.x;
  392.     height = y = font->pf_defaultsize.y;
  393.  
  394.     gettimeofday(&tp, 0);
  395.     if (ymd_compare(current, today) == 0) {
  396.         /* use current time */
  397.         write_times();
  398.         panel_set(sdate_pi, PANEL_LABEL_STRING, riseset_buf[B_DMY], 0);
  399.         y += 11 * height;
  400.     } else {
  401.         /* convert today's date to approx. seconds from 1-1-1970 */
  402.         jdays = julian_day((double)today.tm_mday, today.tm_mon+1, today.tm_year+1900) - J1970;
  403.         /* seconds from 00:00 GMT to now */
  404.         offset = tp.tv_sec - (jdays * 24. * 3600.);
  405.         /* convert this date to approx. seconds from 1-1-1970 */
  406.         jdays = julian_day((double)current.tm_mday, current.tm_mon+1, current.tm_year+1900) - J1970;
  407.         /* seconds to the same time on selected day */
  408.         secs = (jdays * 24.0 * 3600.) + offset;
  409.         riseset((long)secs);
  410.         panel_set(sdate_pi, PANEL_LABEL_STRING, riseset_buf[B_DMY], 0);
  411.         pw_text(spixwin, x, y, PIX_SRC, font, riseset_buf[B_JLD]);
  412.         y += height;
  413.     }
  414.     sprintf(buf, "Sun Rise    (today): %s   Total Hours of", riseset_buf[B_SRD]);
  415.     pw_text(spixwin, x, y, PIX_SRC, font, buf);
  416.     y += height;
  417.     
  418.     sprintf(buf, "Sun Set     (today): %s   Sunlight %5s ", riseset_buf[B_SSD],
  419.         riseset_buf[B_LOD]);
  420.     pw_text(spixwin, x, y, PIX_SRC, font, buf);
  421.     y += height;
  422.     sprintf(buf, "Sun Rise (tomorrow): %s", riseset_buf[B_SRT]);
  423.     pw_text(spixwin, x, y, PIX_SRC, font, buf);
  424.     y += height;
  425.     sprintf(buf, "Sun Set  (tomorrow): %s", riseset_buf[B_SST]);
  426.     pw_text(spixwin, x, y, PIX_SRC, font, buf);
  427. }
  428.  
  429. /*
  430.  * write sun time data to the popup canvas
  431.  */
  432. write_times()
  433. {
  434.     int    x, y, height;
  435.     Pixwin    *spixwin;
  436.     struct    timeval tp;
  437.  
  438.     /* only update these if displaying today's page */
  439.     if (ymd_compare(current, today) != 0)
  440.         return;
  441.  
  442.     spixwin = (Pixwin *)canvas_pixwin(scanvas);
  443.  
  444.     x = font->pf_defaultsize.x;
  445.     y = height = font->pf_defaultsize.y;
  446.  
  447.     gettimeofday(&tp, 0);
  448.     riseset(tp.tv_sec);
  449.     pw_text(spixwin, x, y, PIX_SRC, font, riseset_buf[B_GMT]);
  450.     y += height;
  451.     pw_text(spixwin, x, y, PIX_SRC, font, riseset_buf[B_TDT]);
  452.     y += height;
  453.     pw_text(spixwin, x, y, PIX_SRC, font, riseset_buf[B_LCT]);
  454.     y += height;
  455.     pw_text(spixwin, x, y, PIX_SRC, font, riseset_buf[B_LMT]);
  456.     y += height;
  457.     pw_text(spixwin, x, y, PIX_SRC, font, riseset_buf[B_GST]);
  458.     y += height;
  459.     pw_text(spixwin, x, y, PIX_SRC, font, riseset_buf[B_LST]);
  460.     y += height;
  461.     pw_text(spixwin, x, y, PIX_SRC, font, riseset_buf[B_JLD]);
  462.     y += height;
  463.     pw_text(spixwin, x, y, PIX_SRC, font, riseset_buf[B_LHA]);
  464.     y += height;
  465.     pw_text(spixwin, x, y, PIX_SRC, font, riseset_buf[B_SDE]);
  466.     y += height;
  467.     pw_text(spixwin, x, y, PIX_SRC, font, riseset_buf[B_SAZ]);
  468.     y += height;
  469.     pw_text(spixwin, x, y, PIX_SRC, font, riseset_buf[B_SEL]);
  470. }
  471.  
  472. /*
  473.  * write moon data to the popup canvas
  474.  */
  475. write_moon_data()
  476. {
  477.     int    x, y, height;
  478.     char    buf[64];
  479.     Pixwin    *mpixwin;
  480.     Rect    *rect;
  481.     struct    timeval tp;
  482.     double    jdays, secs, offset;
  483.     double    julian_day();
  484.  
  485.     /* first erase the window. */
  486.     mpixwin = (Pixwin *)canvas_pixwin(mcanvas);
  487.     rect = (Rect *) window_get(mcanvas, WIN_RECT);
  488.         pw_writebackground(mpixwin, 0, 0,
  489.       rect->r_width, rect->r_height, PIX_CLR);
  490.  
  491.     x = font->pf_defaultsize.x;
  492.     y = height = font->pf_defaultsize.y;
  493.  
  494.     gettimeofday(&tp, 0);
  495.     if (ymd_compare(current, today) == 0) {
  496.         /* use current time */
  497.         riseset(tp.tv_sec);
  498.         moon_data(tp.tv_sec);
  499.     } else {
  500.         /* convert today's date to approx. seconds from 1-1-1970 */
  501.         jdays = julian_day((double)today.tm_mday, today.tm_mon+1, today.tm_year+1900) - J1970;
  502.         /* seconds from 00:00 GMT to now */
  503.         offset = tp.tv_sec - (jdays * 24. * 3600.);
  504.         /* convert this date to seconds from 1-1-1970 */
  505.         jdays = julian_day((double)current.tm_mday, current.tm_mon+1, current.tm_year+1900) - J1970;
  506.         /* seconds to the same time on selected day */
  507.         secs = (jdays * 24.0 * 3600.) + offset;
  508.         riseset((long)secs);
  509.         moon_data((long)secs);
  510.     }
  511.     panel_set(mdate_pi, PANEL_LABEL_STRING, riseset_buf[B_DMY], 0);
  512.     y = 6 * height;
  513.     sprintf(buf, "Moon Rise    (today): %s", riseset_buf[B_MRD]);
  514.     pw_text(mpixwin, x, y, PIX_SRC, font, buf);
  515.     y += height;
  516.     sprintf(buf, "Moon Set     (today): %s", riseset_buf[B_MSD]);
  517.     pw_text(mpixwin, x, y, PIX_SRC, font, buf);
  518.     y += height;
  519.     sprintf(buf, "Moon Rise (tomorrow): %s", riseset_buf[B_MRT]);
  520.     pw_text(mpixwin, x, y, PIX_SRC, font, buf);
  521.     y += height;
  522.     sprintf(buf, "Moon Set  (tomorrow): %s", riseset_buf[B_MST]);
  523.     pw_text(mpixwin, x, y, PIX_SRC, font, buf);
  524. }
  525.  
  526. #endif    /* NO_SUN_MOON */
  527.