// PrintDialog.cpp : _xZkqqHx_iDeDiDjDiDhGiDiKiDiBiDjDiDgFiBfLiDfGiDiHiDjD_xHqqkZx_ _xZkqqHx_iDhEiDeAiDeDiDiL_xHqqkZx_
//

#include "stdafx.h"
// 03.07.22 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//#include "DynamicDraw.h"
#include "resource.h"		// IDC_XXX.
// 06.11.15 Fukushiro M. 1_xZkqqHx_iNhDjCmHiJmB_xHqqkZx_ ()
#include "UtilDlg.h"		// For SetUnitString.etc.
#include "PrintDialog.h"	// This header.

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

/////////////////////////////////////////////////////////////////////////////
// CFCPrintDialog

IMPLEMENT_DYNAMIC(CFCPrintDialog, CPrintDialog)

CFCPrintDialog::CFCPrintDialog (BOOL bPrintSetupOnly, DWORD dwFlags, CWnd* pParentWnd) :
	CPrintDialog(bPrintSetupOnly, dwFlags, pParentWnd)
{
	// _xZkqqHx_iDiBiDgCiDfKiBfLiDfHiCmMiDgMiDfIiDgHiDgAiDeGiDgCiDeOiCpAiJpAiPjMiBeC_xHqqkZx_
	m_bProhibitMsg = FALSE;
	// _xZkqqHx_iDfGiBfLiDgHiDfEiDeDiDfJiBeC_xHqqkZx_
	m_dwSheetSize = 1;
} // CFCPrintDialog::CFCPrintDialog.

BEGIN_MESSAGE_MAP(CFCPrintDialog, BASE_CLASS)
	//{{AFX_MSG_MAP(CFCPrintDialog)
	ON_EN_CHANGE(IDC_CPR_EDT_SHEET_FROM, OnChangeCprEdtSheetFrom)
	ON_EN_CHANGE(IDC_CPR_EDT_SHEET_TO, OnChangeCprEdtSheetTo)
	ON_EN_CHANGE(IDC_CPR_EDT_PAGE_FROM, OnChangeCprEdtPageFrom)
	ON_EN_CHANGE(IDC_CPR_EDT_PAGE_TO, OnChangeCprEdtPageTo)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCPrintDialog::OnInitDialog
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfPiDeDiDeBiDiNiDePiPiJiKpKiJlLiOjOiCmJiOmAiNhDiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.01.09 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL CFCPrintDialog::OnInitDialog ()
{
	// _xZkqqHx_iDiBiDgCiDfKiBfLiDfHiCmMiDgMiDfIiDgHiDgAiDeGiDgCiDeOiCpAjAnNjCoIiBeC_xHqqkZx_
	m_bProhibitMsg = TRUE;
	// Superclass_xZkqqHx_iKnGjAjEiOmAiNhDiBeC_xHqqkZx_
	CPrintDialog::OnInitDialog();
	//----- _xZkqqHx_iDfCiDjDiDgHiDiNiBfLiDiLiCmMjHeMiMpIiBeFjGlDiMpIiCpAjAnNjCoI_xHqqkZx_ -----
	BOOL bEnable = (0 < m_pd.nMaxPage - m_pd.nMinPage);
	GetDlgItem(IDC_CPR_EDT_SHEET_FROM)->EnableWindow(bEnable);
	GetDlgItem(IDC_CPR_EDT_SHEET_TO)->EnableWindow(bEnable);
	GetDlgItem(IDC_CPR_EDT_PAGE_FROM)->EnableWindow(bEnable);
	GetDlgItem(IDC_CPR_EDT_PAGE_TO)->EnableWindow(bEnable);
	GetDlgItem(IDC_CPR_STC_SHEET_FROM)->EnableWindow(bEnable);
	GetDlgItem(IDC_CPR_STC_SHEET_TO)->EnableWindow(bEnable);
//----- 06.04.30 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	GetDlgItem(IDC_CPR_STC_PAGE_FROM)->EnableWindow(bEnable);
	GetDlgItem(IDC_CPR_STC_PAGE_TO)->EnableWindow(bEnable);
//----- 06.04.30 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----

	DWORD dwMaxPage = m_pd.nMaxPage / m_dwSheetSize;
	SetDlgItemInt(IDC_CPR_EDT_SHEET_FROM, 1);
	SetDlgItemInt(IDC_CPR_EDT_SHEET_TO, m_dwSheetSize);
	SetDlgItemInt(IDC_CPR_EDT_PAGE_FROM, 1);
	SetDlgItemInt(IDC_CPR_EDT_PAGE_TO, dwMaxPage);

	// _xZkqqHx_iDiBiDgCiDfKiBfLiDfHiCmMiDgMiDfIiDgHiDgAiDeGiDgCiDeOiCpAiJpAiPjMiBeC_xHqqkZx_
	m_bProhibitMsg = FALSE;

//----- 06.11.15 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	// _xZkqqHx_iDfPiDeDiDeBiDiNiDePiCmMjCfAiImKjFfMiOkGiCpAjAnNjCoIiClHiCoJiBeC_xHqqkZx_
	::SetUnitString(m_hWnd);
	// _xZkqqHx_jHjIiCkLjIhCjBmOiJjOjFlGiOjKjHpBiCmMjAnNjCoIiCpAiNhDiCkEiBeC_xHqqkZx_
	::RightByLeftHand(m_hWnd);
	// _xZkqqHx_iDfPiDeDiDeBiDiNiDePiCpAiDhNiDeFiDfIiImKjChFiCmJiInKjDkOiBeC_xHqqkZx_
	::FFJustifyWindow(m_hWnd);
//----- 06.11.15 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_
} // CFCPrintDialog::OnInitDialog.

