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

📄 iconbutton.h

📁 一个完整的数字硬盘录像机系统软件
💻 H
字号:
#if !defined(AFX_ICONBUTTON_H__4C6DC786_0098_4852_99F5_87796C0C8057__INCLUDED_)
#define AFX_ICONBUTTON_H__4C6DC786_0098_4852_99F5_87796C0C8057__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// IconButton.h : header file
// Comment this if you don't want that CButtonST hilights itself
// also when the window is inactive (like happens in Internet Explorer)
#include "MemDC.h"
/////////////////////////////////////////////////////////////////////////////
// CIconButton window
class CImageObject;
class CIconButton : public CButton
{
// Construction
public:
	CIconButton();
	~CIconButton();
    enum {ST_ALIGN_HORIZ, ST_ALIGN_VERT};
// Attributes
private:
	CString     m_sCaption;
	CRect       m_rectSearch;
	int         m_nAlign;
	BOOL        m_bDrawBorder;
	BOOL        m_MouseOnButton;
	BOOL        m_bDrawFlatFocus;
	HCURSOR     m_hCursor;
	HICON       m_hIcon;
	BYTE        m_cyIcon;
	BYTE        m_cxIcon;
	COLORREF    m_crInactiveBg;
    COLORREF    m_crInactiveFg;
    COLORREF    m_crActiveBg;
    COLORREF    m_crActiveFg;
public:
   CImageObject*     m_pBKObject;
   CToolTipCtrl*     m_pToolTip;
// Operations
public:
	void        CreateTooltips();
private:
	void        DrawTheIcon(CDC* pDC, RECT* rcItem, CRect* captionRect, BOOL IsPressed, BOOL IsDisabled);
// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CIconButton)
	public:
	virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	protected:
	virtual void PreSubclassWindow();
	//}}AFX_VIRTUAL
// Implementation
public:
	BOOL           SetBtnCursor(int nCursorId = -1);
	void           SetDefaultActiveFgColor(BOOL bRepaint = FALSE);
	void           SetActiveFgColor(COLORREF crNew, BOOL bRepaint = FALSE);
	const COLORREF GetActiveFgColor();
	
	void           SetDefaultActiveBgColor(BOOL bRepaint = FALSE);
	void           SetActiveBgColor(COLORREF crNew, BOOL bRepaint = FALSE);
	const COLORREF GetActiveBgColor();
	void           SetDefaultInactiveFgColor(BOOL bRepaint = FALSE);
	void           SetInactiveFgColor(COLORREF crNew, BOOL bRepaint = FALSE);
	const COLORREF GetInactiveFgColor();
	void           SetDefaultInactiveBgColor(BOOL bRepaint = FALSE);
	void           SetInactiveBgColor(COLORREF crNew, BOOL bRepaint = FALSE);
	const COLORREF GetInactiveBgColor();
	void           SetAlign(int nAlign);
	int            GetAlign();
	void           DrawBorder(BOOL bEnable = TRUE);
	void           SetIcon(CString sCaption,CString sBKName,int nIconID);
	// Generated message map functions
protected:
	//{{AFX_MSG(CIconButton)
	afx_msg void OnCaptureChanged(CWnd *pWnd);
	afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
	afx_msg void OnKillFocus(CWnd* pNewWnd);
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	//}}AFX_MSG
	afx_msg BOOL OnToolTipNotify(UINT id, NMHDR *pNMH, LRESULT *pResult); 
	DECLARE_MESSAGE_MAP()
};

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

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

#endif // !defined(AFX_ICONBUTTON_H__4C6DC786_0098_4852_99F5_87796C0C8057__INCLUDED_)

⌨️ 快捷键说明

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