#include "stdafx.h"
#include "DynamicDraw.h"			// For FFGetApp.
#include "CommonDrawFrame.h"	// For GetCurChip.
#include "ObjChipMaster.h"		// for FCObjChipMaster.
#include "ToolChipPut.h"		// This header.

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



// 02.12.05 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//FCToolChipPut g_toolChipPut;

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolChipPut::FCToolChipPut
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfCiDjDiDfIiDgHiDiJiDeOiDfOiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.04.30 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
FCToolChipPut::FCToolChipPut ()
{
	// _xZkqqHx_iDfCiDjDiDgHiDiNiBfLiDiLiDeMiBfLiCpAiLhEiCmJiBeC_xHqqkZx_
	m_bControlInvert = TRUE;
} // FCToolChipPut::FCToolChipPut.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolChipPut::CanToolselfProperty
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDgDiBfLiDiLiOkJjAgHiCmMiDhGiDiNiDhAiDgFiDeCiDfPiDeDiDeBiDiNiDePiCkKjFfMiOkGiCmFiCkLiCoJiCkJiCmHiCkEiCkJiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iCmFiCkLiCoJiPoKiNiHiCmN_xHqqkZx_ TRUE_xZkqqHx_iBeBiCmFiCkLiCmIiCkCiPoKiNiHiCmN_xHqqkZx_ FALSE _xZkqqHx_iCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.04.30 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL FCToolChipPut::CanToolselfProperty () const
{
	return FALSE;
} // FCToolChipPut::CanToolselfProperty.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolChipPut::CreateRegisteredObject
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFjEjFgJiCmMjEhKjChFiOjOiCmJiBeBiOfBiPmGjFjEjFgJiCpAiMlDiCmJiNoMjAkMiClHiCoJjFjEjFgJiCpAiNoMjAkMiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	vNewObj		:_xZkqqHx_iNoMjAkMiClFiClNjFjEjFgJiCpAjFnEiClHiBeC_xHqqkZx_
 *			mmrtFrame	:vNewObj_xZkqqHx_iCmMiDhEiDiMiBfLiDiAiCpAjFnEiClHiBeC_xHqqkZx_
 *			vLinkRec	:vNewObj_xZkqqHx_iCmJjElKiCkEjAfGiClFiCkCiDiKiDjDiDeOiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	ToolChipPut_xZkqqHx_iCmMjDmGjHkHjFjEjFgJiDgAiDgCiDhGiCmJjBmOiJjOiClHiCoJiClNiCnPiBeBiClBiCmMiKnGjAjEiCpAjCmHiJmBiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.08.13 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolChipPut::CreateRegisteredObject (	ObjDynabaseVector& vNewObj,
												DBLRect& mmrtFrame,
												FCLinkRecVector& vLinkRec) const
{
	ASSERT(m_pReference->Type() == FDOJ_CHIP_MASTER);
	vNewObj.clear();
	vLinkRec.clear();
	// _xZkqqHx_iDiKiDhEiDeAiDiMiDjDiDfIjFjEjFgJiCkJiCoHiNoMjAkMiClDiCoKiClNjFjEjFgJiBeC_xHqqkZx_
	FCObjChipMaster* pNewObject = (FCObjChipMaster*)m_pReference->Duplicate();
	mmrtFrame = pNewObject->GetResizeFrame();
	// _xZkqqHx_jFjEjFgJ_xHqqkZx_ID_xZkqqHx_iCpAiOoGjDlOiClFiBeBjFjEjFgJiCmJjAnNjCoIiClHiCoJiBeC_xHqqkZx_
	pNewObject->RegisterObjID();

	if (pNewObject->GetChipKind() == FDCM_OBJECT_CHIP)
	//----- _xZkqqHx_jDmGjHkHjFjEjFgJiDgAiDgCiDhG_xHqqkZx_ -----
	{
		pNewObject->GetLink(vLinkRec);
		vNewObj.insert(	vNewObj.end(),
						pNewObject->GetMemberArray(),
						pNewObject->GetMemberArray() + pNewObject->GetMemberSize());

		// _xZkqqHx_iDePiDiLiBfLiDhGjFjEjFgJjCiGiCmMiDiBiDjDiDgPjFjEjFgJiDgFiBfLiDhFiDiLiCpAiDeOiDiKiDeBiBeCiDePiDiLiBfLiDhGjFjEjFgJiNoNiPjMiOjOiCmJ_xHqqkZx_
		// _xZkqqHx_iIoKiPiPiCmJiNoNiPjMiClDiCoKiCoJiClBiCmGiCkKiCmIiCkCiCoGiCkEiCmJiBeC_xHqqkZx_
		pNewObject->ClearGroup();
		// _xZkqqHx_jFjEjFgJiCpA_xHqqkZx_ID_xZkqqHx_iDgFiBfLiDhFiDiLiCkJiCoHjGjFiPmBiBeC_xHqqkZx_
		pNewObject->UnregisterObjID();
//----- 02.05.29 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ (Molip_xZkqqHx_iCpA_xHqqkZx_OLE_xZkqqHx_iCmGiClFiCmEiDhJiBfLiDfIiDgHiClFiClNjAoGiCmMiDeBiDhGiDiKiCkJiCoHiBeB_xHqqkZx_Molip_xZkqqHx_iNmEjFnCiPfHiCkKiCmFiCkLiCmIiCkNiCmIiCmBiCmEiClFiCnMiCkEiBeC_xHqqkZx_)-----
//		// _xZkqqHx_jFjEjFgJiCmMiPeJjHlJiPiIjHjNiBeC_xHqqkZx_
//		pNewObject->Terminate();
//----- 02.05.29 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ (Molip_xZkqqHx_iCpA_xHqqkZx_OLE_xZkqqHx_iCmGiClFiCmEiDhJiBfLiDfIiDgHiClFiClNjAoGiCmMiDeBiDhGiDiKiCkJiCoHiBeB_xHqqkZx_Molip_xZkqqHx_iNmEjFnCiPfHiCkKiCmFiCkLiCmIiCkNiCmIiCmBiCmEiClFiCnMiCkEiBeC_xHqqkZx_)-----
		// _xZkqqHx_jFjEjFgJiCpAiNoNiPjMiBeC_xHqqkZx_
		delete pNewObject;
	} else
	//----- _xZkqqHx_jFkBiNiHjFjEjFgJiDgAiDgCiDhG_xHqqkZx_ -----
	{
		vNewObj.push_back(pNewObject);
	}
} // FCToolChipPut::CreateRegisteredObject .

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolChipPut::GetDefaultIdleCursor
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	StateIdle_xZkqqHx_iCmFiDgGiDhEiDeIiDiLiDgHiCmJiOgHiCoNiCoKiCoJiDeKiBfLiDfMiDiLiDgOiDjDiDgIiDiLiCpAjFnEiClHiBeC_xHqqkZx_
 *			_xZkqqHx_jFfHiPiAiCmMiDeKiBfLiDfMiDiLiCmMiPoKiNiHiCmN_xHqqkZx_ NULL_xZkqqHx_iCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.07.20 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
HCURSOR FCToolChipPut::GetDefaultIdleCursor () const
{
	return FFGetApp()->LoadCursor(IDC_CURSOR_TOOL_CHIP_PUT);
} // FCToolChipPut::GetDefaultIdleCursor.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolChipPut::GetReferenceObject
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFjEjFgJiNoMjAkMjHhAiCmMiDiKiDhEiDeAiDiMiDjDiDfIjFjEjFgJiCpAiOoGjDlOiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDiKiDhEiDeAiDiMiDjDiDfIjFjEjFgJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jCiNiInD_xHqqkZx_>	ToolChip_xZkqqHx_iCmNiBeBiDgAiDgCiDhGiCmMjBeJjBpAiPpDjBnEiCmJiCoGiCmBiCmEiInJiCmIiCoJiDiKiDhEiDeAiDiMiDjDiDfIjFjEjFgJ_xHqqkZx_
 *			_xZkqqHx_iCpAiOjNiCmCiBeC_xHqqkZx_ToolChip_xZkqqHx_iOkJjAgHiCmNjDoAjFjEiCmJiDiKiDhEiDeAiDiMiDjDiDfIjFjEjFgJiCpAiOjNiClNiCmIiCkCiBeC_xHqqkZx_
 *			_xZkqqHx_iClBiCmMiClNiCnPiBeBiDiKiDhEiDeAiDiMiDjDiDfIjFjEjFgJiCmMiDfIiDgHiDiKiBfLiDiAjDpMiPgPjHmNiPiIjHjNiCmJjBmOiJjOiClFiCmIiCkCiCkK_xHqqkZx_
 *			ToolBaseCreate_xZkqqHx_iCmMiClNiCnPiCmJiDiKiDhEiDeAiDiMiDjDiDfIjFjEjFgJiCpAjCpBiLjPiClFiCmIiCkPiCoKiCmOiCmIiCoHiCmIiCkCiBeC_xHqqkZx_
 *			_xZkqqHx_iClBiCmMjGlFiPiCiCpAiJpAiPmBiClHiCoJiClNiCnPiCmJiClBiCmMiKnGjAjEiCpAiNoMiCmBiClNiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.04.30 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
const FCObjDynabase* FCToolChipPut::GetReferenceObject ()
{
	if (FFCommonDrawFrame() != NULL && FFCommonDrawFrame()->GetCurChipId() != FD_CHIP_UNSPECIFY)
		return g_pEnv->GetChipRec(FFCommonDrawFrame()->GetCurChipId())->m_objpChipMaster;
	return NULL;
} // FCToolChipPut::GetReferenceObject.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolChipPut::StateDoPutText
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDgFiDeMiDfIiDgHjAnNjCoIiPiIjHjNiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC	:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.05.01 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolChipPut::StateDoPutText (CDC* pDC)
{
	TRACE(_T("FCToolChipPut::StateDoPutText\r\n"));
	// Superclass_xZkqqHx_iOmAiNhDiBeC_xHqqkZx_
	BASE_CLASS::StateDoPutText(pDC);
	// _xZkqqHx_iDfKiDgCiDfGiDiHiDjDiPeJjHlJiBeC_xHqqkZx_
	EndOfSession();
} // FCToolChipPut::StateDoPutText.
