#include "stdafx.h"
#include "ObjLabel.h"		// For FCObjLabel.
#include "ToolLabelPut.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_ ()
//FCToolLabelPut g_toolLabelPut;

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLabelPut::FCToolLabelPut
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfCiDjDiDfIiDgHiDiJiDeOiDfO_xHqqkZx_.
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	wImageType	:_xZkqqHx_jDoAjFjEjFjEjFgJiCmMiPiJiKpKiDeDiDiBiBfLiDfHiDfOiDeDiDhGiCpAiOhHjCoIiBeC_xHqqkZx_
 *						 0:_xZkqqHx_iJjEjFeNiBeB_xHqqkZx_1:_xZkqqHx_iOiGiBeB_xHqqkZx_2:_xZkqqHx_iOjOiMhGiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.04.20 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
FCToolLabelPut::FCToolLabelPut (WORD wImageType)
				:m_wInitImageType(wImageType)
{
} // FCToolLabelPut::FCToolLabelPut.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLabelPut::CreateInsideObject
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jDoAjFjEjFjEjFgJiCpAiNoMjAkMiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_jDoAjFjEjFjEjFgJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.07.15 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
FCObjDynabase* FCToolLabelPut::CreateInsideObject ()
{
	FCObjDynabase* pObj = new FCObjLabel(m_wInitImageType);
	pObj->CalcResizeFrame();
	pObj->Resize(TRUE, TRUE, DBLRect(0.0, 0.0, 20.0, 10.0), pObj->GetResizeFrame());
//----- 06.11.26 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	// _xZkqqHx_jFjEjFgJiCpAjEjCjAeGjDgIiCoIiCmCiCnEiClFiCmFiPiJiKpKiJlLiBeC_xHqqkZx_
	InitInsideObject(pObj);
//----- 06.11.26 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----
	return pObj;
} // FCToolLabelPut::CreateInsideObject.

//----- 05.07.15 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLabelPut::OnViewCreate
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	CFCDynamicDrawView::OnCreate_xZkqqHx_iCkJiCoH_xHqqkZx_Call_xZkqqHx_iBeC_xHqqkZx_Tool_xZkqqHx_iCmMiPiJiKpKiJlLiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.04.20 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//void FCToolLabelPut::OnViewCreate ()
//{
//	// Superclass_xZkqqHx_iKnGjAjEiOmAiNhDiBeC_xHqqkZx_
//	BASE_CLASS::OnViewCreate();
//	//----- _xZkqqHx_iDiKiDhEiDeAiDiMiDjDiDfIjFjEjFgJiCmMiNoMjAkM_xHqqkZx_ -----
//	m_objpReference = new FCObjLabel();
//	m_objpReference->CalcResizeFrame();
//// 05.05.02 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
////	m_objpReference->CalcOuterFrame();
//	m_objpReference->Resize(TRUE, TRUE, DBLRect(0.0, 0.0, 20.0, 10.0), m_objpReference->GetResizeFrame());
//} // FCToolLabelPut::OnViewCreate.
//----- 05.07.15 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

//----- 05.07.15 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLabelPut::OnViewDestroy
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	CFCDynamicDrawView::OnDestroy_xZkqqHx_iCkJiCoH_xHqqkZx_Call_xZkqqHx_iBeC_xHqqkZx_Tool_xZkqqHx_iCmMiPeJjHlJiPiIjHjNiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.04.20 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//void FCToolLabelPut::OnViewDestroy ()
//{
//	// _xZkqqHx_jDoAjFjEiDgDiBfLiDiLjDoAjFjEjFjEjFgJiNoNiPjMiBeC_xHqqkZx_
//	delete m_objpReference;
//	m_objpReference = NULL;
//	// Superclass_xZkqqHx_iKnGjAjEiOmAiNhDiBeC_xHqqkZx_
//	BASE_CLASS::OnViewDestroy();
//} // FCToolLabelPut::OnViewDestroy.
//----- 05.07.15 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

