#ifndef __CtlBrHRuler_h
#define __CtlBrHRuler_h

#include "ControlBarBase.h"	// For Baseclass.

#ifdef SUPER_CLASS
#undef SUPER_CLASS
#endif
#define SUPER_CLASS CFCControlBarBase


/////////////////////////////////////////////////////////////////////////////
// CFCCtlBrHRuler

/*************************************************************************
 * <_xZkqqHx_jHpBiLjD_xHqqkZx_>	FTMarkStat
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDhNiBfLiDeKiBfLiCmMiInKjDkOiOjOiCmJiOgHiCoNiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.11.23 Fukushiro M. _xZkqqHx_iDfCiDiBiDjDiDgHiNoMjAkM_xHqqkZx_
 *************************************************************************/
enum FTMarkStat
{
//----- 05.11.23 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	FDHR_NONE = 0,					// _xZkqqHx_jGlDiClFiBeC_xHqqkZx_
//	FDHR_BOTH_MARKER_BGNMOVE,		// _xZkqqHx_jHlMiDeDiDjDiDgGiDjDiDgHiInKjDkOiKeKiOgOiBeC_xHqqkZx_
//	FDHR_BOTH_MARKER_MOVING,		// _xZkqqHx_jHlMiDeDiDjDiDgGiDjDiDgHiInKjDkOjCiGiBeC_xHqqkZx_
//	FDHR_BOTH_MARKER_ENDMOVE,		// _xZkqqHx_jHlMiDeDiDjDiDgGiDjDiDgHiInKjDkOiPeJjHlJiBeC_xHqqkZx_
//	FDHR_RIGHT_MARKER_BGNMOVE,		// _xZkqqHx_iJeFiDeDiDjDiDgGiDjDiDgHiInKjDkOiKeKiOgOiBeC_xHqqkZx_
//	FDHR_RIGHT_MARKER_MOVING,		// _xZkqqHx_iJeFiDeDiDjDiDgGiDjDiDgHiInKjDkOjCiGiBeC_xHqqkZx_
//	FDHR_RIGHT_MARKER_ENDMOVE,		// _xZkqqHx_iJeFiDeDiDjDiDgGiDjDiDgHiInKjDkOiPeJjHlJiBeC_xHqqkZx_
//	FDHR_LEFT_MARKER_BGNMOVE,		// _xZkqqHx_iNlGiDeDiDjDiDgGiDjDiDgHiInKjDkOiKeKiOgOiBeC_xHqqkZx_
//	FDHR_LEFT_MARKER_MOVING,		// _xZkqqHx_iNlGiDeDiDjDiDgGiDjDiDgHiInKjDkOjCiGiBeC_xHqqkZx_
//	FDHR_LEFT_MARKER_ENDMOVE,		// _xZkqqHx_iNlGiDeDiDjDiDgGiDjDiDgHiInKjDkOiPeJjHlJiBeC_xHqqkZx_
//	FDHR_OFFSET_MARKER_BGNMOVE,		// _xZkqqHx_iCnEiCoHiJlKiClAiDeDiDjDiDgGiDjDiDgHiInKjDkOiKeKiOgOiBeC_xHqqkZx_
//	FDHR_OFFSET_MARKER_MOVING,		// _xZkqqHx_iCnEiCoHiJlKiClAiDeDiDjDiDgGiDjDiDgHiInKjDkOjCiGiBeC_xHqqkZx_
//	FDHR_OFFSET_MARKER_ENDMOVE,		// _xZkqqHx_iCnEiCoHiJlKiClAiDeDiDjDiDgGiDjDiDgHiInKjDkOiPeJjHlJiBeC_xHqqkZx_
//	FDHR_TAB_MARKER_BGNMOVE,		// _xZkqqHx_iDfOiDhFiInKjDkOiKeKiOgOiBeC_xHqqkZx_
//	FDHR_TAB_MARKER_MOVING,			// _xZkqqHx_iDfOiDhFiInKjDkOjCiGiBeC_xHqqkZx_
//	FDHR_TAB_MARKER_ENDMOVE,		// _xZkqqHx_iDfOiDhFiInKjDkOiPeJjHlJiBeC_xHqqkZx_
//----- 05.11.23 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
	FDHR_MARKER_MOVE_BEGIN,		// _xZkqqHx_iDhNiBfLiDeKiBfLiInKjDkOiKeKiOgOiBeC_xHqqkZx_
	FDHR_MARKER_MOVING,			// _xZkqqHx_iDhNiBfLiDeKiBfLiInKjDkOjCiGiBeC_xHqqkZx_
	FDHR_MARKER_MOVE_END,		// _xZkqqHx_iDhNiBfLiDeKiBfLiInKjDkOiPeJjHlJiBeC_xHqqkZx_
}; // enum FTMarkStat.

