📄 calendar1dlg.h
字号:
// calendar1Dlg.h : header file
//
#if !defined(AFX_CALENDAR1DLG_H__9F714FB2_380A_4FDB_82D8_902FF94B7B13__INCLUDED_)
#define AFX_CALENDAR1DLG_H__9F714FB2_380A_4FDB_82D8_902FF94B7B13__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
const START_YEAR=1901;
/////////////////////////////////////////////////////////////////////////////
// CCalendar1Dlg dialog
class CCalendar1Dlg : public CDialog
{
// Construction
public:
void Chang();
//计算从阴历1900年11月11日到iEndYear,iEndMonth,iEndDay的天数
// long CalcLunDiff(WORD iEndYear,WORD iEndMonth,WORD iEndDay,WORD iFirstYear=1901,WORD iFirstMonth=11, WORD iFiirstDay=11);
CString l_Star(WORD month,WORD date);
CString l_paint_jieqi(WORD num);
CString l_paint_h(int num);
CString l_paint(int iYear,int iMonth,int iDay);
//iYear年iMonth月iDay日对应的节气0-24,0表示不是节气
static WORD l_GetLunarHolDay(WORD iYear,WORD iMonth,WORD iDay);
//计算从1901年1月1日过iSpanDays天后的阴历日期
static BYTE l_CalcLunarDate(WORD &iYear,WORD &iMonth,WORD &iDay,LONG iSpanDays);
//计算公历iYear年iMonth月iDay日对应的阴历日期,返回对应的节气0-24
static WORD GetLunarDate(WORD iYear,WORD iMonth,WORD iDay,WORD &iLunarYear,WORD &iLunarMonth,WORD &iLunarDay);
//计算公历两个日期间相差的天数
static long CalcDateDiff(WORD iEndYear,WORD iEndMonth,WORD iEndDay,WORD iStartYear=START_YEAR,WORD iStarMonth=1,WORD iStartDay=1);
//把iYear年格式化成天干记年法表示的字符串
CString FormatLunarYear(WORD iYear);
//返回阴历iLunarYear年的闰月月份,如没有返回0
static WORD GetLeapMonth(WORD iLunarYear);
//返回阴历iLunarYear年的总天数(1901年1月--2050年12月)
static WORD LunarYearDays(WORD iLunarYear);
//返回阴历iLunarYear年阴历iLunarMonth月的天数,如果iLunarMonth为闰月
//高位为第二个iLunarMonth月的天数,否则高位为0
//1901年1月--2050年12月
static long LunarMonthDays(WORD iLunarYear,WORD iLunarMonth);
//返回iYear年iMonth月的天数(1年1月---65535年12月)
WORD MonthDays(WORD iYear,WORD iMonth);
CCalendar1Dlg(CWnd* pParent = NULL); // standard constructor
//判断iYear是不是闰年
static BOOL IsLeapYear(WORD iYear){return !(iYear%4)&&(iYear%100)||!(iYear%400);};// Dialog Data
//{{AFX_DATA(CCalendar1Dlg)
enum { IDD = IDD_CALENDAR1_DIALOG };
int m_Year;
int m_Month;
int m_Day;
CString m_Lun;
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CCalendar1Dlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
CMonthCalCtrl * pCtrl;
HICON m_hIcon;
int m_Mu_Year;
int m_Mu_Month;
int m_Mu_Day;
// Generated message map functions
//{{AFX_MSG(CCalendar1Dlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnSelectMonthcalendar1(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnOk2();
virtual void OnCancel();
afx_msg void OnButton1();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_CALENDAR1DLG_H__9F714FB2_380A_4FDB_82D8_902FF94B7B13__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -