// DlgChipModify.cpp : _xZkqqHx_iDeDiDjDiDhGiDiKiDiBiDjDiDgFiBfLiDfGiDiHiDjD_xHqqkZx_ _xZkqqHx_iDhEiDeAiDeDiDiL_xHqqkZx_
//

#include "stdafx.h"
#include "DynamicDraw.h"
#include "ZOrder.h"			// For FCZOrder.
//#include "ObjDynabase.h"		// For FCObjDynabase.
#include "SheetManager.h"	// For FCSheetManager.
#include "UtilStr.h"		// For GetResString.
#include "DlgInputStr.h"	// For CFCDlgInputStr.
#include "DlgChipModify.h"	// This header.

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


/////////////////////////////////////////////////////////////////////////////
// CFCDlgChipModify _xZkqqHx_iDfPiDeDiDeBiDiNiDeP_xHqqkZx_


/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgChipModify::CFCDlgChipModify
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	
 *
 * <_xZkqqHx_iPnKiNnH_xHqqkZx_>	
 *
 * <_xZkqqHx_jCiNiInD_xHqqkZx_>	
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	03.06.24 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
CFCDlgChipModify::CFCDlgChipModify (CWnd* pParent /*=NULL*/) : BASE_CLASS(pParent)
{
	//{{AFX_DATA_INIT(CFCDlgChipModify)
		// _xZkqqHx_iDiBiDiC_xHqqkZx_ - ClassWizard _xZkqqHx_iCmNiClBiCmMiImKjChFiCmJiDhNiDgCiDhDiDjDiDePjHhAiCmMiDhNiDeOiDiNiCpAjCmHiJmBiCnMiClNiCmNiNoNiPjMiClFiCnMiClHiBeC_xHqqkZx_
	//}}AFX_DATA_INIT

//----- 01.04.08 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	//----- _xZkqqHx_iDiGiBfLiDfFjFmPjAjEiPiJiKpKiJlL_xHqqkZx_ -----
//	m_iChipModified = 0;	// 0:_xZkqqHx_jGkCiPeDjAlDiBeB_xHqqkZx_1:_xZkqqHx_iPeDjAlDjCiGiBeB_xHqqkZx_2:_xZkqqHx_iOpDjAeNjCiGiBeB_xHqqkZx_3:_xZkqqHx_iOpDjAeNiNmPiCnNiBeC_xHqqkZx_
//----- 01.04.08 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
} // CFCDlgChipModify::CFCDlgChipModify.


void CFCDlgChipModify::DoDataExchange(CDataExchange* pDX)
{
	BASE_CLASS::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CFCDlgChipModify)
		// _xZkqqHx_iDiBiDiC_xHqqkZx_ - ClassWizard _xZkqqHx_iCmNiClBiCmMiImKjChFiCmJiDhNiDgCiDhDiDjDiDePjHhAiCmMiDhNiDeOiDiNiCpAjCmHiJmBiCnMiClNiCmNiNoNiPjMiClFiCnMiClHiBeC_xHqqkZx_
	//}}AFX_DATA_MAP
} // CFCDlgChipModify::DoDataExchange.

