home *** CD-ROM | disk | FTP | other *** search
- /*
- Name: monthtool
-
- Purpose: visual appointment calendar
-
- Author: Sarah Metcalfe apres Mike Essex & Rich Burridge
-
- Date: June 24, 1987
-
- Discussion: Displays a calendar to the screen for a given month.
- User may move the mouse to any day of the
- month and view or enter appointments for that date.
-
- */
-
- #include <stdio.h>
- #include <ctype.h>
-
- #include <suntool/sunview.h>
- #include <suntool/canvas.h>
- #include <suntool/panel.h>
- #include <suntool/walkmenu.h>
- #include <suntool/textsw.h>
-
- char *sprintf() ;
- char *malloc() ;
- char *strcat();
- char *strtok();
- char *getenv();
-
-
-
- #define LARGEFONT "/usr/lib/fonts/fixedwidthfonts/gallant.r.10"
- #define NORMALFONT "/monthtool.font"
-
-
- #define DATE_ROWS 6 /* No of rows of dates. */
- #define DATE_COLS 7 /* No of columns of dates. */
-
- #define DATE_BOX_HEIGHT 26 /* Number of pixels for height. */
- #define DATE_BOX_WIDTH 40 /* No of pixels for width. */
- #define DATE_BORDER 5 /* No of pixels in border. */
- #define GAP 5 /* No of pixels between dates. */
-
- #define BTN_WIDTH 21 /* No of pixels in up and down buttons. */
- #define BTN_HEIGHT 19 /* No of pixels in up and down buttons. */
-
-
- #define WINDOW_WIDTH (DATE_COLS * DATE_BOX_WIDTH) + \
- ((DATE_COLS - 1) * GAP) + (2 * DATE_BORDER)
- #define MONTH_HEIGHT 35
- #define DATES_HEIGHT (DATE_ROWS * DATE_BOX_HEIGHT) + \
- ((DATE_ROWS - 1) * GAP) + (2 * DATE_BORDER)
- #define NOTES_PANEL_HEIGHT 20
- #define NOTES_HEIGHT 100
-
-
- #define NUM_NOTES_TYPE 4 /* Types of records value */
- #define NOTES_D_M_Y 0 /* ddmmyyyy */
- #define NOTES_D_M_ALL 1 /* ddmm* */
- #define NOTES_D_ALL_ALL 2 /* dd** */
- #define NOTES_ALL_ALL_ALL 3 /* *** */
- #define NOTES_ERROR NUM_NOTES_TYPE /* *mmyy **yy dd*yy *mm* */
-
-
- #define MENU_CLOSE 1 /* Menu selection value */
- #define MENU_SAVE 2
- #define MENU_RELOAD 3
- #define MENU_QUIT 4
-
- #define HIGHLIGHT 1
- #define NOHIGHLIGHT 0
-
- struct dateBox {
- int date ;
- int hasNotes ;
- } ;
-
- struct apptsData {
- int year ;
- int month ;
- int day ;
- int dateNum ; /* 10000*year + 100*month + day */
- int time ;
- char *apptMsg ;
- struct apptsData *next ;
- struct apptsData *prev ;
- } ;
-