123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- /***************************************************************************
- 致看到这些源代码的兄弟:
- 你好!
- 这本来是我为一个商业PDA产品开发的日历程序,最近移植于PC机上, 所以算法
- 和数据部分是用纯C++写的,不涉及MFC,所有的代码都是以短节省存储空间为主要目
- 的.
- 很高兴你对这些代码有兴趣,你可以随意复制和使用些代码,唯一有一点小小的
- 愿望:在你使用和复制给别人时,别忘注明这些代码作者:-)。程序代码也就罢了,后
- 面的数据可是我辛辛苦苦从万年历上找出来输进去的。
- 如果你有什么好的意见不妨Mail给我。
- wangfei@hanwang.com.cn
- 或
- wangfei@engineer.com.cn
- ****************************************************************************/
- #if !defined(AFX_CALENDARFRM_H__9EC203BC_1574_4986_B73C_A44C975739CC__INCLUDED_)
- #define AFX_CALENDARFRM_H__9EC203BC_1574_4986_B73C_A44C975739CC__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #include "Calendar1.h"
- // CalendarFrm.h : header file
- // Download by http://www.codefans.net
- /////////////////////////////////////////////////////////////////////////////
- // CCalendarFrm window
- /////////////////////////////////////////////////////////////////////////////
- // CYearEdit window
- class CYearEdit : public CEdit
- {
- // Construction
- public:
- CYearEdit();
- // Attributes
- public:
- // Operations
- public:
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CYearEdit)
- public:
- virtual BOOL Create(const RECT& rect, CWnd* pParentWnd, UINT nID);
- //}}AFX_VIRTUAL
- // Implementation
- public:
- virtual ~CYearEdit();
- // Generated message map functions
- protected:
- //{{AFX_MSG(CYearEdit)
- afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
- afx_msg void OnKillFocus(CWnd* pNewWnd);
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
- class CCalendarFrm : public CWnd // Jeff摄控本图表;
- {
- private:
- CFont m_oDispFont;
- // Construction
- public:
- CCalendar m_oCalendar;
- CCalendarFrm();
- void DateChange(LONG iYear, LONG iMonth);
- void DateChange2(LONG iYear, LONG iMonth, LONG iDay);
- CRect m_rect;
- // Attributes
- public:
- void SetDate(WORD iYear, WORD iMonth, WORD iDay)
- {
- m_oCalendar.SetDate(iYear, iMonth, iDay);
- }
- void GetDate(WORD &iYear, WORD &iMonth, WORD &iDay)
- {
- m_oCalendar.GetDate(iYear, iMonth, iDay);
- }
-
- CFont * GetDispFont(){return &m_oDispFont;}
- public:
- virtual BOOL Create(RECT &rect, CWnd * pParentWnd, UINT nID); // Jeff
- virtual ~CCalendarFrm();
- // Generated message map functions
- private:
- void l_PaintToday(CPaintDC &dc);
- void l_PaintBorder(CPaintDC &dc);
- void l_PaintChineseInfo(CPaintDC &dc);
- void l_CreateDispFont();
- protected:
- afx_msg void OnPaint();
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- //}}AFX_MSG
- #ifdef VC60
- afx_msg void OnSelChange(LONG iYearMonth, LONG iDay);
- #else
- afx_msg LRESULT OnSelChange(WPARAM wp, LPARAM lp);
- #endif
- afx_msg void OnMonthChange();
- afx_msg void OnYearChange();
- afx_msg void OnTodayClick();
- DECLARE_MESSAGE_MAP()
- };
- #endif
|