www.pudn.com > CTableDemo.rar > Counter.h


#if !defined(AFX_REVCHAR_H__54BD30B0_1102_11D6_9D7D_006008CEA22C__INCLUDED_) 
#define AFX_REVCHAR_H__54BD30B0_1102_11D6_9D7D_006008CEA22C__INCLUDED_ 
 
#if _MSC_VER > 1000 
#pragma once 
#endif // _MSC_VER > 1000 
// Counter.h : header file 
// 
 
#define		NUM_IMAGE_ARRAYS	10 // number of CImageList objects per counter 
#define		NUM_ARRAY_IMAGES    8  // num images in each image list 
 
//	user defined message 
#define		WM_ADVANCE_COUNTER	WM_USER + 101 
 
//	rotation styles 
#define		STYLE_ROTATE_FROM_ZERO			0 
#define		STYLE_ROTATE_WRAPAROUND	     1 
 
///////////////////////////////////////////////////////////////////////////// 
// CCounter window 
 
class CCounter : public CStatic 
{ 
// Construction 
public: 
	CCounter(); 
 
// Attributes 
public: 
	int		   m_TimeInterval;	// delay between each number image 
	int 	   m_RotationStyle;	// start from zero or wrap around 
 
private: 
	int		   m_nNumber;	   //	number to be advanced to in counter 
	int		   m_LastDigit;		 // current number being shown, before updating 
	int		   m_DigitVal;		// digit to be shown - counter will scroll to this digit. 
	BOOL  m_bAllowRotation;	  // this is set to prevent invalid rotation  
												//		when Windows repaints the control  
												//		due to hiding or minimizing. 
	 
 
private: 
	BOOL			 m_bInitialize;		// used to determine the first time counter is used 
	CImageList	   m_ImgArray [NUM_IMAGE_ARRAYS];	// array of Image arrays 
													  //	10 arrays of 8 images each, 
													  //	0 to 1, 1 to 2, 2 to 3 ... 9 to 0 
 
protected: 
	 
 
// Operations 
public: 
 
private: 
	void	RunImageBmp (int i, CPaintDC *pDC, POINT  pt); 
 
// Overrides 
	// ClassWizard generated virtual function overrides 
	//{{AFX_VIRTUAL(CCounter) 
	protected: 
	virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam); 
	//}}AFX_VIRTUAL 
 
// Implementation 
public: 
	virtual ~CCounter(); 
 
	// Generated message map functions 
protected: 
	//{{AFX_MSG(CCounter) 
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); 
	afx_msg void OnPaint(); 
	//}}AFX_MSG 
 
	DECLARE_MESSAGE_MAP() 
}; 
 
///////////////////////////////////////////////////////////////////////////// 
 
//{{AFX_INSERT_LOCATION}} 
// Microsoft Visual C++ will insert additional declarations immediately before the previous line. 
 
#endif // !defined(AFX_REVCHAR_H__54BD30B0_1102_11D6_9D7D_006008CEA22C__INCLUDED_)