rsalz@bbn.com (Rich Salz) (06/03/88)
Submitted-by: cognos!sarahm Posting-number: Volume 15, Issue 27 Archive-name: monthtool2/part01 This is the second version of Monthtool -- a visual calendar and appointment manager. It works on Sun systems with SunOS 3.2 or greater. This version offers a few bug fixes and some significant new features -- including weekly appointments, automatic save on close, and different date borders based on the types of appointments. Enough has changed to warrant posting the whole thing again, not just fixes. Thanks to all the people who have been mailing in suggestions and thanks very much to all the people who have been mailing actual code improvements! Sarah Metcalfe decvax!utzoo!dciem!nrcaer!cognos!sarahm Cognos Incorporated P.O. Box 9707, 3755 Riverside Drive, Ottawa, Ontario, CANADA K1G 3Z4 (613) 738-1440 [ I repacked this into two shar's -- r$ ] #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh <file", e.g.. If this archive is complete, you # will see the following message at the end: # "End of archive 1 (of 2)." # Contents: Makefile README monthtool.1 monthtool.font.uu monthtool.h # Wrapped by rsalz@fig.bbn.com on Thu Jun 2 15:04:54 1988 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f 'Makefile' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'Makefile'\" else echo shar: Extracting \"'Makefile'\" \(670 characters\) sed "s/^X//" >'Makefile' <<'END_OF_FILE' XFONTDIR = /system/util/monthtool INSTALLDIR = /usr/local/bin MANDIR = /usr/local/man/man1 LIBS = -lm -lsuntool -lsunwindow -lpixrect CFLAGS = -O PROG = monthtool MAN = monthtool.1 X monthtool: monthtool.font monthtool.o X cc -o $(PROG) monthtool.o $(LIBS) X monthtool.o: monthtool.c monthtool.h X cc $(CFLAGS) -DFONTDIR="\"$(FONTDIR)\"" -c monthtool.c X monthtool.font: monthtool.font.uu X uudecode monthtool.font.uu X install -c -m 644 monthtool.font $(FONTDIR) X install: $(PROG) $(MAN) X install -s -m 555 $(PROG) $(INSTALLDIR) X install -c -m 644 monthtool.1 $(MANDIR) X clean: X rm -f monthtool.o core END_OF_FILE if test 670 -ne `wc -c <'Makefile'`; then echo shar: \"'Makefile'\" unpacked with wrong size! fi # end of 'Makefile' fi if test -f 'README' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'README'\" else echo shar: Extracting \"'README'\" \(1282 characters\) sed "s/^X//" >'README' <<'END_OF_FILE' This is version 2 of Monthtool. Some significant new features have been added, thanks to suggestions from people all over! X X-------- X Monthtool is a visual direct manipulation "month-at-a-glance" type calendar and reminder system using Sunview. It is based on work done by Mike Essex on the vcal group of pro- grams. Some ideas on setting up the interface were borrowed from the calctool program by Rich Burridge. X This program works on Sun 3 systems only. To install: check the Makefile and change the INSTALLDIR, MANDIR, and XFONTDIR Make macros to the following directories, respective- ly: the directory where Monthtool is to be installed, the directory where the man page is to go, and the directory where the specialized font is to be installed. Then, simply do a "make install", followed by a "make clean", if required. X I hope it turns out to be useful. Improvements and bug fixes most welcome. X X X Regards, X Sarah Metcalfe X X______ X Sarah Metcalfe decvax!utzoo!dciem!nrcaer!cognos!sarahm Cognos Incorporated P.O. Box 9707, 3755 Riverside Drive, X Ottawa, Ontario, CANADA K1G 3Z4 X (613) 738-1440 END_OF_FILE if test 1282 -ne `wc -c <'README'`; then echo shar: \"'README'\" unpacked with wrong size! fi # end of 'README' fi if test -f 'monthtool.1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'monthtool.1'\" else echo shar: Extracting \"'monthtool.1'\" \(6640 characters\) sed "s/^X//" >'monthtool.1' <<'END_OF_FILE' X./" @(#)monthtool.1 5.1 2/20/88 X.TH MONTHTOOL 1 "4 January 1988" X.SH NAME monthtool \- a mouse-oriented direct manipulation calendar and reminder organizer X.SH SYNOPSIS X.B monthtool X.SH DESCRIPTION X.sp X.TP X.B Overview X.br X.sp X\fIMonthtool\fR displays a Suntools-oriented calendar of any month of any year and allows the user to browse the days of that month, and to schedule and recall reminders for that day. X.br X.TP X.B Windows X.sp Month Name Window: X.br The name and year of the displayed calendar is indicated. Two arrow buttons allow the user to move to other months (up arrow moves to the previous month, down arrow to the following month). A button labelled "Today" moves the calendar to the current month of the current year, highlights today's date in the calendar, and displays today's reminders. X.sp Dates Window: X.br The days of the month are shown in calendar format. When the user clicks on a date in this window, that date is highlighted and the reminders for that particular day are shown in the Reminder Window. Days that have (most types of) reminders associated with them have a bolder border. X.sp Reminder Type Buttons Window: X.br XFive push-buttons indicating the types of reminders are shown. Clicking on one type will set the reminder that currently has the insertion caret on it (in the Reminder Window) to that type. X.sp Reminder Window: X.br Reminders for the currently highlighted date are shown. Indicators of the type of each reminder are indicated at the beginning of each reminder line. Reminders may be added, deleted or modified, using the standard X\fItextedit\fR features. A type may be set by positioning the insertion caret on the reminder and clicking on the required type in the Reminder Type Buttons Window. X.br X.TP X.B Reminder Types X.br X.sp Reminders may be one of five types: X.sp This day only reminders: X.br These reminders are one time only events, such as appointments. A reminder of this type has a black box at the front of the message. When one of these is associated with a given day, the border of that date in the calendar will be made bolder, as an indicator. X.sp Yearly reminders: X.br Reminders that happen once a year, such as birthdays. A reminder of this type has a hollow box containing a "Y" at the front of the message. When one of these is associated with a given month and day, the border of that date in the calendar will be made bolder, as an indicator. X.sp Monthly reminders: X.br Reminders that happen once a month, such as loan payments. A reminder of this type has a hollow box containing a "M" at the front of the message. When one of these is associated with a given date, the border of that date in the calendar will be made bolder, as an indicator. X.sp Weekly reminders: X.br Reminders that happen once a week, such as weekly status meetings. A reminder of this type has a hollow box containing a "W" at the front of the message. When one of these is associated with a given date, the border of that date in the calendar will be made bolder, as an indicator. X.sp Daily reminders: X.br Constant reminders, things to remember to do. A reminder of this type has a hollow box containing a "D" at the front of the message. X.br X.TP X.B Date Borders X.br X.sp There are different types of borders on the dates in the calendar depending on the types of reminders associated with each date. A date that has any X"this day only" reminders will have a thick black border. A date that has no "this day only" reminders but does have yearly, monthly, or weekly reminders will have a double line border. A date which has no reminders (or daily reminders only -- since they are valid everyday) will have a thin border. X.TP X.B Menu Commands X.sp Available with the right mouse button, except when in the Reminders Window X(when the standard X\fItextedit\fR menu is available). X.sp Close with Save: X.br Close the window to the icon and save the reminders in the .monthtool file. X.sp Save: X.br Save the reminders in the .monthtool file. X.sp Reload: X.br Reload the reminders from the last version of the .monthtool file. X.sp Quit with Save: X.br Save the reminders in the .monthtool file and quit. X.sp Note that the standard frame menu (available when in the borders of any window) allows the user to quit without saving. Resize, Redisplay, etc. are also available, as is usually the case. Closing the window using the standard frame menu or the L7 key automatically causes a save. When the icon is reopened, a reload is automatically done if the file has been modified since the last save within monthtool. Also, when the icon is reopened, the tool automatically jumps to today's reminders. X.sp X.TP X.B The .monthtool File X.br X.sp The reminders are kept in a file in the home directory called the .monthtool file. This file is kept in a format similar to that used by X\fIautocall\fR, used to warn the user of impending appointments. If this feature is required, the time for the appointments must be the first token of the message X(after the type indicator) and must be in the format hh:mm or h:mm, 24-hour time. X.sp XEach reminder is a line (of length 80 characters or less) in the .monthtool file in the following format: X.sp X.ta +1i m,d,y,tttt,s X.ta -1i X.sp where m is the one or two digit month number, d is the one or two digit date, y is the year (up to 4 digits), tttt is either 4 blanks (if no time is required) or 24 time in hhmm format, and s is the reminder message. XFor yearly reminders, the y field is 0 (zero); for monthly reminders, the m field and the y field are 0 (zero); for daily reminders, the d field, the m field, and the y field are 0 (zero); for weekly reminders the d field is between 1 and 7 (indicating Sunday through Saturday), the m field is 99, and the y field is 0 (zero). X.SH AUTHORS X.ta +1.15i Sarah Metcalfe (with ideas from Mike Essex and Rich Burridge) X.SH FILES X$HOME/.monthtool X.SH SEE ALSO X\fIvcal\fR(1), \fIautocall\fR(1), \fItextedit\fR(1), \fIsuntools\fR(1) X.LP X\fI"Windows and Window-Based Tools: Beginner's Guide"\fR X.SH DIAGNOSTICS Monthtool warning! Invalid record: \fIrecord\fR X.br Monthtool error: Cannot open \fI~/.monthtool\fR file X.SH BUGS Although the .monthtool file has a similar format to the .appointments file of \fIvcal\fR, X\fIvcal\fR cannot support the yearly, monthly, weekly, or daily reminders. If vcal is used on the file, reminders of that type will be lost. X.sp Unpredictable things may happen when using the "Undo" key. X.sp When the notes have been modified, but the mouse hasn't yet been moved out of the notes window, and the L7 key is used to close the window, the updates will be lost. END_OF_FILE if test 6640 -ne `wc -c <'monthtool.1'`; then echo shar: \"'monthtool.1'\" unpacked with wrong size! fi # end of 'monthtool.1' fi if test -f 'monthtool.font.uu' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'monthtool.font.uu'\" else echo shar: Extracting \"'monthtool.font.uu'\" \(5719 characters\) sed "s/^X//" >'monthtool.font.uu' <<'END_OF_FILE' begin 644 monthtool.font M 1X&%0 ' \ M M M M #PH% < !P / \* M!0 ' < '@ /"@4 !P ' "T #PH% < !P M M #P #PH% < !P!+ \*!0 ' < 6@ /"@4 !P ' M &D #PH% < !P!X \*!0 ' < AP /"@4 !P ' )8 #PH% < !P"E \* M!0 ' < M /"@4 !P ' ,, #PH% < !P#2 \*!0 ' < X0 /"@4 !P ' M / #PH% < !P#_ \*!0 ' <!#@ /"@4 !P ' 1T #PH% < !P$L \* M!0 ' <!.P /"@4 !P ' 4H #PH% < !P%9 \*!0 ' <!: /"@4 !P ' M 7< #PH% < !P&& \*!0 ' <!E0 /"@4 !P ' :0 #PH% < !P&S \* M!0 ' <!P@ /"@4 !P ' =$ #PH% < !P'@ \*!0 ' <![P /"@4 !P ' M ?X #PH% < !P(- \*!0 ' <"' /"@4 !P ' BL #PH% < !P(Z \* M!0 ' <"20 /"@4 !P ' E@ #PH% < !P)G \*!0 ' <"=@ ."@0 !P ' M H0 #PH% < !P*3 \*!0 ' <"H@ /"@4 !P ' K$ #PH% < !P+ \* M!0 ' <"SP /"@4 !P ' MX #PH% < !P+M X*! ' <"^P /"@4 !P ' M PH #PH% < !P,9 \*!0 ' <#* /"@4 !P ' S< #PH% < !P-& \* M!0 ' <#50 /"@4 !P ' V0 #PH% < !P-S \*!0 ' <#@@ /"@4 !P ' M Y$ #PH% < !P.@ \*!0 ' <#KP /"@4 !P ' [X #PH% < !P/- \* M!0 ' <#W /"@4 !P ' ^L #PH% < !P/Z \*!0 ' <$"0 /"@4 !P ' M!!@ #PH% < !P0G \*!0 ' <$-@ /"@4 !P '!$4 #@H$ < !P13 \* M!0 ' <$8@ /"@4 !P '!'$ #PH% < !P2 \*!0 ' <$CP /"@4 !P ' M!)X #PH% < !P2M \*!0 ' <$O /"@4 !P '!,L #PH% < !P3: \* M!0 ' <$Z0 /"@4 !P '!/@ #PH% < !P4' \*!0 ' <%%@ /"@4 !P ' M!24 #PH% < !P4T \*!0 ' <%0P /"@4 !P '!5( #PH% < !P5A \* M!0 ' <%< /"@4 !P '!7\ #PH% < !P6. \*!0 ' <%G0 /"@4 !P ' M!:P #PH% < !P6[ \*!0 ' < M M M M 7* \*!0 ' <%V0 /"@4 !P '!>@ #PH% < !P7W \* M!0 ' <&!@ /"@4 !P ' M M M M M M M M M M M M M M M M M M M M M M M M M ! 0$! 0$ M$ "@H* "@H?"@H*'PH* $! \1$ P& 1$ M>! 0 #!(2C0($"Q2$@P !@D(! P2D1$.@ @($ M "! 0(" @(" 0$ @ (! 0" @(" @0$" 05#A4$ M ! 0?! 0 8" @0 _@ M 8& 0$" @0$" @0$ #A$1$1$1$1$ M. ! P4! 0$! 0? #A$1 0($"!$? #A$! 08! 1$ M. 0,%"1$?@0$#@ #P@(#@D! 1$. !P@0%AD1$1$ M. 'Q$! @($! 0$ #A$1$0X1$1$. #A$1$1,- 0( M< !@8 8& !@8 8" @0 $"! @0" 0 M" 0 !\ 'P ! (! (! @0($ #A$1 0($ M$ !@D0DY24DQ (AP ' 0*"@H1'Q$Q@ '@D)"0X)"(B M? #Q$0$! 0$!$. '@D(B(B(B(D> 'XB("0\)" B M?@ 'XB("0\)" @< /$1 0$!.1$0X [D1$1'Q$1$3N M ?! 0$! 0$!!\ / @(" @(2$@P 9B0H,"@H)"1F M <" @(" @(")^ QD1L;%141$3& SD1D9%143$SD M X9$1$1$1$3#@ !\(B(B/" @(' X1$1$1$1$1#@0 M* 8 !\(B(B/"@D)&8 \1$! . 0$1'@ #^DA 0$! 0$'P M #N1$1$1$1$1#@ #N1$0H*"@0$! #N1$145&PH*"@ M #N1"@H$"@H1.X #N1$0H*! 0$#@ !^0@0($"! 0GX M #P@(" @(" @(" \ ! 0" @$! (" 0$ #P$! 0$! 0$! 0\ M 0*$0 /X 0$ @ M X!#Q$1#H # 0$!89$1$9-@ \1$! 1#@ M ,! 0T3$1$3#8 X1'Q 1#@ X0$'P0$! 0? M #9,1$1,- 0$. ,! 0%AD1$1$[@ ! 0 ' 0$! 0? M @( '@(" @(" @(< & @("8D*#@D9@ ' 0$! 0$! 0? M *A45%145 -AD1$1$[@ #A$1$1$. M -AD1$1D6$! X #9,1$1,- 0$#@ &PR(" @< M #Q$, A$> ! 0$'P0$! 0# ,Q$1$1,-@ M .Y$*"@0$ .Y$5%0H* &8D&!@D9@ M .Y$1"@H$! @\ 'Q($"!$? #! 0$!!@$! 0$ P M 0$! 0$! 0$! 0$! 0$! 8! 0$! ,$! 0$& #):3 M _O[^_O[^_O[^_O[^ _H*"JJJ2DI*"@H+^ _H*"JKJJJJJ"@H+^ X@ _H*"JJJJNKJJ@H+^ _H*"LJJJJJJR@H+^ X end END_OF_FILE if test 5719 -ne `wc -c <'monthtool.font.uu'`; then echo shar: \"'monthtool.font.uu'\" unpacked with wrong size! fi # end of 'monthtool.font.uu' fi if test -f 'monthtool.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'monthtool.h'\" else echo shar: Extracting \"'monthtool.h'\" \(2541 characters\) sed "s/^X//" >'monthtool.h' <<'END_OF_FILE' X/* @(#)monthtool.h 5.1 2/20/88 */ X X/* X Name: monthtool X X Purpose: visual appointment calendar X X Author: Sarah Metcalfe apres Mike Essex & Rich Burridge X X Discussion: Displays a calendar to the screen for a given month. X User may move the mouse to any day of the X month and view or enter appointments for that date. X X*/ X X#include <stdio.h> X#include <ctype.h> X#include <sys/types.h> X#include <sys/stat.h> X X#include <suntool/sunview.h> X#include <suntool/canvas.h> X#include <suntool/panel.h> X#include <suntool/walkmenu.h> X#include <suntool/textsw.h> X char *sprintf() ; char *malloc() ; char *strcat(); char *strtok(); char *getenv(); X X X X#define LARGEFONT "/usr/lib/fonts/fixedwidthfonts/gallant.r.10" X#define NORMALFONT "/monthtool.font" X X X#define MAX_MSG_LEN 1024 /* Maximum length of appt. messages */ X X#define DATE_ROWS 6 /* No of rows of dates. */ X#define DATE_COLS 7 /* No of columns of dates. */ X X#define DATE_BOX_HEIGHT 26 /* Number of pixels for height. */ X#define DATE_BOX_WIDTH 40 /* No of pixels for width. */ X#define DATE_BORDER 5 /* No of pixels in border. */ X#define GAP 5 /* No of pixels between dates. */ X X#define BTN_WIDTH 21 /* No of pixels in up and down buttons. */ X#define BTN_HEIGHT 19 /* No of pixels in up and down buttons. */ X X X#define WINDOW_WIDTH (DATE_COLS * DATE_BOX_WIDTH) + \ X ((DATE_COLS - 1) * GAP) + (2 * DATE_BORDER) X#define MONTH_HEIGHT 35 X#define DATES_HEIGHT (DATE_ROWS * DATE_BOX_HEIGHT) + \ X ((DATE_ROWS - 1) * GAP) + (2 * DATE_BORDER) X#define NOTES_PANEL_HEIGHT 20 X#define NOTES_HEIGHT 100 X X X#define NUM_NOTES_TYPE 5 /* Types of records value */ X#define NOTES_D_M_Y 0 /* ddmmyyyy */ X#define NOTES_D_M_ALL 1 /* ddmm* */ X#define NOTES_D_ALL_ALL 2 /* dd** */ X#define NOTES_WEEKLY 3 /* dd99* */ X#define NOTES_ALL_ALL_ALL 4 /* *** */ X#define NOTES_ERROR NUM_NOTES_TYPE /* *mmyy **yy dd*yy *mm* */ X X X#define NO_OUTLINE 0 /* dateBox.hasNotes values */ X#define HALF_OUTLINE 1 X#define FULL_OUTLINE 2 X X X#define MENU_CLOSE 1 /* Menu selection value */ X#define MENU_SAVE 2 X#define MENU_RELOAD 3 X#define MENU_QUIT 4 X X X#define HIGHLIGHT 1 X#define NOHIGHLIGHT 0 X struct dateBox { X int date ; X int boxOutline ; X} ; X struct apptsData { X int year ; X int month ; X int day ; X int dateNum ; /* 10000*year + 100*month + day */ X int time ; X char *apptMsg ; X struct apptsData *next ; X struct apptsData *prev ; X} ; END_OF_FILE if test 2541 -ne `wc -c <'monthtool.h'`; then echo shar: \"'monthtool.h'\" unpacked with wrong size! fi # end of 'monthtool.h' fi echo shar: End of archive 1 \(of 2\). cp /dev/null ark1isdone MISSING="" for I in 1 2 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have unpacked both archives. rm -f ark[1-9]isdone else echo You still need to unpack the following archives: echo " " ${MISSING} fi ## End of shell archive. exit 0 -- Please send comp.sources.unix-related mail to rsalz@uunet.uu.net.