home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume15 / monthtool2 / part01 / monthtool.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-06-01  |  2.5 KB  |  100 lines

  1. /*  @(#)monthtool.h    5.1 2/20/88 */
  2.  
  3. /*
  4.      Name:        monthtool
  5.   
  6.     Purpose:     visual appointment calendar 
  7.   
  8.     Author:        Sarah Metcalfe apres Mike Essex & Rich Burridge
  9.   
  10.     Discussion: Displays a calendar to the screen for a given month.  
  11.                 User may move the mouse to any day of the
  12.                 month and view or enter appointments for that date. 
  13.  
  14. */
  15.  
  16. #include <stdio.h>
  17. #include <ctype.h>
  18. #include <sys/types.h>
  19. #include <sys/stat.h>
  20.  
  21. #include <suntool/sunview.h>
  22. #include <suntool/canvas.h>
  23. #include <suntool/panel.h>
  24. #include <suntool/walkmenu.h>
  25. #include <suntool/textsw.h>
  26.  
  27. char *sprintf() ;
  28. char *malloc() ;
  29. char *strcat();
  30. char *strtok();
  31. char *getenv();
  32.  
  33.  
  34.  
  35. #define  LARGEFONT        "/usr/lib/fonts/fixedwidthfonts/gallant.r.10"
  36. #define  NORMALFONT        "/monthtool.font"
  37.  
  38.  
  39. #define  MAX_MSG_LEN        1024        /* Maximum length of appt. messages */
  40.  
  41. #define  DATE_ROWS            6            /* No of rows of dates. */
  42. #define  DATE_COLS            7            /* No of columns of dates. */
  43.  
  44. #define  DATE_BOX_HEIGHT    26            /* Number of pixels for height. */
  45. #define  DATE_BOX_WIDTH        40            /* No of pixels for width. */
  46. #define  DATE_BORDER        5            /* No of pixels in border. */
  47. #define  GAP                5            /* No of pixels between dates. */
  48.  
  49. #define  BTN_WIDTH            21            /* No of pixels in up and down buttons. */
  50. #define  BTN_HEIGHT            19            /* No of pixels in up and down buttons. */
  51.  
  52.  
  53. #define  WINDOW_WIDTH    (DATE_COLS * DATE_BOX_WIDTH) + \
  54.                         ((DATE_COLS - 1) * GAP) + (2 * DATE_BORDER)
  55. #define  MONTH_HEIGHT        35            
  56. #define  DATES_HEIGHT   (DATE_ROWS * DATE_BOX_HEIGHT) + \
  57.                         ((DATE_ROWS - 1) * GAP) + (2 * DATE_BORDER)
  58. #define  NOTES_PANEL_HEIGHT    20            
  59. #define  NOTES_HEIGHT        100            
  60.  
  61.  
  62. #define  NUM_NOTES_TYPE        5                /* Types of records value */
  63. #define  NOTES_D_M_Y        0                /* ddmmyyyy */
  64. #define  NOTES_D_M_ALL        1                /* ddmm* */
  65. #define  NOTES_D_ALL_ALL    2                /* dd** */
  66. #define  NOTES_WEEKLY        3                /* dd99* */
  67. #define  NOTES_ALL_ALL_ALL    4                /* *** */
  68. #define  NOTES_ERROR        NUM_NOTES_TYPE    /* *mmyy **yy dd*yy *mm* */
  69.  
  70.  
  71. #define  NO_OUTLINE            0                /* dateBox.hasNotes values */
  72. #define  HALF_OUTLINE        1
  73. #define  FULL_OUTLINE        2
  74.  
  75.  
  76. #define  MENU_CLOSE            1                /* Menu selection value */
  77. #define  MENU_SAVE            2
  78. #define  MENU_RELOAD        3
  79. #define  MENU_QUIT            4
  80.  
  81.  
  82. #define  HIGHLIGHT            1
  83. #define  NOHIGHLIGHT        0
  84.  
  85. struct dateBox {
  86.             int          date ;
  87.             int            boxOutline ;
  88. } ;
  89.  
  90. struct apptsData {
  91.             int                   year ;
  92.             int                   month ;
  93.             int                   day ;
  94.             int                   dateNum ;    /* 10000*year + 100*month + day */
  95.             int                   time ;
  96.             char                  *apptMsg ;
  97.             struct apptsData    *next ; 
  98.             struct apptsData    *prev ; 
  99. } ;
  100.