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

#include "EDACDgIC.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


BEGIN_MESSAGE_MAP(EdActors_InstanceCreationDialog, CDialog)
	//{{AFX_MSG_MAP(EdActors_InstanceCreationDialog)
	ON_WM_DESTROY()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


//***************************************************************************
EdActors_InstanceCreationDialog::EdActors_InstanceCreationDialog(CString _csModelName,
																																 CString _csDefaultName,
																																 CWnd* pParent /*=NULL*/)
																: CDialog(EdActors_InstanceCreationDialog::IDD, &g_oBaseFrame)
{
	//{{AFX_DATA_INIT(EdActors_InstanceCreationDialog)
	m_pri_csNewInstanceName = _csDefaultName;
	//}}AFX_DATA_INIT

	m_pri_csModelName = _csModelName;
}


//***************************************************************************
void EdActors_InstanceCreationDialog::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(EdActors_InstanceCreationDialog)
	DDX_Text(pDX, IDC_EDIT_NAME, m_pri_csNewInstanceName);
	//}}AFX_DATA_MAP
}

/////////////////////////////////////////////////////////////////////////////
// EdActors_InstanceCreationDialog message handlers

//***************************************************************************
BOOL EdActors_InstanceCreationDialog::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	GetDlgItem(IDC_STATIC_TEXT)->SetWindowText(CString("You are going to instanciate the Model '") + m_pri_csModelName + "' ...");

	//////////////
	//////////////
	//Registers for TUT Module
	TUT_M_vGetTutDll();
	
	TUT_M_vRegisterControl(m_hWnd, "OAc_ActorCreationNameDialog_Window", TUT_e_Window);
	TUT_M_vRegisterControlID(IDC_EDIT_NAME, "OAc_ActorCreationNameDialog_NameEdit", TUT_e_TextEdit);
	TUT_M_vRegisterControlID(IDOK, "OAc_ActorCreationNameDialog_OKButton", TUT_e_Button);
	TUT_M_vRegisterControlID(IDCANCEL, "OAc_ActorCreationNameDialog_CancelButton", TUT_e_Button);

	//End of Register for TUT Module
	//////////////

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

//***************************************************************************
void EdActors_InstanceCreationDialog::OnDestroy() 
{
	//////////////
	//////////////
	//UnRegisters for TUT Module
	TUT_M_vGetTutDll();
	
	TUT_M_vUnregisterControl(m_hWnd);
	TUT_M_vUnregisterControlID(IDC_EDIT_NAME);
	TUT_M_vUnregisterControlID(IDOK);
	TUT_M_vUnregisterControlID(IDCANCEL);
	
	//End of UnRegister for TUT Module
	//////////////

	CDialog::OnDestroy();
}

//***************************************************************************
CString EdActors_InstanceCreationDialog::m_fn_csGetNewInstanceName()
{
	return m_pri_csNewInstanceName;
}

