MFC下的日历表 (二)

2014-11-23 22:54:05 · 作者: · 浏览: 9
" #include "SetTime.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // SetTime dialog SetTime::SetTime(CWnd* pParent /*=NULL*/) : CDialog(SetTime::IDD, pParent) { //{{AFX_DATA_INIT(SetTime) m_strYear = _T(""); //}}AFX_DATA_INIT } void SetTime::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(SetTime) DDX_Control(pDX, IDC_EDIT2, m_editMouth); DDX_Text(pDX, IDC_EDIT1, m_strYear); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(SetTime, CDialog) //{{AFX_MSG_MAP(SetTime) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // SetTime message handlers void SetTime::OnOK() { // TODO: Add extra validation here CString tempMouth , tempDay ; UpdateData(); year=_ttoi(m_strYear); m_editMouth.GetWindowText(tempMouth); mouth=_ttoi(tempMouth); CWnd * cw =GetDlgItem(IDC_EDIT3); cw->
GetWindowText(tempDay); day = _ttoi(tempDay); CDialog::OnOK(); } int SetTime::getYear(){ return year ; } int SetTime::getMouth(){ return mouth ; } int SetTime::getDay(){ return day ; }