/* CTLCSpin.hpp : header file*/
/*///////////////////////////////////////////////////////////////////////////*/
#ifndef _CTL_W_SPIN_BUTTON_
#define _CTL_W_SPIN_BUTTON_
 
#if _MSC_VER >= 1000
#pragma once
#endif /* _MSC_VER >= 1000*/
 
#include "ACP_Base.h"
#include "CTL\WControls\CTL_BWC.hpp"
 
class CTL_Editor_IntegerControl;
class CTL_Editor_DecimalControl;
class CTL_Editor_VectorControl;
 
typedef enum eCarSpinType
{
	EDCAR_SPIN_TYPE_INTEGER = 0,
	EDCAR_SPIN_TYPE_DECIMAL,
 	EDCAR_SPIN_TYPE_VECTOR,
 
} tdeCarSpinType;
 
/*///////////////////////////////////////////////////////////////////////////*/
/* CTL_Editor_SpinButton window*/
 
class CPA_EXPORT CTL_Editor_SpinButton : public CSpinButtonCtrl,
																				 public CTL_BaseWindowsControl
{
/* Construction*/
public:
	CTL_Editor_SpinButton(CTL_Editor_IntegerControl *_pclControl,
 												long _lLower,
												long _lUpper,
												CWnd *_pclParentWnd);
 
	CTL_Editor_SpinButton(CTL_Editor_DecimalControl *_pclControl,
 												long double _ldLower,
												long double _ldUpper,
												CWnd *_pclParentWnd);
 
	CTL_Editor_SpinButton(CTL_Editor_VectorControl *_pclControl,
 												long double _ldLower,
												long double _ldUpper,
												CWnd *_pclParentWnd);
 
/* Attributes*/
public:
	tdeCarSpinType m_tdeType;
 
private:
	CTL_Editor_IntegerControl *m_pclIntegerControl;
	CTL_Editor_DecimalControl *m_pclDecimalControl;
	CTL_Editor_VectorControl *m_pclVectorControl;
 
	/*For integers*/
	long m_lLower;
	long m_lUpper;
	long m_lCurrent;
	/*For decimals*/
	long double m_ldLower;
	long double m_ldUpper;
	long double m_ldCurrent;
	long double m_ldDivisor;
 
	/*Internal*/
	unsigned short m_uwOldPosition;
	unsigned short m_uwManualIntegerDelta;
	float m_fManualDecimalDelta;
	BOOL m_bManualPosIsOn;
 
/* Operations*/
public:
 
/* Overrides*/
	/* ClassWizard generated virtual function overrides*/
	/*{{AFX_VIRTUAL(CTL_Editor_SpinButton)*/
	/*}}AFX_VIRTUAL*/
 
/* Implementation*/
public:
	virtual ~CTL_Editor_SpinButton();
	void m_fn_vSetCurrentPos(long lNewValue);
	void m_fn_vSetCurrentPos(long double ldNewValue);
 
	/*For TUT registration*/
	virtual void m_pub_fn_vRegisterWindowsControl(CString _csAdditionnalInfo);
 
	/* Generated message map functions*/
protected:
	/*{{AFX_MSG(CTL_Editor_SpinButton)*/
	afx_msg void OnDeltapos(NMHDR* pNMHDR, LRESULT* pResult);
	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 OnSetfocus(NMHDR* pNMHDR, LRESULT* pResult);
	/*}}AFX_MSG*/
 
	DECLARE_MESSAGE_MAP()
};
 
/*///////////////////////////////////////////////////////////////////////////*/
#endif/* _CTL_W_SPIN_BUTTON_*/
 