/////////////////////////////////////////////////////////////////////////////
// CFCDlgChipModify _xZkqqHx_iDiGiBfLiDfFiKnGjAjEiBeC_xHqqkZx_

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgChipModify::SetChipRec
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDiMiDfCiBfLiDgIiCpAjAnNjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.03.26 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void CFCDlgChipModify::SetChipRec (const FCChipRec& rec)
{
	m_chipRec = rec;
} // CFCDlgChipModify::SetChipRec.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgChipModify::GetChipRec
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDiMiDfCiBfLiDgIiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.03.26 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
const FCChipRec& CFCDlgChipModify::GetChipRec () const
{
	return m_chipRec;
} // CFCDlgChipModify::GetChipRec.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgChipModify::GetEditdrawCommand
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iCmHiCmMiDeHiDgGiDeCiDgCiDgHiDgIiDiNiBfLiCpAiLeOjDkOiClHiCoJiCkJiOhHjCoIiClHiCoJiClNiCnPiCmMiDfCiDhNiDjDiDgIiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.04.08 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
const wchar_t* CFCDlgChipModify::GetEditdrawCommand () const
{
	return L"chipedit";
} // CFCDlgChipModify::GetEditdrawCommand.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgChipModify::ReceiveRecFromSheet
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfGiBfLiDgHiCkJiCoHiBeBiDiMiDfCiBfLiDgIiPoOjFpBiCpAiOoGiCoIiPgPiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	_xZkqqHx_iDeHiDgGiDeCiDgCiDgHiDgIiDiNiBfLiCkJiCoHiDgGiBfLiDfOiOpDjAeNiClFiClNiCmGiCkLiCmJiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.04.08 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void CFCDlgChipModify::ReceiveRecFromSheet (const FCSheetManager& sheetManager)
{
	// _xZkqqHx_iChJiDeJiBfLiDfPiBfLiCpAiOoGjDlOiBeC_xHqqkZx_
	FCZOrder zOrder;
	sheetManager.GetFrontSheet()->GetZOrder(zOrder, FDOZ_ON_ANY);
	WString strChipName;
	if (m_chipRec.m_objpChipMaster == NULL)
	//----- _xZkqqHx_iDgAiDgCiDhGiDeHiDgGiDeCiDfOiLeOjDkOiPpDjBnEiCkKiDgAiDgCiDhGjAfGiLeLiNoMjAkMiCmMiPoKiNiH_xHqqkZx_ -----
	{
		// IDS_UNTITLED_CHIP = "_xZkqqHx_jGlDjBoIiDgAiDgCiDhG_xHqqkZx_"
		strChipName = GetResWString(IDS_UNTITLED_CHIP);
	} else
	//----- _xZkqqHx_iDgAiDgCiDhGiDeHiDgGiDeCiDfOiLeOjDkOiPpDjBnEiCkKiDgAiDgCiDhGiPeDjAlDiCmMiPoKiNiH_xHqqkZx_ -----
	{
		strChipName = m_chipRec.m_szName;
	}
	//----- _xZkqqHx_iDgAiDgCiDhGjGlMiCpAiDfPiDeDiDeBiDiNiDePiCmFjAnNjCoI_xHqqkZx_ -----
	CFCDlgInputStr dlgStr;
	// IDS_MSG_INPUT_ENTRY_NAME = "_xZkqqHx_jDgPjIfOjGlMiCpAjDpMjHmNiClFiCmEiCkNiClOiClDiCkC_xHqqkZx_"
	dlgStr.m_strTitle.LoadString(IDS_MSG_INPUT_ENTRY_NAME);
	dlgStr.m_strInput = WStrToTStr(strChipName);
	if (dlgStr.DoModal() == IDOK)
		strChipName = (const wchar_t*)TStrToWStr(dlgStr.m_strInput);
	// _xZkqqHx_iDgAiDgCiDhGjFjEjFgJiCpAjDgPjIfOiBeCjDoAjFjEiCmFiMlLiNnNiCmMjBeJjBpAiCoAjFmPiNfIiBeC_xHqqkZx_
	m_chipRec.Init(zOrder.Front(), strChipName);
} // CFCDlgChipModify::ReceiveRecFromSheet.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgChipModify::SetRecToSheet
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfGiBfLiDgHiCmJiCkJiCoHiBeBiDiMiDfCiBfLiDgIiPoOjFpBiCpAjAnNjCoIiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	_xZkqqHx_iDeHiDgGiDeCiDgCiDgHiDgIiDiNiBfLiCpAiLeOjDkOiClHiCoJiCmGiCkLiCmJiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	sheetManager	:_xZkqqHx_iDfGiBfLiDgHiDhNiDgMiBfLiDfHiDiDiCpAiOhHjCoIiBeC_xHqqkZx_
 *			szName			:_xZkqqHx_iDiMiDfCiBfLiDgIjGlMiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.04.08 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void CFCDlgChipModify::SetRecToSheet (FCSheetManager& sheetManager, wchar_t szName[]) const
{
	// _xZkqqHx_iDfGiBfLiDgHiDhNiDgMiBfLiDfHiDiDiCmJiDgAiDgCiDhGjFjEjFgJiCpAjAnNjCoIiBeC_xHqqkZx_
	if (m_chipRec.m_objpChipMaster != NULL)
		sheetManager.GetFrontSheet()->AppendToLZOrder(m_chipRec.m_objpChipMaster);
	// IDS_UNTITLED_CHIP = "_xZkqqHx_jGlDjBoIiDgAiDgCiDhG_xHqqkZx_"
	if (wcslen(m_chipRec.m_szName) != 0)
		wcscpy(szName, m_chipRec.m_szName);
	else
		wcscpy(szName, GetResWString(IDS_UNTITLED_CHIP));
} // CFCDlgChipModify::SetRecToSheet.

BEGIN_MESSAGE_MAP(CFCDlgChipModify, BASE_CLASS)
	//{{AFX_MSG_MAP(CFCDlgChipModify)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CFCDlgChipModify _xZkqqHx_iDiBiDgCiDfKiBfLiDfH_xHqqkZx_ _xZkqqHx_iDgOiDjDiDgIiDiJ_xHqqkZx_

