// DlgSheetOrder.cpp : _xZkqqHx_iDeDiDjDiDhGiDiKiDiBiDjDiDgFiBfLiDfGiDiHiDjD_xHqqkZx_ _xZkqqHx_iDhEiDeAiDeDiDiL_xHqqkZx_
//

#include "stdafx.h"
#include "DynamicDraw.h"
#include "FoundDoc.h"		// For g_pDoc.
#include "DynamicDrawView.h"	// For g_pView.
//----- 01.03.25 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//#include "DynamicDrawView.h"	// For g_pView.
//----- 01.03.25 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
#include "ObjDynabase.h"		// For FCObjDynabase.
#include "LinkManager.h"	// For g_pDoc->LinkManager().
#include "SheetManager.h"	// For FCSheetManager.
#include "UtilDlg.h"		// For FFJustifyWindow.
#include "DlgSheetOrder.h"	// This header.

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

/////////////////////////////////////////////////////////////////////////////
// CFCDlgSheetOrder _xZkqqHx_iDfPiDeDiDeBiDiNiDeP_xHqqkZx_

CFCDlgSheetOrder::CFCDlgSheetOrder (CWnd* pParent /*=NULL*/)
	: BASE_CLASS(CFCDlgSheetOrder::IDD, pParent)
{
	//{{AFX_DATA_INIT(CFCDlgSheetOrder)
	//}}AFX_DATA_INIT
} // CFCDlgSheetOrder::CFCDlgSheetOrder.

void CFCDlgSheetOrder::DoDataExchange(CDataExchange* pDX)
{
	BASE_CLASS::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CFCDlgSheetOrder)
	DDX_Control(pDX, IDC_STO_LSV_SHEET, m_listCtrl);
	//}}AFX_DATA_MAP
} // CFCDlgSheetOrder::DoDataExchange.

/////////////////////////////////////////////////////////////////////////////
// CFCDlgSheetOrder _xZkqqHx_iDiGiBfLiDfFiKnGjAjEiBeC_xHqqkZx_

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgSheetOrder::SetSheetManager
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfGiBfLiDgHiDhNiDgMiBfLiDfHiDiDiCpAjAnNjCoIiBeC_xHqqkZx_DoModal_xZkqqHx_iCmMjBePiCmJjFeLiClIiOmAiNhDiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pSheetMgr	:_xZkqqHx_iDfGiBfLiDgHiDhNiDgMiBfLiDfHiDiDiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.12.27 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void CFCDlgSheetOrder::SetSheetManager (const FCSheetManager* pSheetMgr)
{
	m_pSheetMgr = pSheetMgr;
} // CFCDlgSheetOrder::SetSheetManager.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgSheetOrder::InitControl
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfCiDjDiDgHiDiNiBfLiDiLiCpAiPiJiKpKiJlLiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.03.19 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void CFCDlgSheetOrder::InitControl ()
{
	DWORDSet stSelected;
	long lTopPos;
	BOOL bRecorded = (0 < m_listCtrl.GetItemCount());
	if (bRecorded)
	//----- _xZkqqHx_iKpJiCmJjAnNjCoIiClDiCoKiCmEiCkCiCoJiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_jBeJjBpAiDiKiDfIiDgHiCpAjFnLjBlGiBeC_xHqqkZx_
		POSITION pos = m_listCtrl.GetFirstSelectedItemPosition();
		while (pos)
			stSelected.insert(m_listCtrl.GetNextSelectedItem(pos));
		lTopPos = m_listCtrl.GetItemHeight() * m_listCtrl.GetTopIndex();
	}
	//----- _xZkqqHx_iMiLiJmKjFfMiOkGiDiKiDfIiDgHiDfCiDjDiDgHiDiNiBfLiDiLiCmMjAnNjCoI_xHqqkZx_ -----
	// _xZkqqHx_iDfCiDjDiDgHiDiNiBfLiDiLiCpAiDeOiDiKiDeBiBeC_xHqqkZx_
	m_listCtrl.ClearContents();
