You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
1.6 KiB
C++
71 lines
1.6 KiB
C++
// DlgValStrDate.cpp : 实现文件
|
|
//
|
|
|
|
#include "stdafx.h"
|
|
#include "LaiPuLaser.h"
|
|
#include "DlgValStrDate.h"
|
|
#include "afxdialogex.h"
|
|
#include "ValStrDate.h"
|
|
#include "EnumValStrType.h"
|
|
|
|
// CDlgValStrDate 对话框
|
|
|
|
IMPLEMENT_DYNAMIC(CDlgValStrDate, CDlgValStrBase)
|
|
BEGIN_MESSAGE_MAP(CDlgValStrDate, CDlgValStrBase)
|
|
ON_BN_CLICKED(IDOK,OnBnClickedOk)
|
|
END_MESSAGE_MAP()
|
|
|
|
CDlgValStrDate::CDlgValStrDate(CWnd* pParent /*=NULL*/)
|
|
: CDlgValStrBase(CDlgValStrDate::IDD, pParent)
|
|
{
|
|
|
|
}
|
|
|
|
CDlgValStrDate::~CDlgValStrDate()
|
|
{
|
|
}
|
|
|
|
void CDlgValStrDate::DoDataExchange(CDataExchange* pDX)
|
|
{
|
|
CDlgValStrBase::DoDataExchange(pDX);
|
|
DDX_Control(pDX, IDC_DATE_TYPE_COMBO, m_ValDateTypeComb);
|
|
}
|
|
|
|
// CDlgValStrDate 消息处理程序
|
|
void CDlgValStrDate::DynamicCastStrBase()
|
|
{
|
|
m_pValStrDate = dynamic_cast<CValStrDate*>(m_pValStrBase);
|
|
}
|
|
BOOL CDlgValStrDate::OnInitDialog()
|
|
{
|
|
CDlgValStrBase::OnInitDialog();
|
|
|
|
IniDateTypeComb();
|
|
if(!m_bAdd && m_pValStrDate)
|
|
{
|
|
m_ValDateTypeComb.SetCurSel(m_pValStrDate->GetDateType());
|
|
}
|
|
|
|
UpdateData(FALSE);
|
|
return TRUE;
|
|
}
|
|
void CDlgValStrDate::IniDateTypeComb()
|
|
{
|
|
for(VAL_DATE_TYPR type = _DATE_YEAR_FOUR;type<_DATE_MAX;type = (VAL_DATE_TYPR)(type+1))
|
|
{
|
|
CValStrDate ValStrDate;
|
|
ValStrDate.SetDateType(type);
|
|
CString str = ValStrDate.GetDateTypeStr() + "-" + ValStrDate.GetValStr();
|
|
m_ValDateTypeComb.InsertString(type,str);
|
|
}
|
|
m_ValDateTypeComb.SetCurSel(0);
|
|
}
|
|
void CDlgValStrDate::OnBnClickedOk()
|
|
{
|
|
UpdateData(TRUE);
|
|
CValStrDate *p = new CValStrDate;
|
|
p->SetDateType((VAL_DATE_TYPR)m_ValDateTypeComb.GetCurSel());
|
|
m_pValString->AddValStr(p);
|
|
|
|
OnOK();
|
|
} |