mybutton.h

来自「其他人不需帐号就可自由下载此源码 实现了一个类似金山杀毒软件的界面」· C头文件 代码 · 共 69 行

H
69
字号
#if !defined(AFX_MYBUTTON_H__1B425AEB_661D_426C_998C_37C85EF445D5__INCLUDED_)
#define AFX_MYBUTTON_H__1B425AEB_661D_426C_998C_37C85EF445D5__INCLUDED_

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

/////////////////////////////////////////////////////////////////////////////
// CMyButton window

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


public:

	void SetSize(int nWidth, int nHeight);
	void SetBitmaps(UINT nNormal, UINT nSelect, UINT nFocuse);
	void DrawNormalState(CRect rc, CDC *pDC);
	void DrawSelectedState(CRect rc, CDC *pDC);
	void DrawFocusState(CRect rc, CDC *pDC);
	void DrawFace(CRect& rc, COLORREF clrTopRight, COLORREF clrBottomLeft,
			CDC* pDC);
	void DrawFrame(CRect& rc, COLORREF clrTopRight, COLORREF clrBottomLeft,
			CDC *pDC);
	
public:

	BOOL	m_bIsMouseMove;
	CBitmap m_bmNormal;
	CBitmap m_bmSelect;
	CBitmap m_bmFocuse;

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CMyButton)
	virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
	virtual void PreSubclassWindow();
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CMyButton();

	// Generated message map functions
protected:
	//{{AFX_MSG(CMyButton)
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg void OnClicked();
	//}}AFX_MSG
	afx_msg LRESULT OnMouseLeave(WPARAM wParam, LPARAM lParam);
	DECLARE_MESSAGE_MAP()
};

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

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

#endif // !defined(AFX_MYBUTTON_H__1B425AEB_661D_426C_998C_37C85EF445D5__INCLUDED_)

⌨️ 快捷键说明

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