// 01.03.24 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	DWORDVector vOrder;
	for (SheetID stid = 0; stid < m_pSheetMgr->GetSheetIDSize(); stid++)
	{
		if (m_pSheetMgr->GetSheet(stid) != NULL)
		{
			WString wstrName;
			m_pSheetMgr->GetSheetInfo(wstrName, stid);
			FCSheetCtrlRec rec;
			rec.strName = wstrName;
			m_listCtrl.AppendRec(stid, rec);
		} else
		{
			m_listCtrl.AddFreeId(stid);
		}
	}
	// _xZkqqHx_iDfGiBfLiDgHjBhNjDpMiOjOiCmMiDfGiBfLiDgH_xHqqkZx_ID_xZkqqHx_iCmMiPiJiKpKjCgMiCpAiOhHjCoIiBeC_xHqqkZx_
	m_listCtrl.SetNextFreeId(m_pSheetMgr->GetSheetIDSize());
	// _xZkqqHx_iDiMiDfCiBfLiDgIjFfMiOkGiPiHiCpAjAnNjCoIiBeC_xHqqkZx_
	m_listCtrl.SetIdOrder(m_pSheetMgr->GetFreqSheetVector().size(),
							m_pSheetMgr->GetFreqSheetVector().begin());
	// _xZkqqHx_iDeKiDiMiDjDiDgHiDfGiBfLiDgHiCpAjAnNjCoIiBeC_xHqqkZx_
	m_listCtrl.SetCurrentSheetId(m_pSheetMgr->GetCurrentSheetId());
	if (bRecorded)
	//----- _xZkqqHx_iKpJiCmJjAnNjCoIiClDiCoKiCmEiCkCiClNiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_iMlDiCmMjBeJjBpAiDiKiDfIiDgHiCpAjAnNjCoIiBeC_xHqqkZx_
		DWORDSet::iterator iSt;
		for (iSt = stSelected.begin(); iSt != stSelected.end(); iSt++)
			m_listCtrl.SetItemState(*iSt, LVIS_SELECTED, LVIS_SELECTED);
		m_listCtrl.Scroll(CSize(0, lTopPos));
	} else
	//----- _xZkqqHx_jAnNjCoIiClDiCoKiCmEiCkCiCmIiCkJiCmBiClNiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_iDfCiDjDiDgHiDiNiBfLiDiLiCmMjFjNiCmJiNiHiCoNiClJiCmEiDeKiDiJiDiAiCpAjAnNjCoIiBeC_xHqqkZx_
		m_listCtrl.UpdateColumnWidth();
	}
	// _xZkqqHx_iDhEiDeIiBfLiDeKiDfIiCpAjAnNjCoIiBeC_xHqqkZx_
	m_listCtrl.SetFocus();
} // CFCDlgSheetOrder::InitControl.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgSheetOrder::IsSheetChanged
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfGiBfLiDgHiPoOjFpBiCkKjFmPiNfIiClDiCoKiCmEiCkCiCoJiCkJiCmHiCkEiCkJiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_jFmPiNfIiCmMiPoKiNiHiCmN_xHqqkZx_ TRUE_xZkqqHx_iBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.12.27 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL CFCDlgSheetOrder::IsSheetChanged () const
{
	// _xZkqqHx_iDeKiDiMiDjDiDgHiDfGiBfLiDgHiCkKjFmPiNfIiClDiCoKiCmEiCkCiCoJiCkJiBeI_xHqqkZx_
	if (m_listCtrl.GetCurrentSheetId() != m_pSheetMgr->GetCurrentSheetId())
		return TRUE;
//----- 01.03.18 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
//	// _xZkqqHx_iDfGiBfLiDgHjAjEiCkKjFmPiNfIiClDiCoKiCmEiCkCiCoJiCkJiBeI_xHqqkZx_
//	if (m_listCtrl.GetItemRecCount() != m_pSheetMgr->GetSheetSize())
//		return TRUE;
//	CString strName;
//	for (long lIdx = 0; lIdx < m_listCtrl.GetItemRecCount(); lIdx++)
//	{
//		// _xZkqqHx_iDfCiDjDiDgHiDiNiBfLiDiLiCkJiCoHiDfGiBfLiDgHiPoOjFpBiCpAiOoGjDlOiBeC_xHqqkZx_
//		const FCSheetCtrlRec* pRec = m_listCtrl.GetItemRec(lIdx);
//		// _xZkqqHx_iDfGiBfLiDgHiPiHiPjIiCkKjFmPiNfIiClDiCoKiCmEiCkCiCoJiCkJiBeI_xHqqkZx_
//		if (pRec->dwId != lIdx) return TRUE;
//		// _xZkqqHx_iDfGiBfLiDgHiDhNiDgMiBfLiDfHiDiDiBfLiCkJiCoHiDfGiBfLiDgHiPoOjFpBiCpAiOoGjDlOiBeC_xHqqkZx_
//		m_pSheetMgr->GetSheetInfo(strName, lIdx);
//		// _xZkqqHx_iKpJjBlGiCmMiPoOjFpBiCkJiCoHjFmPiNfIiClDiCoKiCmEiCkCiCoJiCkJiBeI_xHqqkZx_
//		if (pRec->strName != strName) return TRUE;
//	}
//----- 01.03.18 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
	if (!m_listCtrl.GetInsertedIdSet().empty()) return TRUE;
	if (!m_listCtrl.GetRemovedIdSet().empty()) return TRUE;
	if (!m_listCtrl.GetChangedIdSet().empty()) return TRUE;
	FDSheetIDVector vstid;
	m_listCtrl.GetIdOrder(vstid);
	if (vstid != m_pSheetMgr->GetFreqSheetVector()) return TRUE;
//----- 01.03.18 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----
	return FALSE;
} // CFCDlgSheetOrder::IsSheetChanged.

BEGIN_MESSAGE_MAP(CFCDlgSheetOrder, BASE_CLASS)
	//{{AFX_MSG_MAP(CFCDlgSheetOrder)
	ON_BN_CLICKED(ID_APPLY_NOW, OnApplyNow)
	ON_BN_CLICKED(IDC_STO_BTN_SHEET_MODIFY, OnStoBtnSheetModify)
	ON_BN_CLICKED(IDC_STO_BTN_SHEET_ADD, OnStoBtnSheetAdd)
	ON_BN_CLICKED(IDC_STO_BTN_SHEET_DELETE, OnStoBtnSheetDelete)
	//}}AFX_MSG_MAP
	ON_MESSAGE(WM_USER_MULTICTRL_CHANGED, OnUserMultictrlChanged)
	ON_MESSAGE(WM_USER_LISTCTRL_SELCHANGED, OnUserListctrlSelchanged)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CFCDlgSheetOrder _xZkqqHx_iDiBiDgCiDfKiBfLiDfH_xHqqkZx_ _xZkqqHx_iDgOiDjDiDgIiDiJ_xHqqkZx_


