// TolBrMain.cpp : _xZkqqHx_iDeDiDjDiDhGiDiKiDiBiDjDiDgFiBfLiDfGiDiHiDjD_xHqqkZx_ _xZkqqHx_iDhEiDeAiDeDiDiL_xHqqkZx_
//

#include "stdafx.h"
#include "DynamicDrawView.h"	// For g_pView.
#include "ToolBase.h"			// For CanZoomView.
#include "UtilWin.h"			// For FFSetWindowText.
#include "RegData.h"			// For GetRegFontStatic.
#include "TolBrMain.h"			// This header.

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


/////////////////////////////////////////////////////////////////////////////
// CFCTolBrMain

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCTolBrMain::CFCTolBrMain
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfCiDjDiDfIiDgHiDiJiDeOiDfOiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.01.21 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
CFCTolBrMain::CFCTolBrMain ()
{
} // CFCTolBrMain::CFCTolBrMain.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCTolBrMain::~CFCTolBrMain
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDgGiDfIiDgHiDiJiDeOiDfOiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.01.21 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
CFCTolBrMain::~CFCTolBrMain ()
{
} // CFCTolBrMain::~CFCTolBrMain.

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

/////////////////////////////////////////////////////////////////////////////
// CFCTolBrMain _xZkqqHx_iDiGiBfLiDfFiKnGjAjEiBeC_xHqqkZx_

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCTolBrMain::CreateZoomComboBox
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfJiBfLiDiAiDfCiDjDiDhLiDhLiDgCiDeOiDfIiCpAiNoMjAkMiBeFiPiJiKpKiJlLiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iOlIjEhDiClFiClNiPoKiNiHiCmN_xHqqkZx_FALSE_xZkqqHx_iBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.01.17 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL CFCTolBrMain::CreateZoomComboBox ()
{
//----- 06.10.30 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
//	// _xZkqqHx_iDgIiDiNiDgCiDhGiDfPiDeFiDjDiCmMiNiCiClDiBeC_xHqqkZx_
//	const int nDropHeight = 500;
//	// _xZkqqHx_iDfCiDjDiDhLiDhLiDgCiDeOiDfIiCpAiNoMjAkMiClHiCoJiBeC_xHqqkZx_
//	SetButtonInfo(CommandToIndex(m_dwZoomCtrlId), m_dwZoomCtrlId, TBBS_SEPARATOR, 80);
//	//----- _xZkqqHx_iDfJiBfLiDiAjCgMiDfCiDjDiDhLiDhLiDgCiDeOiDfIiCpAiNoMjAkM_xHqqkZx_ -----
//	// _xZkqqHx_iDfCiDjDiDhLiDhLiDgCiDeOiDfIiCmMiDfEiDeDiDfJiCpAiMhGiOfKiClHiCoJiBeC_xHqqkZx_
//	CRect rect;
//	GetItemRect(CommandToIndex(m_dwZoomCtrlId), &rect);
//	const int iHeight = rect.Height();
//	rect.top = 0;
//	rect.bottom = rect.top + nDropHeight;
//	if (!m_cmbZoom.Create(	CBS_DROPDOWN|WS_VISIBLE|WS_TABSTOP|CBS_AUTOHSCROLL,
//							rect, this, m_dwZoomCtrlId))
//	{
//		TRACE(_T("Failed to create combo-box\n"));
//		return FALSE;
//	}
//	// _xZkqqHx_iDfCiDjDiDhLiDhLiDgCiDeOiDfIiCmJiDhEiDeIiDjDiDgHiCpAjAnNjCoIiBeC_xHqqkZx_
//	m_cmbZoom.SetFont(g_pReg->GetRegFontStatic(FDFT_TOOLBAR));
//	m_cmbZoom.SetItemHeight(-1, iHeight - 6);
//----- 06.10.30 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
	// _xZkqqHx_iDgIiDiNiDgCiDhGiDfPiDeFiDjDiCmMiNiCiClDiBeC_xHqqkZx_
	const int nDropHeight = 500;
	// _xZkqqHx_iDfJiBfLiDiAiDfCiDjDiDhLiDhLiDgCiDeOiDfIiCmMiDeDiDjDiDgGiDgCiDeOiDfIiCpAiOoGjDlOiBeCjBlGiNnNiClFiCmIiCkCiPoKiNiHiCoAiCkAiCoJiBeC_xHqqkZx_
	const int iIndex = CommandToIndex(m_dwZoomCtrlId);
	if (iIndex != -1)
	//----- _xZkqqHx_iDfJiBfLiDiAiCmMiDfCiDjDiDhLiDhLiDgCiDeOiDfI_xHqqkZx_ID_xZkqqHx_iCkKjBlGiNnNiClHiCoJiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_iDfCiDjDiDhLiDhLiDgCiDeOiDfIiCpAiNoMjAkMiClHiCoJiBeC_xHqqkZx_
		SetButtonInfo(iIndex, m_dwZoomCtrlId, TBBS_SEPARATOR, 80);
		//----- _xZkqqHx_iDfJiBfLiDiAjCgMiDfCiDjDiDhLiDhLiDgCiDeOiDfIiCpAiNoMjAkM_xHqqkZx_ -----
		// _xZkqqHx_iDfCiDjDiDhLiDhLiDgCiDeOiDfIiCmMiDfEiDeDiDfJiCpAiMhGiOfKiClHiCoJiBeC_xHqqkZx_
		CRect rect;
		GetItemRect(iIndex, &rect);
		const int iHeight = rect.Height();
		rect.top = 0;
		rect.bottom = rect.top + nDropHeight;
		if (!m_cmbZoom.Create(	CBS_DROPDOWN|WS_VISIBLE|WS_TABSTOP|CBS_AUTOHSCROLL,
								rect, this, m_dwZoomCtrlId))
		{
			TRACE(_T("Failed to create combo-box\n"));
			return FALSE;
		}
		// _xZkqqHx_iDfCiDjDiDhLiDhLiDgCiDeOiDfIiCmJiDhEiDeIiDjDiDgHiCpAjAnNjCoIiBeC_xHqqkZx_
		m_cmbZoom.SetFont(g_pReg->GetRegFontStatic(FDFT_TOOLBAR));
		m_cmbZoom.SetItemHeight(-1, iHeight - 6);
	} else
	//----- _xZkqqHx_iDfJiBfLiDiAiCmMiDfCiDjDiDhLiDhLiDgCiDeOiDfI_xHqqkZx_ID_xZkqqHx_iCkKjBlGiNnNiClFiCmIiCkCiPoKiNiH_xHqqkZx_ ----
	{
		if (!m_cmbZoom.Create(	CBS_DROPDOWN|WS_TABSTOP|CBS_AUTOHSCROLL,
								CRect(0, 0, 1, 1), this, m_dwZoomCtrlId))
		{
			TRACE(_T("Failed to create combo-box\n"));
			return FALSE;
		}
	}
