// DlgSColorModify.cpp : _xZkqqHx_iDeDiDjDiDhGiDiKiDiBiDjDiDgFiBfLiDfGiDiHiDjD_xHqqkZx_ _xZkqqHx_iDhEiDeAiDeDiDiL_xHqqkZx_
//

#include "stdafx.h"
#include "DynamicDraw.h"
#include "UtilDlg.h"			// For SetUnitString.etc.
#include "DlgSColorModify.h"	// This header.

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

/////////////////////////////////////////////////////////////////////////////
// CFCDlgSColorModify

IMPLEMENT_DYNAMIC(CFCDlgSColorModify, CColorDialog)

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgSColorModify::CFCDlgSColorModify
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfCiDjDiDfIiDgHiDiJiDeOiDfOiBeCiDiGiBfLiDfFiNoMjAkMiCmMiDgFiDjDiDhGiDiMiBfLiDgHiDiKiDfMiBfLiDfIiCpAjAnNjCoIiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	clrInit	:_xZkqqHx_iPiJiKpKiJlLjHhAiCmMjAeGiBeC_xHqqkZx_
 *			dwFlags	:_xZkqqHx_iDeKiDfIiDfOiDhNiDeDiDfJjHhAiDhEiDiJiDePiBeC_xHqqkZx_
 *			pParentWnd:_xZkqqHx_jAgFiDeFiDeCiDjDiDgIiDeFiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.05.05 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
CFCDlgSColorModify::CFCDlgSColorModify (COLORREF clrInit, DWORD dwFlags, CWnd* pParentWnd)
					:BASE_CLASS(clrInit, dwFlags, pParentWnd)
{
	//----- _xZkqqHx_iDgFiDjDiDhGiDiMiBfLiDgHiDiKiDfMiBfLiDfIiCpAjAnNjCoIiClHiCoJ_xHqqkZx_ -----
	m_cc.lpTemplateName = MAKEINTRESOURCE(IDD_COM_S_COLOR_MODIFY);
	m_cc.hInstance = (HWND)FFGetApp()->GetResourceInstance();
	m_cc.Flags |= CC_ENABLETEMPLATE;
	// _xZkqqHx_iDhHiDiLiDhGiDhLiDfOiDjDiCpAiPmBiLiOiBeC_xHqqkZx_
	m_cc.Flags &= ~CC_SHOWHELP;
//----- 01.03.11 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	// _xZkqqHx_iChCjAeGjGlMiCmMiPiJiKpKiJlLiBeC_xHqqkZx_
//	if (tcpName == NULL)
//		m_strColorName.Empty();
//	else
//		m_strColorName = tcpName;
//----- 01.03.11 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
} // CFCDlgSColorModify::CFCDlgSColorModify.

/////////////////////////////////////////////////////////////////////////////
// CFCDlgSColorModify_xZkqqHx_iDiGiBfLiDfFiKnGjAjEiBeC_xHqqkZx_

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgSColorModify::SetSColorRec
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDiMiDfCiBfLiDgIiCpAjAnNjCoIiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	rec	:_xZkqqHx_iDiMiDfCiBfLiDgIiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.03.11 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void CFCDlgSColorModify::SetSColorRec (const FCSColorRec& rec)
{
	m_regRec = rec;
	m_cc.Flags |= CC_RGBINIT;
	m_cc.rgbResult = m_regRec.m_crRef;
} // CFCDlgSColorModify::SetSColorRec.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgSColorModify::GetSColorRec
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDiMiDfCiBfLiDgIiCpAiOoGjDlOiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDiMiDfCiBfLiDgIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.03.11 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
const FCSColorRec& CFCDlgSColorModify::GetSColorRec () const
{
	return m_regRec;
} // CFCDlgSColorModify::GetSColorRec.