/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgSheetOrder::OnInitDialog
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfPiDeDiDeBiDiNiDePiPiJiKpKiJlLiPiIjHjNiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.12.26 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL CFCDlgSheetOrder::OnInitDialog ()
{
	// Superclass_xZkqqHx_iKnGjAjEiOmAiNhDiBeC_xHqqkZx_
	BASE_CLASS::OnInitDialog();
	// _xZkqqHx_iDfGiBfLiDgHiDiKiDfIiDgHiDfCiDjDiDgHiDiNiBfLiDiLiCmMiPiJiKpKiJlLiBeC_xHqqkZx_
	m_listCtrl.Initialize();

	// _xZkqqHx_iDfCiDjDiDgHiDiNiBfLiDiLiCpAiPiJiKpKiJlLiClHiCoJiBeC_xHqqkZx_
	InitControl();

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

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgSheetOrder::OnOK
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iCgOiCgKiDhLiDfOiDjDiCkJiCoHiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.12.26 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void CFCDlgSheetOrder::OnOK ()
{
	// _xZkqqHx_jFmPiNfIiCkAiCoKiCmOiBeBjFmPiNfIiPiIjHjNiBeC_xHqqkZx_
	if (IsSheetChanged() && FFCanEditDocumentEnv()) OnApplyNow();
	// Superclass_xZkqqHx_iKnGjAjEiOmAiNhDiBeC_xHqqkZx_
	BASE_CLASS::OnOK();
} // CFCDlgSheetOrder::OnOK.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgSheetOrder::OnApplyNow
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iBhFjDeLjHhAiDhLiDfOiDjDiBhGiCkKiJjPiClDiCoKiClNiCmGiCkLiCmJiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.12.26 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void CFCDlgSheetOrder::OnApplyNow ()
{
//----- 01.03.25 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
//	// _xZkqqHx_iDfGiBfLiDgHiDfCiDjDiDgHiDiNiBfLiDiLiCmFiCmMjFmPiNfIiCmJiCmNiBeBiImIiJlKiCmMiOoNjHnOiCkKiCkAiCoJiBeC_xHqqkZx_
//	// _xZkqqHx_iKpJjBlGiDfGiBfLiDgHiCmMjFmPiNfI_xHqqkZx_
//	// _xZkqqHx_iKpJjBlGiDfGiBfLiDgHiCmMiNoNiPjM_xHqqkZx_
//	// _xZkqqHx_jAfGiLeLiDfGiBfLiDgHiCmMiNoMjAkMiBjFjBhNjDpM_xHqqkZx_
//	// _xZkqqHx_iDfGiBfLiDgHiCmMjFmAiCnHjBnGiCkG_xHqqkZx_
//	// _xZkqqHx_iDeKiDiMiDjDiDgHiDfGiBfLiDgHiCmMjFmPiNfI_xHqqkZx_
//	// _xZkqqHx_iClBiCoKiCoHiCmMjBiAiNoMiCkKiOhLiClDiCoKiCoJjBePiCmMiDfGiBfLiDgHiCmGiMoDiCmMiDfGiBfLiDgHiCpAjEoEiKhCiClFiCmEiBeB_xHqqkZx_
//	// _xZkqqHx_iImIiJlKiCmMiOoIiPiHiCmFiBeBjBiAiNoMiCmMiDfCiDhNiDjDiDgIiCpAiNoMjAkMiClHiCoJiBeC_xHqqkZx_
//	// _xZkqqHx_iCfAiBeEiDfCiDjDiDgHiDiNiBfLiDiLiCmFiNoNiPjMiClDiCoKiClNiDfGiBfLiDgHiCpAiBeBiNoNiPjMiClHiCoJiBeC_xHqqkZx_
//	// _xZkqqHx_iCfBiBeEiDfCiDjDiDgHiDiNiBfLiDiLiCmFjAfGiLeLiNoMjAkMiClDiCoKiClNiDfGiBfLiDgHiCpAiBeBiDfGiBfLiDgHiDiKiDfIiDgHiNmFiMoDiCmJjBhNjDpMiClHiCoJiBeC_xHqqkZx_
//	// _xZkqqHx_iCfCiBeEiDfCiDjDiDgHiDiNiBfLiDiLiCmFjFmPiNfIiClDiCoKiClNiDfGiBfLiDgHiCpAiBeBiCnMiClIjFmPiNfIiClHiCoJiBeC_xHqqkZx_
//	// _xZkqqHx_iCfDiBeEiDfCiDjDiDgHiDiNiBfLiDiLiCmFiCmMjFmAiCnHjBnGiCkGiCpAiOmAiNhDiClHiCoJiBeC_xHqqkZx_
//	// _xZkqqHx_iCfEiBeEiDeKiDiMiDjDiDgHiDfGiBfLiDgHiCmMjFmPiNfIiCpAiOmAiNhDiClHiCoJiBeC_xHqqkZx_
//	//
//
//	BOOL bModified = FALSE;
//	map<DWORD, DWORD> id2idxMap;	// _xZkqqHx_iMlDiCmMiDfGiBfLiDgH_xHqqkZx_ID_xZkqqHx_iCkJiCoHjFmPiNfIiMoDiCmMiDfGiBfLiDgH_xHqqkZx_Idx_xZkqqHx_iCnGiBeC_xHqqkZx_
//	//----- ID -> Idx_xZkqqHx_jFmPiKlHiDgFiBfLiDhFiDiLiCpAiNoMjAkM_xHqqkZx_ ----
//	DWORDVector vdwId;
//	// 5, 10, 3, 4, 9 _xZkqqHx_iBgJjHoBiBgKiCpAiOoGjDlOiBeC_xHqqkZx_
//	m_listCtrl.GetIdOrder(vdwId);
//	// 5, 10, 3, 4, 9 -> 3, 4, 5, 9, 10 _xZkqqHx_iCmJiDfMiBfLiDgHiBeC_xHqqkZx_
//	sort(vdwId.begin(), vdwId.end());
//	DWORD dwIdx;
//	// [3 -> 0],[4 -> 1],[5 -> 2],[9 -> 3],[10 -> 4]_xZkqqHx_iCpAiNoMjAkMiBeC_xHqqkZx_
//	for (dwIdx = 0; dwIdx < vdwId.size(); dwIdx++)
//		id2idxMap[vdwId[dwIdx]] = dwIdx;
//	// _xZkqqHx_iDfKiDgCiDfGiDiHiDjDiKeKiOgOiPiIjHjNiBeC_xHqqkZx_
//	g_pDoc->SessionBegin();
//	//----- _xZkqqHx_jBhNjDpMiDeBiDeDiDgFiDiAiDiKiDfIiDgHiCpAiOoGiCoIiPgPiClFiBeBiDeBiDeDiDgFiDiAiCpAjBhNjDpMiClHiCoJ_xHqqkZx_ -----
//	DWORDSet::const_iterator iSt;
//	for	(iSt = m_listCtrl.GetInsertedIdSet().begin();
//		 iSt != m_listCtrl.GetInsertedIdSet().end(); iSt++)
//	{
//		//----- _xZkqqHx_iDfGiBfLiDgHiCpAjCmHiJmB_xHqqkZx_ -----
//		SheetID stid = m_pSheetMgr->GetSheetSize();
//		g_pDoc->CmdInsert1Sheet(stid, m_listCtrl.GetRec(*iSt)->strName);
//		bModified = TRUE;
//	}
//	//-----	_xZkqqHx_iNoNiPjMiDeBiDeDiDgFiDiAiDiKiDfIiDgHiCpAiOoGiCoIiPgPiClFiBeBiDeBiDeDiDgFiDiAiCpAiNoNiPjMiClHiCoJ_xHqqkZx_ -----
//	DWORDSet::const_reverse_iterator rSt;
//	for	(rSt = m_listCtrl.GetRemovedIdSet().rbegin();
//		 rSt != m_listCtrl.GetRemovedIdSet().rend(); rSt++)
//	{
//		// _xZkqqHx_jFjEjFgJjBeJjBpAiCpAiJpAiPjMiBeC_xHqqkZx_
//		g_pView->ClearSelectObj();
//		//----- _xZkqqHx_iDfGiBfLiDgHiPoDiCmMjFjEjFgJiCpAjBfDiCmEiOoGjDlOiBgJiNmFiPoDiImKiBeBiNmFiJlKiImKiDiMiDeDiDiEiBfLiCpAiPjMiCkNiBgK_xHqqkZx_-----
//		ObjDynabaseVector vObj;
//		m_pSheetMgr->GetSheet(*rSt)->
//			GetZOrder(vObj, FDOZ_ON_ANY, 1,
//					m_pSheetMgr->GetSheet(*rSt)->GetLayerSize() - 2);
//		ObjDynabaseVector::const_iterator iObj;
//		for (iObj = vObj.begin(); iObj != vObj.end(); iObj++)
//		{
//			// _xZkqqHx_iKnGiMfHiClHiCoJiDiKiDjDiDeOiCpAiNoNiPjMiBeCjDoAjFjEiCmFiDiKiDjDiDeOiNoNiPjMiDfCiDhNiDjDiDgIiCmMiLeMjIfOiKnGjAjEiCpAiOmAiNhDiBeC_xHqqkZx_
//			g_pDoc->LinkManager()->DeleteSoonNotify((*iObj)->GetObjID());
//		}
//		// _xZkqqHx_jFjEjFgJiCmMiNoNiPjMiDfCiDhNiDjDiDgIiPiIjHjNiBeC_xHqqkZx_
//		g_pDoc->CmdDeleteObjs(*rSt, vObj);
//		g_pDoc->CmdDelete1Sheet(*rSt);
//		bModified = TRUE;
//	}
//	//-----	_xZkqqHx_jFmPiNfIiDeBiDeDiDgFiDiAiDiKiDfIiDgHiCpAiOoGiCoIiPgPiClFiBeBiDeBiDeDiDgFiDiAiCpAjFmPiNfIiClHiCoJ_xHqqkZx_ -----
//	for	(iSt = m_listCtrl.GetChangedIdSet().begin();
//		 iSt != m_listCtrl.GetChangedIdSet().end(); iSt++)
//	{
//		// _xZkqqHx_iDfGiBfLiDgHiPoOjFpBiCmMjFmPiNfIiCpAiLeMjIfOiBeC_xHqqkZx_
//		if (g_pDoc->CmdModify1Sheet(id2idxMap[*iSt], m_listCtrl.GetRec(*iSt)->strName))
//			bModified = TRUE;
//	}
//	//-----	_xZkqqHx_iDeBiDeDiDgFiDiAjFfMiOkGiPiHiPjIiCpAjFmPiNfIiClHiCoJ_xHqqkZx_ -----
//	vdwId.clear();
//	m_listCtrl.GetIdOrder(vdwId);
//	for (dwIdx = 0; dwIdx < vdwId.size(); dwIdx++)
//		vdwId[dwIdx] = id2idxMap[vdwId[dwIdx]];
//	if (g_pDoc->CmdReOrderSheet(vdwId.begin(), vdwId.size()))
//		bModified = TRUE;
//
//	// _xZkqqHx_iDfKiDgCiDfGiDiHiDjDiPeJjHlJiPiIjHjNiBeC_xHqqkZx_
//	g_pDoc->SessionEnd();
//
//----- 01.03.25 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
	BOOL bIsViewChanged = FALSE;
//----- 06.12.05 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	// _xZkqqHx_jFjEjFgJiCkKiNoNiPjMiClDiCoKiClNiCkJiBeI_xHqqkZx_
	BOOL bIsDeleted = FALSE;
//----- 06.12.05 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----
	// _xZkqqHx_iDfKiDgCiDfGiDiHiDjDiKeKiOgOiPiIjHjNiBeC_xHqqkZx_
	g_pDoc->SessionBegin();

	//----- _xZkqqHx_iNoNiPjMiDeBiDeDiDgFiDiAiDiKiDfIiDgHiCpAiOoGiCoIiPgPiClFiBeBiDeBiDeDiDgFiDiAiCpAiNoNiPjMiClHiCoJ_xHqqkZx_ -----
	DWORDSet::const_reverse_iterator rSt;
	for (rSt = m_listCtrl.GetRemovedIdSet().rbegin();
		 rSt != m_listCtrl.GetRemovedIdSet().rend(); rSt++)
	{
//----- 01.07.20 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
		// _xZkqqHx_jFjEjFgJjBeJjBpAiCpAiJpAiPjMiBeC_xHqqkZx_
		g_pView->ClearSelectObj();
		//----- _xZkqqHx_iDfGiBfLiDgHiPoDiCmMjFjEjFgJiCpAjBfDiCmEiOoGjDlOiBgJiNmFiPoDiImKiBeBiNmFiJlKiImKiDiMiDeDiDiEiBfLiCpAiPjMiCkNiBgK_xHqqkZx_-----
		ObjDynabaseVector vObj;
		m_pSheetMgr->GetSheet(*rSt)->
			GetZOrder(vObj, FDOZ_ON_ANY, 1,
						m_pSheetMgr->GetSheet(*rSt)->GetLayerSize() - 2);
		ObjDynabaseVector::iterator iObj;
		for (iObj = vObj.begin(); iObj != vObj.end(); iObj++)
		{
			// _xZkqqHx_iKnGiMfHiClHiCoJiDiKiDjDiDeOiCpAiNoNiPjMiBeCjDoAjFjEiCmFiDiKiDjDiDeOiNoNiPjMiDfCiDhNiDjDiDgIiCmMiLeMjIfOiKnGjAjEiCpAiOmAiNhDiBeC_xHqqkZx_
			g_pDoc->LinkManager()->DeleteSoonNotify((*iObj)->GetObjID());
		}
		// _xZkqqHx_jFjEjFgJiCmMiNoNiPjMiDfCiDhNiDjDiDgIiPiIjHjNiBeC_xHqqkZx_
//----- 05.11.06 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
//		g_pDoc->CmdDeleteObjs(*rSt, vObj);
//----- 05.11.06 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
		for (iObj = vObj.begin(); iObj != vObj.end(); iObj++)
			g_pDoc->MulticmdDelete1Obj(*iObj, *rSt);
//----- 06.12.05 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
		// _xZkqqHx_jFjEjFgJiCkKiNoNiPjMiClDiCoKiClNiCkJiBeI_xHqqkZx_
		if (!vObj.empty()) bIsDeleted = TRUE;
//----- 06.12.05 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----
//----- 05.11.06 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----

//----- 01.07.20 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----

// 01.07.20 Fukushiro M. 1_xZkqqHx_iNhDjCmHiJmB_xHqqkZx_ ()
		if (g_pDoc->GetCurrentSheetId() == *rSt) bIsViewChanged = TRUE;
		g_pDoc->CmdDelete1Sheet(*rSt);
	}
	//-----	_xZkqqHx_jBhNjDpMiDeBiDeDiDgFiDiAiDiKiDfIiDgHiCpAiOoGiCoIiPgPiClFiBeBiDeBiDeDiDgFiDiAiCpAjBhNjDpMiClHiCoJ_xHqqkZx_ -----
	DWORDSet::const_iterator iSt;
	for (iSt = m_listCtrl.GetInsertedIdSet().begin();
		 iSt != m_listCtrl.GetInsertedIdSet().end(); iSt++)
	{
		SheetID stidNew;
		g_pDoc->CmdInsert1Sheet(stidNew, m_listCtrl.GetRec(*iSt)->strName, *iSt);
	}
	//-----	_xZkqqHx_jFmPiNfIiDeBiDeDiDgFiDiAiDiKiDfIiDgHiCpAiOoGiCoIiPgPiClFiBeBiDeBiDeDiDgFiDiAiCpAjFmPiNfIiClHiCoJ_xHqqkZx_ -----
	for (iSt = m_listCtrl.GetChangedIdSet().begin();
		 iSt != m_listCtrl.GetChangedIdSet().end(); iSt++)
	{
		g_pDoc->CmdModify1Sheet(m_listCtrl.GetRec(*iSt)->strName, *iSt);
	}
//----- 01.03.25 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	if (!m_listCtrl.GetChangedIdSet().empty())
//	{
//		// _xZkqqHx_iDhCiDiFiBfLiCpAiNmEjFgAiJoGiBeC_xHqqkZx_
//		g_pView->SetClientToRgn();
//		g_pView->SendRgnRedraw();
//	}
//----- 01.03.25 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
	//----- _xZkqqHx_iDeBiDeDiDgFiDiAjFfMiOkGiPiHiPjIiCpAjFmPiNfIiClHiCoJ_xHqqkZx_ -----
	FDSheetIDVector vstid;
	m_listCtrl.GetIdOrder(vstid);
	g_pDoc->CmdReOrderSheet(vstid.begin(), vstid.size());
//----- 01.07.20 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
//	// _xZkqqHx_iDeKiDiMiDjDiDgHiDfGiBfLiDgHiCmMjFmPiNfIiBeC_xHqqkZx_
//	g_pDoc->SetCurrentSheetId(m_listCtrl.GetCurrentSheetId());
//----- 01.07.20 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
	// _xZkqqHx_iDeKiDiMiDjDiDgHiDfGiBfLiDgHiCmMjFmPiNfIiBeC_xHqqkZx_
	if (g_pDoc->GetCurrentSheetId() != m_listCtrl.GetCurrentSheetId())
	{
		bIsViewChanged = TRUE;
		// _xZkqqHx_iDeKiDiMiDjDiDgHiDfGiBfLiDgHiCmMjFmPiNfIiBeC_xHqqkZx_
		g_pDoc->SetCurrentSheetId(m_listCtrl.GetCurrentSheetId());
	}
//----- 01.07.20 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----
//----- 06.12.05 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	// _xZkqqHx_iOgHiCoNiCoKiCmEiCkCiCmIiCkCiDhEiDeIiDjDiDgHiCpAjAkOjHjNiBeC_xHqqkZx_
	if (bIsDeleted)
		g_pDoc->MulticmdDeleteUnusedFonts();
//----- 06.12.05 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----
	// _xZkqqHx_iDfKiDgCiDfGiDiHiDjDiPeJjHlJiPiIjHjNiBeC_xHqqkZx_
	g_pDoc->SessionEnd();
//----- 01.03.25 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----
//----- 01.07.20 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	// _xZkqqHx_iNmEjFgAiJoGiBeC_xHqqkZx_
// 03.08.03 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//	if (bIsViewChanged) g_pView->Invalidate();
	if (bIsViewChanged) g_pView->PostRgnRedraw(TRUE);
//----- 01.07.20 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----

	// _xZkqqHx_iDfCiDjDiDgHiDiNiBfLiDiLiCpAiPiJiKpKiJlLiClHiCoJiBeC_xHqqkZx_
	InitControl();
	// _xZkqqHx_iDfGiBfLiDgHiCmMjFmPiNfIiCpAjCmKjCgNiBeC_xHqqkZx_
	PostMessage(WM_USER_MULTICTRL_CHANGED, 0, 0);

//----- 01.03.18 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	typedef map<DWORD, FCSheetCtrlRec*> IdToSheetRecPMap;
//
//	BOOL bModified = FALSE;
//	DWORD dwIdx;
//
//	//----- _xZkqqHx_iDfGiBfLiDgHiDfCiDjDiDgHiDiNiBfLiDiLiCkJiCoHjFmPiNfIiMoDiCmMiDfGiBfLiDgHiPoOjFpBiCpAiOoGjDlO_xHqqkZx_ -----
//	SheetCtrlRecVector vNewSheet;
//	for (dwIdx = 0; dwIdx < m_listCtrl.GetItemRecCount(); dwIdx++)
//	{
//		vNewSheet.push_back(*m_listCtrl.GetItemRec(dwIdx));
//	}
//
//	//----- _xZkqqHx_iDfGiBfLiDgHiPoOjFpBiCmJiLeMjIfOiClDiCoKiClN_xHqqkZx_ID_xZkqqHx_iBgJjFmAiCnHjBnGiCkGiCoHiCoKiCoJjBePiCmMiPiHiPjIiBgKiCmFiDfMiBfLiDgH_xHqqkZx_ -----
//	// _xZkqqHx_iOjPiCmMjIeBjBhKjEhKjHpBiCpAiNoMjAkMiBeC_xHqqkZx_
//	// _xZkqqHx_iBhFiDfGiBfLiDgHiPoOjFpBiCmJiLeMjIfOiClDiCoKiClN_xHqqkZx_ID_xZkqqHx_iBgJjFmAiCnHjBnGiCkGiCoHiCoKiCoJjBePiCmMiPiHiPjIiBgKiBhG_xHqqkZx_->_xZkqqHx_iBhFiDfGiBfLiDgHiPoOjFpBiBhG_xHqqkZx_
//	IdToSheetRecPMap mpIdToSheetRec;
//	SheetCtrlRecVector::iterator iLcr;
//	for (iLcr = vNewSheet.begin(); iLcr != vNewSheet.end(); iLcr++)
//		mpIdToSheetRec.insert(pair<DWORD, FCSheetCtrlRec*>((*iLcr).dwId, iLcr));
//
//	//----- _xZkqqHx_iDfGiBfLiDgHiPoOjFpBiCmJiLeMjIfOiClDiCoKiClN_xHqqkZx_ID_xZkqqHx_iCmJiBeBjAfGiClFiCkNjEnEiNiGiCpAjAfFiCoIiCmIiCkIiClH_xHqqkZx_ -----
//	// mpIdToSheetRec_xZkqqHx_iCmNiBeBiNoNiPjMiBjFjCmHiJmBiCmNiClDiCoKiCmEiCkCiCoJiCkKiBeBjFmAiCnHjBnGiCkGjBePiCmMiPiHiPjIiCpAjFnLiCmBiCmEiCkCiCoJiBeC_xHqqkZx_
//	// _xZkqqHx_jAfFiCoIiCmIiCkIiClFiClNjEnEiNiGiCmNiBeBiKpJjBlGiCmMiDfGiBfLiDgHiCmJiImIiJlKiCmMiPiIjChFiCpAiOhLiClFiClNiCmMiCmGjDkPiClGiBeC_xHqqkZx_
//	// _xZkqqHx_iDfGiBfLiDgHiCpAiNoNiPjMiClFiBeBiDiKiDfIiDgHiNmFiMoDiCmJiDfGiBfLiDgHiCpAjCmHiJmBiBeC_xHqqkZx_
//	// _xZkqqHx_iClBiCmMjAfFiCoIiCmIiCkIiClFiClN_xHqqkZx_ID_xZkqqHx_iCmGiBeB_xHqqkZx_vNewSheet_xZkqqHx_iCmMiPiHiPjIiCpAjEoEiKhCiClHiCoJiClBiCmGiCmJiCoGiCoIiBeBiPoDiLeMiCmMiCfDiBeEiCmM_xHqqkZx_
//	// _xZkqqHx_iPiIjHjNiCpAiOmAiMlLiCmFiCkLiCoJiBeC_xHqqkZx_
//	IdToSheetRecPMap::iterator iIdl;
//	DWORD dwCount = 0;
//	for (iIdl = mpIdToSheetRec.begin(); iIdl != mpIdToSheetRec.end(); iIdl++, dwCount++)
//		(*iIdl).second->dwId = dwCount;
//
//	// _xZkqqHx_iDfKiDgCiDfGiDiHiDjDiKeKiOgOiPiIjHjNiBeC_xHqqkZx_
//	g_pDoc->SessionBegin();
//	//----- _xZkqqHx_jFmPiNfIiClDiCoKiClNiDfGiBfLiDgHiCmMiPoOjFpBiCpAjFmPiNfI_xHqqkZx_ -----
//	// _xZkqqHx_iCmCiCkCiCmFiCmJiBeBiNoNiPjMiClDiCoKiClNiDfGiBfLiDgHiBeBjCmHiJmBiClDiCoKiClNiDfGiBfLiDgHiCoAiOfKiPgPiBeC_xHqqkZx_
//	DWORDVector vDeleted;
//	for (dwIdx = 0; dwIdx < m_pSheetMgr->GetSheetSize(); dwIdx++)
//	{
//		// _xZkqqHx_iKpJjBlGiCmMiDfGiBfLiDgHiCmNiBeBjFmPiNfIiMoDiCmMiDiKiDfIiDgHiCmJiOgDiCmBiCmEiCkCiCoJiCkJiCpAiDgAiDeGiDgCiDeOiBeC_xHqqkZx_
//		iIdl = mpIdToSheetRec.find(dwIdx);
//		if (iIdl == mpIdToSheetRec.end())
//		//----- _xZkqqHx_iOgDiCmBiCmEiCkCiCmIiCkCiPoKiNiH_xHqqkZx_ -----
//		{
//			// _xZkqqHx_iNoNiPjMiDiKiDfIiDgHiCmJjCmHiJmBiBeC_xHqqkZx_
//			vDeleted.push_back(dwIdx);
//		} else
//		//----- _xZkqqHx_iOgDiCmBiCmEiCkCiCoJiPoKiNiH_xHqqkZx_ -----
//		{
//			// _xZkqqHx_iDfGiBfLiDgHiPoOjFpBiCmMjFmPiNfIiCpAiLeMjIfOiBeC_xHqqkZx_
//			if (g_pDoc->CmdModify1Sheet(dwIdx, (*iIdl).second->strName))
//				bModified = TRUE;
//			// _xZkqqHx_iKpJiCmJiMkJiCmCiCkJiCmBiClNiCoAiCmMiCmNiBeBiDiKiDfIiDgHiCkJiCoHiOoGiCoIiPjMiCkNiBeCiDiKiDfIiDgHiCmJiNmFiMoDiCmJiOgDiCmBiClN_xHqqkZx_
//			// _xZkqqHx_iDfGiBfLiDgHiCkKjAfGiLeLjCmHiJmBiClDiCoKiClNiCoAiCmMiCmFiCkAiCoJiBeC_xHqqkZx_
//			mpIdToSheetRec.erase(iIdl);
//		}
//	}
//	//----- _xZkqqHx_iDfGiBfLiDgHiCmMiNoNiPjMiPiIjHjN_xHqqkZx_ -----
//	DWORDVector::reverse_iterator iDel;
//	for (iDel = vDeleted.rbegin(); iDel != vDeleted.rend(); iDel++)
//	{
//		g_pView->ClearSelectObj();
//		ObjDynabaseVector vObj;
//		m_pSheetMgr->GetSheet(*iDel)->
//			GetZOrder(vObj, FDOZ_ON_ANY, 1,
//					m_pSheetMgr->GetSheet(*iDel)->GetLayerSize() - 2);
//		ObjDynabaseVector::const_iterator iObj;
//		for (iObj = vObj.begin(); iObj != vObj.end(); iObj++)
//		{
//			// _xZkqqHx_iKnGiMfHiClHiCoJiDiKiDjDiDeOiCpAiNoNiPjMiBeCjDoAjFjEiCmFiDiKiDjDiDeOiNoNiPjMiDfCiDhNiDjDiDgIiCmMiLeMjIfOiKnGjAjEiCpAiOmAiNhDiBeC_xHqqkZx_
//			g_pDoc->LinkManager()->DeleteSoonNotify((*iObj)->GetObjID());
//		}
//		// _xZkqqHx_jFjEjFgJiCmMiNoNiPjMiDfCiDhNiDjDiDgIiPiIjHjNiBeC_xHqqkZx_
//		g_pDoc->CmdDeleteObjs(*iDel, vObj);
//		g_pDoc->CmdDelete1Sheet(*iDel);
//		bModified = TRUE;
//	}
//	//----- _xZkqqHx_iDfGiBfLiDgHiCmMjCmHiJmBiPiIjHjN_xHqqkZx_ -----
//	for (iIdl = mpIdToSheetRec.begin(); iIdl != mpIdToSheetRec.end(); iIdl++)
//	{
//		//----- _xZkqqHx_iDfGiBfLiDgHiCpAjCmHiJmB_xHqqkZx_ -----
//		SheetID stid = m_pSheetMgr->GetSheetSize();
//		g_pDoc->CmdInsert1Sheet(stid, (*iIdl).second->strName);
//		bModified = TRUE;
//	}
//	//----- _xZkqqHx_iDfGiBfLiDgHiPiHiPjIjFmPiNfIiCmMiLeMjIfO_xHqqkZx_ -----
//	//----- _xZkqqHx_iLeMjIfOjHhAiCmMjEhKjHpBiCpAiNoMjAkM_xHqqkZx_ -----
//	// _xZkqqHx_iMmDiCkCiPiHiPjIiCpAjAjEjCgMiCmJiClFiCmEiBeBiClLiCmMjAjEjCgMiCpAjAfGiClFiCkCiDfGiBfLiDgHiPiHiCmJjFmAiCnHiClNjEhKjHpBiBeC_xHqqkZx_
//	DWORDVector vNewOrder;
//	for (dwIdx = 0; dwIdx < vNewSheet.size(); dwIdx++)
//		vNewOrder.push_back(vNewSheet[dwIdx].dwId);
//	// _xZkqqHx_iDfGiBfLiDgHiPiHiPjIiCmMjFmPiNfIiDfCiDhNiDjDiDgIiBeC_xHqqkZx_
//	if (g_pDoc->CmdReOrderSheet(vNewOrder.begin(), vNewOrder.size()))
//		bModified = TRUE;
//	// _xZkqqHx_iDeKiDiMiDjDiDgHiDfGiBfLiDgHiCmMjFmPiNfIiBeC_xHqqkZx_
//	if (m_pSheetMgr->GetCurrentSheetId() != m_listCtrl.GetCurrentSheetId())
//	{
//		bModified = TRUE;
//		g_pDoc->SetCurrentSheetId(m_listCtrl.GetCurrentSheetId());
//	}
//	// _xZkqqHx_iDfKiDgCiDfGiDiHiDjDiPeJjHlJiPiIjHjNiBeC_xHqqkZx_
//	g_pDoc->SessionEnd();
//----- 01.03.18 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
//----- 01.03.25 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	// _xZkqqHx_iDeKiDiMiDjDiDgHiDfGiBfLiDgHiCmMjFmPiNfIiBeC_xHqqkZx_
//	if (m_pSheetMgr->GetCurrentSheetId() != m_listCtrl.GetCurrentSheetId())
//	{
//		bModified = TRUE;
//		g_pDoc->SetCurrentSheetId(m_listCtrl.GetCurrentSheetId());
//	}
//	if (bModified)
//	//----- _xZkqqHx_iDfGiBfLiDgHiCmJjFmPiNfIiCkKiCkAiCoJiPoKiNiH_xHqqkZx_ -----
//	{
//		// _xZkqqHx_iDhCiDiFiBfLiCmJiDfGiBfLiDgHjFmPiNfIiCpAjCmKjCgNiBeCjBeJjBpAiCpAiJpAiPjMiClFiBeBjBeJjBpAiDgDiBfLiDiLiCmJjGnPiClHiBeC_xHqqkZx_
//		g_pView->PostMessage(WM_USER_SHEET_UPDATED);
//		// _xZkqqHx_iDhEiDiMiBfLiDiAiCmJiDfGiBfLiDgHjFmPiNfIiCpAjCmKjCgNiBeC_xHqqkZx_
//		FFGetMainWnd()->PostMessage(WM_USER_SHEET_UPDATED);
//		// _xZkqqHx_iDhCiDiFiBfLiCpAiNmEjFgAiJoGiBeC_xHqqkZx_
//		g_pView->Invalidate();
//	}
//	// _xZkqqHx_iDiMiDeDiDiEiBfLiCmMjFmPiNfIiCpAjCmKjCgNiBeC_xHqqkZx_
//	PostMessage(WM_USER_MULTICTRL_CHANGED, 0, 0);
//----- 01.03.25 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
} // CFCDlgSheetOrder::OnApplyNow.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgSheetOrder::OnUserMultictrlChanged
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfGiBfLiDgHiDfCiDjDiDgHiDiNiBfLiDiLiCmJjFmPiNfIiCkKiCkAiCmBiClNiCmGiCkLjCmKjCgNiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	wParam	:_xZkqqHx_iDfCiDjDiDgHiDiNiBfLiDiL_xHqqkZx_ID_xZkqqHx_iCpAiOhHjCoIiBeC_xHqqkZx_
 *			lParam	:_xZkqqHx_jGkCiOgHjHhAiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iPoNiCmJ_xHqqkZx_1.
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.12.27 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
LRESULT CFCDlgSheetOrder::OnUserMultictrlChanged (WPARAM wParam, LPARAM lParam)
{
	GetDlgItem(ID_APPLY_NOW)->EnableWindow(IsSheetChanged() && FFCanEditDocumentEnv());
	GetDlgItem(IDC_STO_BTN_SHEET_MODIFY)->EnableWindow(m_listCtrl.CanChangeItem());
	GetDlgItem(IDC_STO_BTN_SHEET_ADD)->EnableWindow(m_listCtrl.CanInsertItemNext());
	GetDlgItem(IDC_STO_BTN_SHEET_DELETE)->EnableWindow(m_listCtrl.CanDeleteItem());
	return 1;
} // CFCDlgSheetOrder::OnUserMultictrlChanged.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgSheetOrder::OnUserListctrlSelchanged
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfGiBfLiDgHiDfCiDjDiDgHiDiNiBfLiDiLiCmMjBeJjBpAiCkKjFmPiNfIiClDiCoKiClNiOjOiCmJiOmAiNhDiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	wParam	:_xZkqqHx_iDfCiDjDiDgHiDiNiBfLiDiL_xHqqkZx_ID_xZkqqHx_iCpAiOhHjCoIiBeC_xHqqkZx_
 *			lParam	:_xZkqqHx_jBeJjBpAiClDiCoKiClNiDeBiDeDiDgFiDiAiDeDiDjDiDgGiDgCiDeOiDfIiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.03.21 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
LRESULT CFCDlgSheetOrder::OnUserListctrlSelchanged (WPARAM wParam, LPARAM lParam)
{
	return OnUserMultictrlChanged(0,0);
} // CFCDlgSheetOrder::OnUserListctrlSelchanged.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgSheetOrder::OnStoBtnSheetModify
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFmPiNfIiDhLiDfOiDjDiCkJiCoHiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.03.21 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void CFCDlgSheetOrder::OnStoBtnSheetModify ()
{
	m_listCtrl.PostMessage(WM_COMMAND, ID_RBTN_ITEM_CHANGE);
} // CFCDlgSheetOrder::OnStoBtnSheetModify.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgSheetOrder::OnStoBtnSheetAdd
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jCmHiJmBiDhLiDfOiDjDiCkJiCoHiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.03.21 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void CFCDlgSheetOrder::OnStoBtnSheetAdd ()
{
	m_listCtrl.PostMessage(WM_COMMAND, ID_RBTN_ITEM_INSERT_NEXT);
} // CFCDlgSheetOrder::OnStoBtnSheetAdd.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgSheetOrder::OnStoBtnSheetDelete
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iNoNiPjMiDhLiDfOiDjDiCkJiCoHiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.03.21 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void CFCDlgSheetOrder::OnStoBtnSheetDelete ()
{
	m_listCtrl.PostMessage(WM_COMMAND, ID_RBTN_ITEM_DELETE);
} // CFCDlgSheetOrder::OnStoBtnSheetDelete.
