home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / yacl-012.zip / ui / monthcal.h < prev    next >
C/C++ Source or Header  |  1995-04-08  |  2KB  |  90 lines

  1.  
  2.  
  3. #ifndef _monthcal_h_ /* Thu Dec 30 15:50:13 1993 */
  4. #define _monthcal_h_
  5.  
  6.  
  7.  
  8.  
  9.  
  10. /*
  11.  *
  12.  *          Copyright (C) 1994, M. A. Sridhar
  13.  *  
  14.  *
  15.  *     This software is Copyright M. A. Sridhar, 1994. You are free
  16.  *     to copy, modify or distribute this software  as you see fit,
  17.  *     and to use  it  for  any  purpose, provided   this copyright
  18.  *     notice and the following   disclaimer are included  with all
  19.  *     copies.
  20.  *
  21.  *                        DISCLAIMER
  22.  *
  23.  *     The author makes no warranties, either expressed or implied,
  24.  *     with respect  to  this  software, its  quality, performance,
  25.  *     merchantability, or fitness for any particular purpose. This
  26.  *     software is distributed  AS IS.  The  user of this  software
  27.  *     assumes all risks  as to its quality  and performance. In no
  28.  *     event shall the author be liable for any direct, indirect or
  29.  *     consequential damages, even if the  author has been  advised
  30.  *     as to the possibility of such damages.
  31.  *
  32.  */
  33.  
  34.  
  35.  
  36.  
  37.  
  38. // This is a simple visual object that has a date as its model, and displays
  39. // the month of that date in its view.
  40.  
  41.  
  42. #if defined(__GNUC__)
  43. #pragma interface
  44. #endif
  45.  
  46. #include "base/date.h"
  47. #include "ui/simple.h"
  48.  
  49. class CL_EXPORT UI_CompositeVObject;
  50.  
  51. class CL_EXPORT UI_MonthCalendar: public UI_SimpleVObject {
  52.  
  53. public:
  54.     UI_MonthCalendar (UI_VObjCollection* parent,
  55.                       const UI_Rectangle& shape, UI_ViewID id,
  56.                       const CL_Date& date = CL_Date());
  57.  
  58.     void AdvanceMonth ();
  59.  
  60.     void PreviousMonth();
  61.     
  62.  
  63.     virtual UI_WindowClass WindowClass () const;
  64.     
  65. protected:
  66.     bool ButtonDown (const UI_Point& curPos, UI_MouseButton btn,
  67.                      bool shiftKey, bool ctrlKey); 
  68.  
  69.     bool Paint ();
  70.  
  71.     // Virtual methods for child classes:
  72.     
  73.     virtual void ClickOnDay (short day);
  74.  
  75.  
  76.     short _month;
  77.     short _year;
  78.  
  79. private:
  80.     short _cellWidth;
  81.     short _cellHeight;
  82.     short _charWidth;
  83.     short _charHeight;
  84.     short _dayOfFirst;  // What day of week is the first of the displayed
  85.                         // month ?
  86.     short _daysInMonth; // Number of days in the displayed month
  87. };
  88.  
  89. #endif /* _calendar_h_ */
  90.