class CFCCtlBrHRuler : public SUPER_CLASS
{
protected:
typedef SUPER_CLASS BASE_CLASS;

	DECLARE_DYNAMIC(CFCCtlBrHRuler)

public:
// 06.04.23 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//	CFCCtlBrHRuler (BOOL bDrawBorder);
	CFCCtlBrHRuler ();
	virtual ~CFCCtlBrHRuler ();

// _xZkqqHx_iDiGiBfLiDfFiDfCiBfLiDgIiBeC_xHqqkZx_
public:
	virtual BOOL Create (CWnd* pParentWnd, DWORD dwStyle, UINT nID);

	virtual void	ScrollTo (long lgVal);
	virtual void	SetPitch (mmetol mmPitch0, mmetol mmPitch1, short nZoomFig);
	virtual void	SetTextRange (CWnd* wndpTarget, mmetol vmmBegin, mmetol vmmEnd);
	virtual void	UnSetTextRange ();

	//----- _xZkqqHx_iDiLiBfLiDiJiBfLiDhNiDeFiDfIiDhNiBfLiDeKiBfLiKnGiMfH_xHqqkZx_ -----
	virtual BOOL	IsRulerMMKVisible (short nIndex) const;
								// RulerMMK_xZkqqHx_iCmMjFfMiOkGiBeFjEpBjFfMiOkGiCpAjClCiCnHiCoJ_xHqqkZx_.
	virtual void	SetRulerMMKVisible (short nIndex, BOOL bVisible);
								// RulerMMK_xZkqqHx_iCmMjFfMiOkGiBeFjEpBjFfMiOkGiCpAjAnNjCoIiClHiCoJ_xHqqkZx_.
	virtual void	MoveRulerMMK (short nIndex, long lgVal);
								// RulerMMK_xZkqqHx_iCpAiInKjDkOiClHiCoJ_xHqqkZx_.

	//----- _xZkqqHx_iDeDiDjDiDgGiDjDiDgHiKnGiMfH_xHqqkZx_ -----
	virtual mmetol	GetLeftIndent () const;
	virtual mmetol	GetOffsetIndent () const;
	virtual mmetol	GetRightIndent () const;
	virtual void	Set3Indents (mmetol tmmStart, mmetol tmmOffset, mmetol tmmRight);
	virtual const mmetolVector&	GetTabs () const;
	virtual void	SetTabs (const mmetolVector& vtmmTabs);

protected:
	virtual long	VLG2DV (long lgVal) const;
	virtual long	DV2VLG (long dvVal) const;
	virtual long	VMM2DV (mmetol vmmVal) const;
	virtual mmetol	DV2VMM (long dvVal) const;
	virtual long	TMM2DV (mmetol tmmVal) const;
	virtual mmetol	DV2TMM (long dvVal) const;
	virtual void	DrawTextRange (CDC* pDC);
// 06.02.24 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	virtual void	OnUpdatePopupMenu (CMenu* pMenu) const;
//----- 05.11.23 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	enum WhichMarker
	{
		NONE = 0,			// _xZkqqHx_iDiLiBfLiDiJiBfLjEhHiMgJiBeC_xHqqkZx_
		BOTH_MARKER,		// _xZkqqHx_jHlMiDeDiDjDiDgGiDjDiDgHiDhNiBfLiDeKiBfLiBeC_xHqqkZx_
		RIGHT_MARKER,		// _xZkqqHx_iJeFiDeDiDjDiDgGiDjDiDgHiDhNiBfLiDeKiBfLiBeC_xHqqkZx_
		LEFT_MARKER,		// _xZkqqHx_iNlGiDeDiDjDiDgGiDjDiDgHiDhNiBfLiDeKiBfLiBeC_xHqqkZx_
		OFFSET_MARKER,		// _xZkqqHx_iCnEiCoHiJlKiClAiDeDiDjDiDgGiDjDiDgHiDhNiBfLiDeKiBfLiBeC_xHqqkZx_
		TAB_MARKER,			// _xZkqqHx_iDfOiDhFiDhNiBfLiDeKiBfLiBeC_xHqqkZx_
	};
	virtual WhichMarker	PointToWhichMarker (long& lTabIndex, const CPoint& dvpt) const;
	virtual WString	GetHintText (WhichMarker which, long lTabIndex) const;
//----- 05.11.23 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----

