// CPACMNDg.cpp : implementation file
/////////////////////////////////////////////////////////////////////////////
#include "StdAfx.h"

#include "EDACDgMN.hpp"
#include "EDACGlob.hpp"
#include "_AInterf.hpp"

//External Modules
#include "IncTUT.h"
//End of External Modules

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

/////////////////////////////////////////////////////////////////////////////
// EdActors_ActorNameChangeDialog dialog
BEGIN_MESSAGE_MAP(EdActors_ActorNameChangeDialog, CDialog)
	//{{AFX_MSG_MAP(EdActors_ActorNameChangeDialog)
	ON_WM_DESTROY()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

//****************************************************************************
EdActors_ActorNameChangeDialog::EdActors_ActorNameChangeDialog(	CString csProposedName, 
																																CWnd* pParent /*=NULL*/)
															: CDialog(EdActors_ActorNameChangeDialog::IDD, &g_oBaseFrame)
{
	//{{AFX_DATA_INIT(EdActors_ActorNameChangeDialog)
	m_csNewName = csProposedName;
	//}}AFX_DATA_INIT
}

//****************************************************************************
void EdActors_ActorNameChangeDialog::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(EdActors_ActorNameChangeDialog)
	DDX_Text(pDX, IDC_EDIT_FOR_NAME, m_csNewName);
	//}}AFX_DATA_MAP
}

/////////////////////////////////////////////////////////////////////////////
// EdActors_ActorNameChangeDialog message handlers

//****************************************************************************
BOOL EdActors_ActorNameChangeDialog::OnInitDialog() 
{
	CDialog::OnInitDialog();

	//////////////
	//////////////
	//Registers for TUT Module
	TUT_M_vGetTutDll();
	
	TUT_M_vRegisterControlID(IDC_EDIT_FOR_NAME, "OAc_ActorNameChangeDialog_NameEdit", TUT_e_TextEdit);
	TUT_M_vRegisterControlID(IDOK, "OAc_UndoRedoDialog_OKButton", TUT_e_Button);
	TUT_M_vRegisterControlID(IDCANCEL, "OAc_UndoRedoDialog_CancelButton", TUT_e_Button);

	//End of Registers for TUT Module
	//////////////
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

//****************************************************************************
void EdActors_ActorNameChangeDialog::OnDestroy() 
{
	//////////////
	//////////////
	//UnRegisters for TUT Module
	TUT_M_vGetTutDll();
	
	TUT_M_vUnregisterControlID(IDC_EDIT_FOR_NAME);
	TUT_M_vUnregisterControlID(IDOK);
	TUT_M_vUnregisterControlID(IDCANCEL);
	
	//End of UnRegisters for TUT Module
	//////////////

	CDialog::OnDestroy();
}

//****************************************************************************
void EdActors_ActorNameChangeDialog::OnOK() 
{
	UpdateData(TRUE);

	//Checks validity for the new Name
	fn_vCheckAndChangeName(m_csNewName);
	
	EndDialog(IDOK);
}
