home *** CD-ROM | disk | FTP | other *** search
- // CalenCtl.h : Declaration of the CCalenCtrl OLE control class.
-
- /////////////////////////////////////////////////////////////////////////////
- // CCalenCtrl : See CalenCtl.cpp for implementation.
-
- class CCalenCtrl : public COleControl
- {
- DECLARE_DYNCREATE(CCalenCtrl)
-
- // Constructor
- public:
- CCalenCtrl();
-
- // Overrides
-
- // Drawing function
- virtual void OnDraw(
- CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid);
-
- // Persistence
- virtual void DoPropExchange(CPropExchange* pPX);
-
- // Reset control state
- virtual void OnResetState();
-
- // Implementation
- protected:
- ~CCalenCtrl();
-
- DECLARE_OLECREATE_EX(CCalenCtrl) // Class factory and guid
- DECLARE_OLETYPELIB(CCalenCtrl) // GetTypeInfo
- DECLARE_PROPPAGEIDS(CCalenCtrl) // Property page IDs
- DECLARE_OLECTLTYPE(CCalenCtrl) // Type name and misc status
-
- // Message maps
- //{{AFX_MSG(CCalenCtrl)
- afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-
- // Dispatch maps
- //{{AFX_DISPATCH(CCalenCtrl)
- short m_year;
- afx_msg void OnYearChanged();
- short m_ctrlBorderStyle;
- afx_msg void OnCtrlBorderStyleChanged();
- OLE_COLOR m_borderRiseColor;
- afx_msg void OnBorderRiseColorChanged();
- OLE_COLOR m_borderFallColor;
- afx_msg void OnBorderFallColorChanged();
- OLE_COLOR m_borderNormalColor;
- afx_msg void OnBorderNormalColorChanged();
- BOOL m_threeD;
- afx_msg void OnThreeDChanged();
- OLE_COLOR m_selectedDayColor;
- afx_msg void OnSelectedDayColorChanged();
- OLE_COLOR m_dayColor;
- afx_msg void OnDayColorChanged();
- short m_dayBorderStyle;
- afx_msg void OnDayBorderStyleChanged();
- OLE_COLOR m_dayRiseColor;
- afx_msg void OnDayRiseColorChanged();
- OLE_COLOR m_dayFallColor;
- afx_msg void OnDayFallColorChanged();
- afx_msg LPFONTDISP GetDayFont();
- afx_msg void SetDayFont(LPFONTDISP newValue);
- afx_msg short GetDay();
- afx_msg void SetDay(short nNewValue);
- afx_msg short GetMonth();
- afx_msg void SetMonth(short nNewValue);
- afx_msg BOOL SetDate(short month, short day, short year);
- //}}AFX_DISPATCH
- DECLARE_DISPATCH_MAP()
-
- CFontHolder m_dayFont;
- short m_Day;
- short m_Month;
-
- void DrawBorder(const CRect& rcBounds, CDC *pDC = NULL);
- void DrawMonth(const CRect& rcBounds, CDC *pDC = NULL);
- void DrawDaysOfWeek(const CRect& rcBounds, CDC *pDC = NULL);
- void DrawDays(const CRect& rcBounds, CDC *pDC = NULL);
- void DrawSelectedDay(BOOL bSelected, const CRect& rcBounds, CDC *pDC = NULL);
-
- short HitTest(CPoint &pt);
-
- afx_msg void AboutBox();
-
- // Event maps
- //{{AFX_EVENT(CCalenCtrl)
- void FireSelect(short Day)
- {FireEvent(eventidSelect,EVENT_PARAM(VTS_I2), Day);}
- //}}AFX_EVENT
- DECLARE_EVENT_MAP()
-
- // Dispatch and event IDs
- public:
- enum {
- //{{AFX_DISP_ID(CCalenCtrl)
- dispidYear = 1L,
- dispidCtrlBorderStyle = 2L,
- dispidBorderRiseColor = 3L,
- dispidBorderFallColor = 4L,
- dispidBorderNormalColor = 5L,
- dispidThreeD = 6L,
- dispidDayFont = 12L,
- dispidDay = 13L,
- dispidMonth = 14L,
- dispidSelectedDayColor = 7L,
- dispidDayColor = 8L,
- dispidDayBorderStyle = 9L,
- dispidDayRiseColor = 10L,
- dispidDayFallColor = 11L,
- dispidSetDate = 15L,
- eventidSelect = 1L,
- //}}AFX_DISP_ID
- };
- };
-