www.gusucode.com > VC++开发的ACD树形策略编辑器-源码程序 > VC++开发的ACD树形策略编辑器-源码程序/code/Sign.cpp

    //Download by http://www.NewXing.com
// Sign.cpp : implementation file
//

#include "stdafx.h"
#include "dsACD_IVR.h"
#include "Sign.h"

#include "dsACD_IVRDoc.h"
#include "dsACD_IVRView.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CSign dialog


CSign::CSign(CWnd* pParent /*=NULL*/)
	: CDialog(CSign::IDD, pParent)
{
	//{{AFX_DATA_INIT(CSign)
	m_csComment = _T("");
	m_csName = _T("");
	//}}AFX_DATA_INIT
}


void CSign::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CSign)
	DDX_Text(pDX, IDC_SIG_COMMENT, m_csComment);
	DDX_Text(pDX, IDC_SIG_NAME, m_csName);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CSign, CDialog)
	//{{AFX_MSG_MAP(CSign)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CSign message handlers
void CSign::DisplayDlg(dsACDObjectBase *pObj)
{
	dsSig_INFO * pSigInfo = (dsSig_INFO*) pObj->Read();
	m_csName = pSigInfo->Name;
	m_csComment = pSigInfo->Comment;

	if(DoModal()==IDOK)
	{
		pSigInfo->Name = m_csName;
		pSigInfo->Comment = m_csComment;
	}
	else 
		return;
}

void CSign::OnOK() 
{
	UpdateData(TRUE);

	if(m_csName.IsEmpty())
	{
		AfxMessageBox("名字不能空");
		return ;
	}
	
	CDialog::OnOK();
}