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

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

#include "stdafx.h"
#include "dsACD_IVR.h"
#include "ConControl.h"

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

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

/////////////////////////////////////////////////////////////////////////////
// CConControl dialog
CConControl::CConControl(CWnd* pParent /*=NULL*/)
	: CDialog(CConControl::IDD, pParent)
{
	//{{AFX_DATA_INIT(CConControl)
	m_csComment = _T("");
	m_csCondition = _T("");
	//}}AFX_DATA_INIT
}
void CConControl::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CConControl)
	DDX_Text(pDX, IDC_CC_COMMENT, m_csComment);
	DDX_CBString(pDX, IDC_CC_CONDITION, m_csCondition);
	//}}AFX_DATA_MAP
}


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

/////////////////////////////////////////////////////////////////////////////
// CConControl message handlers
BOOL CConControl::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	CComboBox *pCondition=(CComboBox *)GetDlgItem(IDC_CC_CONDITION);

	CString buf, csVariableName;
	m_pDsACD_IVRView->ReadVariable(buf);
	while (!buf.IsEmpty())
	{	csVariableName = buf.Left(buf.Find(";" ));
		pCondition->AddString(csVariableName);
		buf.Delete(0, buf.Find(";" )+1);
	}

	int nIndex = pCondition->SelectString(-1, m_csCondition);
	pCondition->SetCurSel(nIndex);
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CConControl::DisplayDlg(dsACDObjectBase *pObj)
{
	dsCC_INFO * pCCInfo = (dsCC_INFO*) pObj->Read();
	m_csCondition = pCCInfo->Condition;
	m_csComment = pCCInfo->Comment;

	if(DoModal()==IDOK)
	{
		pCCInfo->Condition = m_csCondition;
		pCCInfo->Comment = m_csComment;
	}
	else 
		return;
}