#include "CAniEditorChangeID.h"
#include "resource.h"

IMPLEMENT_DYNAMIC(CAniEditorChangeID, CDialog)

BEGIN_MESSAGE_MAP(CAniEditorChangeID, CDialog)
	ON_BN_CLICKED(IDOK, &CAniEditorChangeID::OnBnClickedOk)
END_MESSAGE_MAP()

CAniEditorChangeID::CAniEditorChangeID(CWnd* pParent)
	: CDialog(IDD_CANIEDITOR_CHANGE_ID, pParent)
{
}

CAniEditorChangeID::~CAniEditorChangeID()
{
}

void CAniEditorChangeID::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	DDX_Control(pDX, IDC_EDIT_IDSRC, edit_idSrc);
	DDX_Control(pDX, IDC_EDIT_IDDST, edit_idDst);
}

BOOL CAniEditorChangeID::OnInitDialog()
{
	CDialog::OnInitDialog();
	SetDlgItemInt(IDC_EDIT_IDSRC, 0);
	SetDlgItemInt(IDC_EDIT_IDDST, 0);
	return 0;
}


void CAniEditorChangeID::OnBnClickedOk()
{
	CString str;
	edit_idSrc.GetWindowTextW(str);
	if (str.GetLength() == 0)
	{
		MessageBoxW(L"必须填写源ID");
		return;
	}
	edit_idDst.GetWindowTextW(str);
	if (str.GetLength() == 0)
	{
		MessageBoxW(L"必须填写目标ID");
		return;
	}
	outIDSrc = GetDlgItemInt(IDC_EDIT_IDSRC);
	outIDDst = GetDlgItemInt(IDC_EDIT_IDDST);
	CDialog::OnOK();
}
