digitclock.h

来自「一个完整的数字硬盘录像机系统软件」· C头文件 代码 · 共 72 行

H
72 行
字号
#if !defined(AFX_DIGITCLOCK_H__C5C1FAC1_0D61_11D4_8170_F29470B4787E__INCLUDED_)
#define AFX_DIGITCLOCK_H__C5C1FAC1_0D61_11D4_8170_F29470B4787E__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DigitClock.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CDigitClock window

class CDigitClock : public CStatic
{
// Construction
public:
	CDigitClock();

// Attributes
public:
	enum CClockStyle { XDC_SECOND, XDC_NOSECOND };
	static COLORREF origin;
private:
	COLORREF         m_color;
	UINT		     m_w;
	UINT		     m_h;
	CClockStyle      m_style;
	BITMAP		     m_bm;
	CBitmap          m_Bitmap[12];
	UINT		     m_nTimer;
	CBitmap		     m_DotBitmap;
	BOOL             m_bCreate;
// Operations
public:
	CClockStyle      GetStyle() const { return m_style;}
	CClockStyle      SetStyle(CClockStyle style);
	COLORREF         GetColor() const { return m_color;}
	COLORREF         SetColor(COLORREF color);
private:
	void		     Output(UINT digit, UINT pos);
	void		     OutputDate(UINT digit, UINT pos);

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CDigitClock)
	protected:
	virtual void PreSubclassWindow();
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CDigitClock();
	// Generated message map functions
protected:
	//{{AFX_MSG(CDigitClock)
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnDestroy();
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnPaint();
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	//}}AFX_MSG

	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_DIGITCLOCK_H__C5C1FAC1_0D61_11D4_8170_F29470B4787E__INCLUDED_)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?