//----- 01.03.11 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgSColorModify::GetColorName
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jAnNjCoIiClDiCoKiClNiChCjAeGjGlMiCpAjFnEiClHiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iChCjAeGjGlMiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.05.05 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//const _TCHAR* CFCDlgSColorModify::GetColorName () const
//{
//	return m_strColorName;
//} // CFCDlgSColorModify::GetColorName.
//----- 01.03.11 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

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

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgSColorModify::OnInitDialog
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfPiDeDiDeBiDiNiDePiPiJiKpKiJlLiOjOiCmJiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iJlKiLeMiDfCiDiBiDjDiDgHiCpAiOfBiPmGiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.05.05 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL CFCDlgSColorModify::OnInitDialog ()
{
	// Superclass_xZkqqHx_iKnGjAjEiCpAiOmAiNhDiBeC_xHqqkZx_
	BASE_CLASS::OnInitDialog();
	// _xZkqqHx_iChCjAeGjGlMiCmMiDfCiDjDiDgHiDiNiBfLiDiLiCpAiPiJiKpKiJlLiBeC_xHqqkZx_
// 01.03.11 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//	SetDlgItemText(IDC_CHC_EDT_S_COLOR_NAME, m_strColorName);
	FFSetDlgItemText(this, IDC_CHC_EDT_S_COLOR_NAME, m_regRec.m_szName);

	// _xZkqqHx_iDfPiDeDiDeBiDiNiDePiCmMjCfAiImKjFfMiOkGiCpAjAnNjCoIiClHiCoJiBeC_xHqqkZx_
	::SetUnitString(m_hWnd);
	// _xZkqqHx_jHjIiCkLjIhCjBmOiJjOjFlGiOjKjHpBiCmMjAnNjCoIiCpAiNhDiCkEiBeC_xHqqkZx_
	::RightByLeftHand(m_hWnd);
//----- 00.12.31 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	// _xZkqqHx_iDfPiDeDiDeBiDiNiDePiCpAiDhNiDeFiDfIiImKjChFiCmJiInKjDkOiBeC_xHqqkZx_
	FFJustifyWindow(m_hWnd);
//----- 00.12.31 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----
	return TRUE;  // _xZkqqHx_iDfCiDjDiDgHiDiNiBfLiDiLiCmJiDhEiDeIiBfLiDeKiDfIiCpAjAnNjCoIiClFiCmIiCkCiCmGiCkLiBeBjGnPiCoIjCgMiCmN_xHqqkZx_ TRUE _xZkqqHx_iCmGiCmIiCoIiCnMiClH_xHqqkZx_
	              // _xZkqqHx_jHoBiKeP_xHqqkZx_: OCX _xZkqqHx_iDhGiDiNiDhAiDgFiDeC_xHqqkZx_ _xZkqqHx_iDhJiBfLiDfHiCmMjGnPiCoIjCgMiCmN_xHqqkZx_ FALSE _xZkqqHx_iCmGiCmIiCoIiCnMiClH_xHqqkZx_
} // CFCDlgSColorModify::OnInitDialog.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgSColorModify::OnOK
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	OK_xZkqqHx_iDhLiDfOiDjDiCkJiCoHiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.05.05 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void CFCDlgSColorModify::OnOK ()
{
//----- 01.03.11 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
//	// _xZkqqHx_iChCjAeGjGlMiCmMiDfCiDjDiDgHiDiNiBfLiDiLiCkJiCoHjFlGiOjKjHpBiCpAiOoGjDlOiBeC_xHqqkZx_
//	(void)GetDlgItemText(IDC_CHC_EDT_S_COLOR_NAME, m_strColorName);
//----- 01.03.11 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
	// _xZkqqHx_iChCjAeGjGlMiCmMiDfCiDjDiDgHiDiNiBfLiDiLiCkJiCoHjFlGiOjKjHpBiCpAiOoGjDlOiBeC_xHqqkZx_
	WString strName;
	(void)FFGetDlgItemText(this, IDC_CHC_EDT_S_COLOR_NAME, strName);
	if (strName.length() < FD_ENV_NAME_LEN)
	{
		wcscpy(m_regRec.m_szName, strName.c_str());
	} else
	{
		wcsncpy(m_regRec.m_szName, strName.c_str(), FD_ENV_NAME_LEN - 1);
		m_regRec.m_szName[FD_ENV_NAME_LEN - 1] = L'\0';
	}
//----- 01.03.11 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----
	// Superclass_xZkqqHx_iKnGjAjEiCpAiOmAiNhDiBeC_xHqqkZx_
	BASE_CLASS::OnOK();
	// _xZkqqHx_jAeGiCpAiOoGjDlOiBeC_xHqqkZx_OnOK_xZkqqHx_iMoDiCmFiCmIiCkCiCmGiOoGjDlOiCmFiCkLiCmIiCkCiBeC_xHqqkZx_
	m_regRec.m_crRef = GetColor();
} // CFCDlgSColorModify::OnOK.
