#include "StdAfx.h"
#include "EditValueCtrl.h"

CEditValueCtrl::CEditValueCtrl(void)
{
	ZeroMember();
}

CEditValueCtrl::~CEditValueCtrl(void)
{
	Clear();
}

void CEditValueCtrl::ZeroMember()
{
	m_pCombo = 0;
	m_pEdit = 0;
	m_pOk = 0;
	m_pClear = 0;
	m_ciValue = 0;
	m_pDate = 0;
}

void CEditValueCtrl::Clear()
{
	if(m_pCombo) delete m_pCombo;
	if(m_pEdit) delete m_pEdit;
	if(m_pClear) delete m_pClear;
	if(m_pOk) delete m_pOk;
	if(m_pDate) delete m_pDate;
	
	ZeroMember();
}

void CEditValueCtrl::SetEmptyValue()
{
	if(m_pCombo) m_pCombo->SetCurSel(0);
	else if(m_pEdit) m_pEdit->SetWindowText(_T(""));
	else if(m_pDate) m_pDate->SetTime(COleDateTime::GetCurrentTime());

	m_ciValue = 0;
}