//----- 05.06.21 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCPrintDialog::OnOK
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	OK_xZkqqHx_iDhLiDfOiDjDiCkJiCoHiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.06.21 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//void CFCPrintDialog::OnOK ()
//{
//	int iRadioSelection = GetCheckedRadioButton(1056, 1058);
//	if (iRadioSelection == 1057)
//	//----- _xZkqqHx_iMlLiNnNiCmMiDhJiBfLiDfHiCkKjBeJjBpAiClDiCoKiCmEiCkCiCoJiPoKiNiH_xHqqkZx_ -----
//	{
//		// _xZkqqHx_jEmNiImNjBeJjBpAiBeC_xHqqkZx_
//		CheckRadioButton(1056, 1058, 1058);
//		SetDlgItemInt(1152, 3);
//		SetDlgItemInt(1153, 3);
//	};
//	// Superclass_xZkqqHx_iKnGjAjEiOmAiNhDiBeC_xHqqkZx_
//	CPrintDialog::OnOK();
//} // CFCPrintDialog::OnOK.
//----- 05.06.21 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

/////////////////////////////////////////////////////////////////////////////
// CFCPrintDialog _xZkqqHx_iDiGiBfLiDfFiKnGjAjEiBeC_xHqqkZx_

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCPrintDialog::SetSheetSize
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfGiBfLiDgHiDfEiDeDiDfJiCpAjAnNjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	dwSize	:_xZkqqHx_iDfGiBfLiDgHjAjEiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.01.09 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void CFCPrintDialog::SetSheetSize (DWORD dwSize)
{
	m_dwSheetSize = dwSize;
} // CFCPrintDialog::SetSheetSize.

/////////////////////////////////////////////////////////////////////////////
// CFCPrintDialog _xZkqqHx_iDiBiDgCiDfKiBfLiDfH_xHqqkZx_ _xZkqqHx_iDgOiDjDiDgIiDiJiBeC_xHqqkZx_

void CFCPrintDialog::OnChangeCprEdtSheetFrom ()
{
	// _xZkqqHx_iDiBiDgCiDfKiBfLiDfHiCkKiDgMiDfIiDgHiClFiCmEiCkCiCoJiPoKiNiHiCmNjFjMiLeBiBeC_xHqqkZx_
	if (m_bProhibitMsg) return;
	// _xZkqqHx_iDiBiDgCiDfKiBfLiDfHiCmMiDgMiDfIiDgHiDgAiDeGiDgCiDeOiCpAjAnNjCoIiBeC_xHqqkZx_
	m_bProhibitMsg = TRUE;
	DWORD dwMaxPage = m_pd.nMaxPage / m_dwSheetSize;
	DWORD dwPage = dwMaxPage * (GetDlgItemInt(IDC_CPR_EDT_SHEET_FROM, NULL, FALSE) - 1) +
					GetDlgItemInt(IDC_CPR_EDT_PAGE_FROM, NULL, FALSE);
	SetDlgItemInt(1152, dwPage);
	// _xZkqqHx_iDiBiDgCiDfKiBfLiDfHiCmMiDgMiDfIiDgHiDgAiDeGiDgCiDeOiCpAiJpAiPjMiBeC_xHqqkZx_
	m_bProhibitMsg = FALSE;
} // CFCPrintDialog::OnChangeCprEdtSheetFrom.