//----- 06.10.30 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----
	return TRUE;
} // CFCTolBrMain::CreateZoomComboBox.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCTolBrMain::IsViewZoomEnable
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDhCiDiFiBfLjBkEiCmFiDfJiBfLiDiAiCkKiJmCjEfMiCkJiCmHiCkEiCkJiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDfJiBfLiDiAiCkKiJmCjEfMiCmIiPoKiNiHiCmN_xHqqkZx_TRUE_xZkqqHx_iBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	04.06.06 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL CFCTolBrMain::IsViewZoomEnable () const
{
	return g_pView->GetCurrentTool()->CanZoomView();
} // CFCTolBrMain::IsViewZoomEnable.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCTolBrMain::GetViewZoom256
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDhCiDiFiBfLjBkEiCmMiDfJiBfLiDiAjCgMiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDfJiBfLiDiAjCgMiBeCiCfBiCfEiCfFiBiBiCfAiCePiCePiBjDiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	04.06.06 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
long CFCTolBrMain::GetViewZoom256 () const
{
	return g_->lZoom256;
} // CFCTolBrMain::GetViewZoom256.

/////////////////////////////////////////////////////////////////////////////
// CFCTolBrMain _xZkqqHx_iDeJiBfLiDgPiBfLiDiJiDeDiDgIiBeC_xHqqkZx_

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCTolBrMain::CalcFixedLayout
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iMmFjCoIiDfEiDeDiDfJiCmMiMhGiOfKiOjOiCmJiOmAiNhDiClDiCoKiCoJiBeCiOoFiCmJiDgIiDgCiDeOiClDiCoKiCoJiCmGiCkLiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	bStretch	:_xZkqqHx_iDgPiBfLiCkKiDgIiDgCiDeMiDjDiDePiCkKjHjIjHhAiCmFiCkLiCmIiCkCiPoKiNiHiCmNiBeB_xHqqkZx_0_xZkqqHx_iImIiKePiCmJjAnNjCoIiBeB_xHqqkZx_
 *						 _xZkqqHx_iDgIiDgCiDeMiDjDiDePiCkKjHjIjHhAiCmFiCkLiCoJiPoKiNiHiCmNiBeB_xHqqkZx_0 _xZkqqHx_iCpAjAnNjCoIiBeC_xHqqkZx_
 *			bHorz		:_xZkqqHx_iDgPiBfLiCkKjAiFjFlNjFpLiMpMiCmMiCmGiCkLiCmN_xHqqkZx_0_xZkqqHx_iImIiKePiCmJjAnNjCoIiClFiBeB_xHqqkZx_
 *						 _xZkqqHx_jAiCjClMjFpLiMpMiCmMiCmGiCkLiCmN_xHqqkZx_ 0 _xZkqqHx_iCpAjAnNjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.01.04 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