	virtual BOOL OnCmdMsg (UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);

protected:
// 06.04.23 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	BOOL	m_bDrawBorder;	// _xZkqqHx_iDhLiBfLiDfPiBfLjApMiCpAjFgAiJoGiClHiCoJiCkJiBeI_xHqqkZx_

	mmetol	m_mmPitch0;		// _xZkqqHx_iNnHiCkJiCkCiNiPiCnNiBeCiOmAiNmAjFfHiBeC_xHqqkZx_
	mmetol	m_mmPitch1;		// _xZkqqHx_jBoFiCkLiCkCiNiPiCnNiBeCiOmAiNmAjFfHiBeC_xHqqkZx_
	short	m_nZoomFig;		// Zoom_xZkqqHx_iCmMiMiFiBeC_xHqqkZx_10^m_nZoomFig_xZkqqHx_iBeC_xHqqkZx_

	// _xZkqqHx_iImIiJlKiCmN_xHqqkZx_View_xZkqqHx_iCoC_xHqqkZx_g_->Offset_xZkqqHx_iCkJiCoHiOfKiPgPiJmCjEfMiClOiCkKiBeBiDfIiDeOiDiNiBfLiDiLiNmEjFgAiJoGiOjOiCmJiBeB_xHqqkZx_
	// _xZkqqHx_iDiLiBfLiDiJiBfLiMmFjHeMiCmMiDfIiDeOiDiNiBfLiDiLiImKjChFjDjJiCpAiLeMjIfOiClFiCmEiCkAiCoJjFeLjHhGiCkKiCkAiCoJiClNiCnPiBeC_xHqqkZx_
	long	m_dvOffset;		// _xZkqqHx_iDfIiDeOiDiNiBfLiDiLiImKjChFiBeC_xHqqkZx_0_xZkqqHx_iCkJiCoHiNlGjFpLiMpMiCnGiCmMiDeJiDhEiDfKiDgCiDgHiBeC_xHqqkZx_
	CRect	m_dvrctRuler;	// Ruler_xZkqqHx_jFgAiJoGjHmMiIoGiBeCiDgGiDgPiDeDiDfIiNmAjFfHiBeC_xHqqkZx_