void CFCPrintDialog::OnChangeCprEdtSheetTo ()
{
	// _xZkqqHx_iDiBiDgCiDfKiBfLiDfHiCkKiDgMiDfIiDgHiClFiCmEiCkCiCoJiPoKiNiHiCmNjFjMiLeBiBeC_xHqqkZx_
	if (m_bProhibitMsg) return;
	// _xZkqqHx_iDiBiDgCiDfKiBfLiDfHiCmMiDgMiDfIiDgHiDgAiDeGiDgCiDeOiCpAjAnNjCoIiBeC_xHqqkZx_
	m_bProhibitMsg = TRUE;
	DWORD dwMaxPage = m_pd.nMaxPage / m_dwSheetSize;
	DWORD dwPage = dwMaxPage * (GetDlgItemInt(IDC_CPR_EDT_SHEET_TO, NULL, FALSE) - 1) +
					GetDlgItemInt(IDC_CPR_EDT_PAGE_TO, NULL, FALSE);
	SetDlgItemInt(1153, dwPage);
	// _xZkqqHx_iDiBiDgCiDfKiBfLiDfHiCmMiDgMiDfIiDgHiDgAiDeGiDgCiDeOiCpAiJpAiPjMiBeC_xHqqkZx_
	m_bProhibitMsg = FALSE;
} // CFCPrintDialog::OnChangeCprEdtSheetTo.

void CFCPrintDialog::OnChangeCprEdtPageFrom ()
{
	// _xZkqqHx_iDiBiDgCiDfKiBfLiDfHiCkKiDgMiDfIiDgHiClFiCmEiCkCiCoJiPoKiNiHiCmNjFjMiLeBiBeC_xHqqkZx_
	if (m_bProhibitMsg) return;
	// _xZkqqHx_iDiBiDgCiDfKiBfLiDfHiCmMiDgMiDfIiDgHiDgAiDeGiDgCiDeOiCpAjAnNjCoIiBeC_xHqqkZx_
	m_bProhibitMsg = TRUE;
	DWORD dwMaxPage = m_pd.nMaxPage / m_dwSheetSize;
	DWORD dwPage = dwMaxPage * (GetDlgItemInt(IDC_CPR_EDT_SHEET_FROM, NULL, FALSE) - 1) +
					GetDlgItemInt(IDC_CPR_EDT_PAGE_FROM, NULL, FALSE);
	SetDlgItemInt(1152, dwPage);
	// _xZkqqHx_iDiBiDgCiDfKiBfLiDfHiCmMiDgMiDfIiDgHiDgAiDeGiDgCiDeOiCpAiJpAiPjMiBeC_xHqqkZx_
	m_bProhibitMsg = FALSE;
} // CFCPrintDialog::OnChangeCprEdtPageFrom.

void CFCPrintDialog::OnChangeCprEdtPageTo ()
{
	// _xZkqqHx_iDiBiDgCiDfKiBfLiDfHiCkKiDgMiDfIiDgHiClFiCmEiCkCiCoJiPoKiNiHiCmNjFjMiLeBiBeC_xHqqkZx_
	if (m_bProhibitMsg) return;
	// _xZkqqHx_iDiBiDgCiDfKiBfLiDfHiCmMiDgMiDfIiDgHiDgAiDeGiDgCiDeOiCpAjAnNjCoIiBeC_xHqqkZx_
	m_bProhibitMsg = TRUE;
	DWORD dwMaxPage = m_pd.nMaxPage / m_dwSheetSize;
	DWORD dwPage = dwMaxPage * (GetDlgItemInt(IDC_CPR_EDT_SHEET_TO, NULL, FALSE) - 1) +
					GetDlgItemInt(IDC_CPR_EDT_PAGE_TO, NULL, FALSE);
	SetDlgItemInt(1153, dwPage);
	// _xZkqqHx_iDiBiDgCiDfKiBfLiDfHiCmMiDgMiDfIiDgHiDgAiDeGiDgCiDeOiCpAiJpAiPjMiBeC_xHqqkZx_
	m_bProhibitMsg = FALSE;
} // CFCPrintDialog::OnChangeCprEdtPageTo.