CSize CFCTolBrMain::CalcFixedLayout (BOOL bStretch, BOOL bHorz)
{
	if (bHorz)
	//----- _xZkqqHx_jAiFjFlNjFpLiMpMiCmMiDgIiDgCiDeOiOjO_xHqqkZx_ ------
	{
		// _xZkqqHx_jGhLjHiIiBeBiClBiCmMiPiIjHjNiCmNjFhDjHhGiCmIiCmMiClOiCkKiBeBiPgDjFpLiMpMiCmJjAeMiCmOiClFiClNiDhEiDiNiBfLiDgHiDgDiBfLiDiLiDgPiBfL_xHqqkZx_
		// _xZkqqHx_iCpAiDgIiDgCiDeOiClFiCoGiCkEiCmGiClHiCoJiCmGiBeBjFjEjFgJiCkKiCkEiCnMiCkN_xHqqkZx_SEPARATOR_xZkqqHx_iImKjChFiCmJiInKjDkOiClFiCmIiCkCiClNiCnPiBeC_xHqqkZx_
		FCWndAndId wid[] =
		{
			{ &m_cmbZoom, m_dwZoomCtrlId },
		};
		::FFHorznizeToolBar(this, wid, sizeof(wid) / sizeof(wid[0]));
	}
	// Superclass_xZkqqHx_iKnGjAjEiOmAiNhDiBeC_xHqqkZx_
	return BASE_CLASS::CalcFixedLayout(bStretch, bHorz);
} // CFCTolBrMain::CalcFixedLayout.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCTolBrMain::OnUpdateCmdUI
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDgDiBfLiDiL_xHqqkZx_ _xZkqqHx_iDgPiBfLiCnMiClNiCmNiDfIiDgFiBfLiDfOiDfI_xHqqkZx_ _xZkqqHx_iDgPiBfLiCmMiPpDjBnEiCpAiNfIjAfGiClHiCoJiClNiCnPiCmJiBeB_xHqqkZx_
 *			_xZkqqHx_iDhEiDiMiBfLiDiAiDiPiBfLiDeOiCkKiMmEiCnBiPgPiClFiCnMiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pTarget	:_xZkqqHx_iDeBiDhGiDiKiDfAiBfLiDfGiDiHiDjDiCmMiDiBiDeDiDjD_xHqqkZx_ _xZkqqHx_iDhEiDiMiBfLiDiA_xHqqkZx_ _xZkqqHx_iDeFiDeCiDjDiDgIiDeFiCnGiCmMiDhMiDeDiDjDiDfOiBeC_xHqqkZx_
 *			bDisableIfNoHndler :_xZkqqHx_iNfIjAfGiDgOiDjDiDgIiDiJiCpAiOjNiCmBiCmEiCkCiCmIiCkCiDfCiDjDiDgHiDiNiBfLiDiLiCpA_xHqqkZx_
 *							_xZkqqHx_iOkJjDkOjDeJiCmJiLnGiOhOiPpDjBnEiCmFjFfMiOkGiClHiCoJiCkJiCmHiCkEiCkJiCpAiOkGiClHiDhEiDiJiDePiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	04.06.06 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void CFCTolBrMain::OnUpdateCmdUI (CFrameWnd* pTarget, BOOL bDisableIfNoHndler)
{
	// _xZkqqHx_iDfCiDjDiDhLiDhLiDgCiDeOiDfIiCmMjHeMiMpIiPpDjBnEiBeBiDfJiBfLiDiAjCgMiCmMjFfMiOkGiCpAiNfIjAfGiClHiCoJiBeC_xHqqkZx_
	OnUpdateControl();
	// Superclass_xZkqqHx_iKnGjAjEiOmAiNhDiBeC_xHqqkZx_
	BASE_CLASS::OnUpdateCmdUI(pTarget, bDisableIfNoHndler);
} // CFCTolBrMain::OnUpdateCmdUI.

/////////////////////////////////////////////////////////////////////////////
// CFCTolBrMain _xZkqqHx_iDiBiDgCiDfKiBfLiDfH_xHqqkZx_ _xZkqqHx_iDgOiDjDiDgIiDiJ_xHqqkZx_