//----- 05.07.15 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLabelPut::GetInsideObject
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFjEjFgJiCmMjAlGjAkMiCmJiOgHjHhAiClDiCoKiCoJjDoAjFjEiDgDiBfLiDiLjDoAjFjEjFjEjFgJiCpAjFnEiClH_xHqqkZx_.
// *
// * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_jDoAjFjEiDgDiBfLiDiLjDoAjFjEjFjEjFgJiCmMiDhMiDeDiDjDiDfO_xHqqkZx_.
// *
// * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	_xZkqqHx_iClBiCmMjFjEjFgJiCpAiOgHiCmBiCmEiBeBiDhNiDeFiDfIiInKjDkOiOjOiCmMjFgAiJoGiCoCjFjEjFgJiCmMjAlGjAkMiCpAiNhDiCkE_xHqqkZx_.
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.04.20 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//FCObjDynabase* FCToolLabelPut::GetInsideObject () const
//{
//	return m_objpReference;
//} // FCToolLabelPut::GetInsideObject.
//----- 05.07.15 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

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

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLabelPut::StopToEditText
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDeHiDgGiDeCiDfOiCmMjFnCiPfHiPeJjHlJiOjOiCmJiMmEiCmOiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jCiNiInD_xHqqkZx_>	_xZkqqHx_iClBiClBiCmJjHiIiClNiOjOiCmNiLeMjIfOiDfKiDgCiDfGiDiHiDjDiCmMiNmFjCiGiCmFiCkAiCoJiClBiCmGiCmJjCiNiInDiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	02.02.16 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolLabelPut::StopToEditText ()
{
	// Superclass_xZkqqHx_iKnGjAjEiOmAiNhDiBeC_xHqqkZx_
	BASE_CLASS::StopToEditText();
	// _xZkqqHx_iLeMjIfOiDfKiDgCiDfGiDiHiDjDiCmMiPeJjHlJiBeC_xHqqkZx_StateDoPutText_xZkqqHx_iKnGjAjEiCmFiKeKiOgOiClDiCoKiClNiDfKiDgCiDfGiDiHiDjDiCpAjFmCiClGiCoJiBeC_xHqqkZx_
	g_pDoc->SessionEnd();
} // FCToolLabelPut::StopToEditText.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLabelPut::StateDoPutText
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDgFiDeMiDfIiDgHjAnNjCoIiPiIjHjNiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC	:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.04.20 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolLabelPut::StateDoPutText (CDC* pDC)
{
	TRACE(_T("StateDoPutText\r\n"));
	// _xZkqqHx_iLeMjIfOiDfKiDgCiDfGiDiHiDjDiKeKiOgOiBeC_xHqqkZx_BASE_CLASS::StateDoPutText_xZkqqHx_iBeB_xHqqkZx_StartToEditText_xZkqqHx_jCiG_xHqqkZx_
	// _xZkqqHx_iCmFiCoA_xHqqkZx_SessionBegin_xZkqqHx_iCmNiOmAiNhDiClDiCoKiCoJiCkKiBeBiClBiCmMjDpBiCmCiCpAiCfAiDfKiDgCiDfGiDiHiDjDiCmJiKiHiCoJiClNiCnPiBeB_xHqqkZx_
	// _xZkqqHx_iClBiClBiCmFiOmAiNhDiClHiCoJiBeC_xHqqkZx_
	g_pDoc->SessionBegin();
	// Superclass_xZkqqHx_iKnGjAjEiOmAiNhDiBeC_xHqqkZx_
	BASE_CLASS::StateDoPutText(pDC);
	if (m_pReference != NULL)
	//----- _xZkqqHx_iDiKiDhEiDeAiDiMiDjDiDfIjFjEjFgJiCkKjBlGiNnNiClHiCoJiPoKiNiH_xHqqkZx_ -----
	{
		// BASE_CLASS::StateDoPutText_xZkqqHx_iCmJiCkIiCkCiCmEiBeBiDiKiDhEiDeAiDiMiDjDiDfIjFjEjFgJiCmM_xHqqkZx_
		// _xZkqqHx_jFkBjAlLiCkK_xHqqkZx_SetLastCreateObj_xZkqqHx_iCmFjAnNjCoIiClDiCoKiCmEiCkCiCoJiBeC_xHqqkZx_
		FCObjDynabase* pNewObject = (FCObjDynabase*)GetLastCreateObj();
		// _xZkqqHx_iDgFiDeMiDfIiDgHjFjEjFgJiCpAiDeHiDgGiDeCiDgCiDgHiPpDjBnEiCmJiClHiCoJiBeC_xHqqkZx_
		StartToEditText((FCObjFigure*)pNewObject, NULL, NULL);
	}
	// _xZkqqHx_iDgFiDeMiDfIiDgHjFnCiPfHjCiGiCmFjGlDiCkPiCoKiCmOiBeBiLeMjIfOiDfKiDgCiDfGiDiHiDjDiCmMiPeJjHlJiBeC_xHqqkZx_
	// _xZkqqHx_iPoDiLeMiCmFiKeKiOgOiClDiCoKiClNiDfKiDgCiDfGiDiHiDjDiCmNiBeB_xHqqkZx_StopToEditText_xZkqqHx_iKnGjAjEiCmFjFmCiClGiCoJiClNiCnPiBeB_xHqqkZx_
	// StartToEditText _xZkqqHx_iCmFiDgFiDeMiDfIiDgHjFnCiPfHiKeKiOgOiCkKjAkMiMpHiClFiClNiPoKiNiHiCmMiCnNiBeB_xHqqkZx_
	// _xZkqqHx_jHeMiMpIiCmGiClFiCmIiCkPiCoKiCmOiCmIiCoHiCmIiCkCiBeC_xHqqkZx_
	if (!IsEditingText()) g_pDoc->SessionEnd();
} // FCToolLabelPut::StateDoPutText.
