uibutton.h

来自「开发环境为EVC++,这个是一个我的一个简单的拨号程序,是通过串口接的GPRS模」· C头文件 代码 · 共 103 行

H
103
字号
#ifndef _UIBUTTON_H
#define _UIBUTTON_H

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

//*********************************************************

//*********************************************************
// the align of the icon
#define AL_LEFT     0
#define AL_TOP      1
// the state to draw
#define ST_MOVEIN    0
#define ST_MOVEOUT   1
#define ST_MOUSEUP   2
#define ST_MOUSEDOWN 3
/////////////////////////////////////////////////////////////////////////////
// CUIButton window

class CUIButton : public CButton
{
// Construction
public:
	CUIButton();

// Attributes
public:

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CUIButton)
	public:
	virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
	protected:
	virtual void PreSubclassWindow();
	//}}AFX_VIRTUAL

// Implementation
public:
	void SetIcon(UINT  nNormal,UINT nMouseIn);
	BOOL SetCursor(UINT nCursorID);
	void SetStyle(bool bIsflat=FALSE);
	void SetBkMode(bool bTransparent);
	void SetMouseDownTextColor(COLORREF color);
	void SetNormalTextColor(COLORREF color);
	void SetActiveTextColor(COLORREF color);
	void SetIconYPos(int y);
	void SetAlign(int nAlign);
	void SetIconXPos(int x);
	void Draw();
	void DrawIcon(HICON hIcon,BOOL bDisabled=FALSE);
	void DrawIcon();
	void SetIcon(HICON  hNormal,HICON hMouseIn);
	void DrawText();
	void Refresh();
	CDC memDC;
	bool m_bDCStored;
	bool m_bMove;
	void DrawBorders();
	virtual ~CUIButton();

	// Generated message map functions
protected:
	bool m_bIsEnabled;
	HCURSOR m_hCursor;
	bool m_bHasFocus;
	bool m_bIsFlat;
	bool m_bBkTransparent;
	COLORREF m_clText;
	COLORREF m_clMouseDownText;
	COLORREF m_clActiveText;
	COLORREF m_clNormalText;
	bool m_bUseIcon;
	int m_IconYPos;
	int m_IconXPos;
	int m_DrawState;
	int m_IconAlign;
	HICON m_hMouseInIcon;
	HICON m_hNormalIcon;
	//{{AFX_MSG(CUIButton)
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
	//}}AFX_MSG

	DECLARE_MESSAGE_MAP()
};

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

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

#endif

⌨️ 快捷键说明

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