	//----- _xZkqqHx_iDiLiBfLiDiJiBfLiDhNiDeFiDfIiDhNiBfLiDeKiBfLiKnGiMfH_xHqqkZx_ -----
	BOOL	m_baIsRulerMMKVisible[FD_RULER_MMK_MAX];
	long	m_lgaRulerMMK[FD_RULER_MMK_MAX];

//----------<NOT EXPORT TO VIEWER>-----------
	mmetol	m_vmmBegin;		// _xZkqqHx_jFfMiOkGjEmNiImNiCmMiKeKiOgOiNmAjFfHiBeC_xHqqkZx_View_xZkqqHx_iOmAiNmAjFfHiBeC_xHqqkZx_
	mmetol	m_vmmEnd;		// _xZkqqHx_jFfMiOkGjEmNiImNiCmMiPeJjHlJiNmAjFfHiBeC_xHqqkZx_View_xZkqqHx_iOmAiNmAjFfHiBeC_xHqqkZx_
	CWnd*	m_wndpTarget;	// _xZkqqHx_jFfMiOkGjEmNiImNiDiCiBfLiDgIiCpAiOhHiOkGiClFiClNiDeFiDeCiDjDiDgIiDeFiBeC_xHqqkZx_

// 05.11.23 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//	FTMarkStat	m_markerMovingStat;		// _xZkqqHx_iDhNiBfLiDeKiBfLiCmMiPpDjBnEiCpAiOkGiClHiBeC_xHqqkZx_
	WhichMarker	m_whichMarkerMoving;	// _xZkqqHx_iInKjDkOjBmOiPnLiCmMiDhNiBfLiDeKiBfLiBeC_xHqqkZx_
	mmetol		m_tmmMarkerLeft;		// _xZkqqHx_iNlGiDeDiDjDiDgGiDjDiDgHiDhNiBfLiDeKiBfLiCmMiImKjChFiBeC_xHqqkZx_
	mmetol		m_tmmMarkerRight;		// _xZkqqHx_iJeFiDeDiDjDiDgGiDjDiDgHiDhNiBfLiDeKiBfLiCmMiImKjChFiBeC_xHqqkZx_
	mmetol		m_tmmMarkerOffset;		// _xZkqqHx_iMhAjBlBiNhDiDeDiDjDiDgGiDjDiDgHiDhNiBfLiDeKiBfLiCmMiImKjChFiBeC_xHqqkZx_
	mmetolVector m_vtmmTabMarkers;		// _xZkqqHx_iDfOiDhFiDhNiBfLiDeKiBfLiCmMiImKjChFiBeC_xHqqkZx_
	int			m_iMovingTabIndex;		// _xZkqqHx_iInKjDkOiDfOiBfLiDfBiDgCiDgHiCmMiDfOiDhF_xHqqkZx_ID_xZkqqHx_iBeC_xHqqkZx_
	long		m_pxMovingOffset;		// _xZkqqHx_iDhNiBfLiDeKiBfLiCmGiDhNiDeFiDfIiCmMiImKjChFiCmMiNlH_xHqqkZx_(_xZkqqHx_iDiPiBfLiDeOjHhA_xHqqkZx_)_xZkqqHx_iBeC_xHqqkZx_

	HICON	m_hIconUpMark;		// _xZkqqHx_iDeBiDeDiDfCiDjDiBeC_xHqqkZx_
	HICON	m_hIconDownMark;	// _xZkqqHx_iDeBiDeDiDfCiDjDiBeC_xHqqkZx_
	HICON	m_hiMarkOffset;		// _xZkqqHx_iDeBiDeDiDfCiDjDiBeC_xHqqkZx_
	HICON	m_hiTab;			// _xZkqqHx_iDeBiDeDiDfCiDjDiBeC_xHqqkZx_
//----------</NOT EXPORT TO VIEWER>-----------

// Attributes
public:

// Implementation
public:
	virtual void DoPaint(CDC* pDC);
	virtual CSize CalcFixedLayout(BOOL bStretch, BOOL bHorz);
  
protected:
	virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler);

	// Generated message map functions
	//{{AFX_MSG(CFCCtlBrHRuler)
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
	afx_msg void OnRbtnRulerClearAllTabPos();
	afx_msg void OnUpdateRulerClearAllTabPos(CCmdUI* pCmdUI);
	afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
	afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos);
	//}}AFX_MSG
	afx_msg LRESULT OnUserUpdateRuler(WPARAM wParam, LPARAM lParam);
	afx_msg LRESULT OnUserPursuerTextNeedInfo(WPARAM wParam, LPARAM lParam = 0);
	DECLARE_MESSAGE_MAP()
// 06.02.24 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
//----- 06.02.24 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
//	afx_msg void OnDestroy();
//----- 06.02.24 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

}; // class CFCCtlBrHRuler.

#endif//__CtlBrHRuler_h

