------------------ Clock and Calendar ------------------ by Gordan Palameta KALKLOCK.ACC desk accessory KALKLOCK.PRG program This program provides an analog clock and perpetual calendar. The system time and date can also be set (without touching the keyboard). The .PRG version can be invoked by double-clicking on the KALKLOCK.PRG file icon. The .ACC version is invoked by booting from a disk containing KALKLOCK.ACC, and then selecting "Clock/Calendar" from the Desk Menu. The clock and the calendar each appear in their own GEM window. Both windows normally appear when the program starts or the "Clock/Calendar" menu entry is selected; however if you hold down the left Shift key only the clock window appears and if you hold down the right Shift key only the calendar window appears. Note in the accessory version, if the clock or calendar windows are already open but are covered by other desktop windows, clicking on the "Clock/Calendar" menu entry brings them back as the top windows. When first invoked, the program checks the current system time and date and compares it with its own file timestamp. If the file timestamp is later than the system time and date (as will be the case when the machine is first turned on), the system time is known to be incorrect, and an alert is displayed. (Note that the files must be named KALKLOCK.PRG and KALKLOCK.ACC; if you rename them, the program will be unable to find its own timestamp). -------------------------------------------- Displaying different months in the Calendar: -------------------------------------------- Any month in the years 1753 through 2399 can be displayed. The display can be changed to a different month in a number of ways: From the keyboard, the up and down arrow keys move backward or forward one month. The left and right arrow keys move backward or forward one year (or one decade if Shift is pressed simultaneously, or one century if Control is pressed simultaneously). The Clr Home key returns the display to the month in which today's date lies. Note the calendar window must be the top window for the keyboard keys to work this way. Using the mouse, clicking on the up and down arrow boxes moves backward or forward a month. Clicking above and below the slider bar moves backward or forward a year. Clicking and dragging the slider bar moves backward or forward one, two, or three decades. Clicking on the "Today" button at the top of the calendar window returns the display to the month in which today's date lies. -------------------------- Setting the time and date: -------------------------- The clock time can be set by moving the analog hands to point to new positions. To move a clock hand, click anywhere along the circumference of the clock -- a "*" marker appears to mark the spot. Either the hour hand or the minute hand of the clock can then be moved to point at the spot selected. When the "*" marker appears, the selection line at the top of the clock window is enabled (the options are "AM Hr", "PM Hr", and "Min"). Clicking on Min moves the minute hand, and clicking on AM Hr or PM Hr moves the hour hand. In either case, the clock hand moves to the position marked by the "*" marker. The new time selected takes effect immediately. The 24-hour digital display at the bottom right of the window reflects the time shown by the analog clock hands. If you clicked on AM Hr to set the time, the digital display will show an hour between 0 and 11; if you clicked on PM Hr, the digital display hour will be between 12 and 23. The "*" marker can be moved around by clicking on a different spot along the circumference; clicking again on the same spot makes it disappear (and disables the selection line at the top of the window). To set the date, move the calendar to the month in which today's date will lie (see previous section on how to move the calendar display to different months). Then click on today's date (it will turn reverse video). Finally, click on the "Set" button at the top of the calendar window. A different date can be selected by clicking on it; clicking again on the same date deselects it. Note the date on the ST can't be set earlier than 1980 or later than 2099. If the new date set lies in a different month than before, an alert message is displayed, giving you the opportunity to update the timestamp of the executable file. ------------------------------------- The number of days between two dates: ------------------------------------- This is a fun feature of the calendar. To find the number of days between any two dates, move the calendar to the month in which the first date lies and click on that date, then click on the "#" button at the top of the window -- a message appears announcing the date selected. Then move the calendar to the month in which the second date lies and click on the second date. Click again on the "#" button -- a second message appears telling you the number of days between the two dates. ------------------ Copyright message: ------------------ Both clock and calendar windows have a copyright button. Clicking on it tells you who wrote this program (namely me). The program is free. ----------------- Appointment Book: ----------------- The button at the top left of the calendar window is blank -- it does nothing. A possible future version would contain the word "Appt" and provide an appointment book feature. To use the appointment book, you would click on any date in any month to select the date, then click on the "Appt" button (or just double-click on the date). The appointment book would open up at the date selected. -------------------- Did you know the 4th of July 1776 was a Thursday? Ever wondered exactly how many days old you are? Enjoy... Bg?,PN"XBg