// CmbReg.cpp : _xZkqqHx_iDeDiDjDiDhGiDiKiDiBiDjDiDgFiBfLiDfGiDiHiDjD_xHqqkZx_ _xZkqqHx_iDhEiDeAiDeDiDiL_xHqqkZx_
//

#include "stdafx.h"
#include "UtilStr.h"	// For FFAppendString.
#include "UtilWin.h"	// For FFGetLBText.
#include "RegData.h"	// For g_pReg.
#include "CmbReg.h"		// This header.

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

#define FD_RECENT_CMB_REG_TEXT_MAX	20

/////////////////////////////////////////////////////////////////////////////
// CFCCmbReg

CFCCmbReg::CFCCmbReg ()
{
} // CFCCmbReg::CFCCmbReg.

CFCCmbReg::~CFCCmbReg ()
{
} // CFCCmbReg::~CFCCmbReg.

BEGIN_MESSAGE_MAP(CFCCmbReg, BASE_CLASS)
	//{{AFX_MSG_MAP(CFCCmbReg)
		// _xZkqqHx_iDiBiDiC_xHqqkZx_ - ClassWizard _xZkqqHx_iCmNiClBiCmMiImKjChFiCmJiDhNiDgCiDhDiDjDiDePjHhAiCmMiDhNiDeOiDiNiCpAjCmHiJmBiCnMiClNiCmNiNoNiPjMiClFiCnMiClHiBeC_xHqqkZx_
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CFCCmbReg _xZkqqHx_iDiGiBfLiDfFiKnGjAjEiBeC_xHqqkZx_

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCCmbReg::Initialize
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iPiJiKpKiJlLiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	wcpRegSection	:_xZkqqHx_iDiMiDfHiDfIiDgHiDiKiCmJiLeMjIfOiClHiCoJiDfKiDeOiDfGiDiHiDjDjGlMiCpAiOhHjCoIiBeC_xHqqkZx_
 *							 _xZkqqHx_iDfKiDeOiDfGiDiHiDjDjGlMiCkKjGlDiCkCiPoKiNiHiCmN_xHqqkZx_ NULL _xZkqqHx_iCpAiOhHjCoIiBeC_xHqqkZx_
 *			wcpRegName		:_xZkqqHx_iDiMiDfHiDfIiDgHiDiKiCmJiLeMjIfOiClHiCoJjGlMjBePiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	04.12.26 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void CFCCmbReg::Initialize (const wchar_t* wcpRegSection, const wchar_t* wcpRegName)
{
	if (wcpRegSection == NULL)
		m_wstrRegSection.Empty();
	else
		m_wstrRegSection = wcpRegSection;
	m_wstrRegName = wcpRegName;
} // CFCCmbReg::Initialize.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCCmbReg::UpdateRegistory
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfCiDjDiDgHiDiNiBfLiDiLiCmMiDgGiBfLiDfOiCpAiDiMiDfHiDfIiDgHiDiKiCmJiDfKiBfLiDhFiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	04.12.26 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void CFCCmbReg::UpdateRegistory ()
{
	WString wstr;
	WString wstrList;
	FFGetWindowText(this, wstr);
	FFAppendString(wstrList, wstr);
	for (int iC = 0; iC < GetCount() && iC < FD_RECENT_CMB_REG_TEXT_MAX; iC++)
	{
		FFGetLBText(this, iC, wstr);
		FFAppendString(wstrList, wstr);
	}
	g_pReg->SaveRegString(m_wstrRegSection, m_wstrRegName, wstrList);
} // CFCCmbReg::UpdateRegistory.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCCmbReg::UpdateControl
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDiMiDfHiDfIiDgHiDiKiCkJiCoHiDfCiDjDiDgHiDiNiBfLiDiLiCmMiDgGiBfLiDfOiCpAiDiNiBfLiDgIiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	04.12.26 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void CFCCmbReg::UpdateControl ()
{
	//----- _xZkqqHx_iKgFiDfCiDjDiDgHiDiNiBfLiDiLiCmMiDgGiDhEiDeIiDiLiDgHjCgMiCpAjAnNjCoI_xHqqkZx_ -----
	ResetContent();
	WString wstrList;
	g_pReg->LoadRegString(m_wstrRegSection, m_wstrRegName, wstrList);
	WString wstr;
	wstr = FFExtractString(wstrList);
	FFSetWindowText(this, wstr);
	while (!wstrList.IsEmpty())
	{
		wstr = FFExtractString(wstrList);
		FFAddString(this ,wstr);
	}
//	SetCurSel(0);
} // CFCCmbReg::UpdateControl.

/////////////////////////////////////////////////////////////////////////////
// CFCCmbReg _xZkqqHx_iDiBiDgCiDfKiBfLiDfH_xHqqkZx_ _xZkqqHx_iDgOiDjDiDgIiDiJ_xHqqkZx_
