⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 digitst.h

📁 显示数字电子时钟的程序
💻 H
字号:
#ifndef _DIGITST_H
#define _DIGITST_H

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

// DigitST.h : header file
//

// Min number of digits we can display
#define ST_MIN_PRECISION	1
// Max number of digits we can display (it can be increased)
#define ST_MAX_PRECISION	10
// Space left around the bitmap for border
#define BORDER_SPACE		3


class CDigitST : public CStatic
{
public:
	CDigitST();
	virtual ~CDigitST();
    enum {	ST_LEFT			= 0x01, 
			ST_TOP			= 0x02,
			ST_RIGHT		= 0x04,
			ST_BOTTOM		= 0x08};

public:

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CDigitST)
	//}}AFX_VIRTUAL

public:
	BOOL SetStyle(UINT nBitmapId, int nPrecision);

	void SetValue(int nValue, BOOL bRepaint = TRUE);
	int GetValue();

	void SetPrecision(int nPrecision, BOOL bResize = TRUE);
	int GetPrecision();

	void SetResize(DWORD dwResize, BOOL bResize = TRUE);
	DWORD GetResize();

	void SetZeroPadding(BOOL bPad = FALSE, BOOL bRepaint = TRUE);
	BOOL GetZeroPadding();

	void Inc(BOOL bRepaint = TRUE);
	void Dec(BOOL bRepaint = TRUE);

	static const char* GetVersionC();
	static const short GetVersionI();

protected:
	//{{AFX_MSG(CDigitST)
	afx_msg void OnPaint();
	//}}AFX_MSG

	DECLARE_MESSAGE_MAP()
private:
	void Resize();
	void PrepareString(char* szDest);
	void DrawDigits(CDC* pDC);

	CBitmap m_bmDigit;
	int m_nWidth;
	int m_nHeight;

	int m_nPrecision;
	int m_nValue;

	BOOL m_bZeroPadding;
	DWORD m_dwResize;
};

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

//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.

#endif

⌨️ 快捷键说明

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