jnbmpbutton.h

来自「此次上传的使linux下的文件传输协议」· C头文件 代码 · 共 98 行

H
98
字号
#if !defined(AFX_JNBMPBUTTON_H__89B4CC60_9939_11D4_8126_0000E8235359__INCLUDED_)
#define AFX_JNBMPBUTTON_H__89B4CC60_9939_11D4_8126_0000E8235359__INCLUDED_

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

/////////////////////////////////////////////////////////////////////////////
// JnBmpButton window
#include "Dibitmap.h"
#include <afxadv.h>            // For CSharedFile
#include <afxole.h>            // For COleDataSource
#include <afxconv.h>           // For LPTSTR -> LPSTR macros
#define JNBITMAPBTN_CLASSNAME _T("JnBmpButtonCtrl")

class JnBmpButton : public CButton
{
// Construction
public:
	JnBmpButton();
// Attributes
public:
	BOOL SetBitmap(UINT nOut,UINT nIn,UINT nDown,UINT nFalse);
	BOOL SetBitmap(CString StrOut, CString StrIn, CString StrDown, CString StrFalse);
// Operations
public:
	CDIBitmap	m_bmpIn;     //没有获得焦点,鼠标进入的弹起图象
	CDIBitmap	m_bmpOut;    //失去焦点时的背景图象
	CDIBitmap	m_bmpDown;   //按下时的背景图象
	CDIBitmap	m_bmpFalse;  //不能用时候的图象
	CDIBitmap*	p_bmpIn;     //没有获得焦点,鼠标进入的弹起图象
	CDIBitmap*	p_bmpOut;    //失去焦点时的背景图象
	CDIBitmap*	p_bmpDown;   //按下时的背景图象
	CDIBitmap*	p_bmpFalse;  //不能用时候的图象
	int			m_nType;	 // 看上面的枚举内容

	void SetFontSize(int nSize);
	void SetFontName(const CString& strFont);
	CFont m_font;
	void ReconstructFont();
	LOGFONT m_lf;

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(JnBmpButton)
	public:
	virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	protected:
	virtual void PreSubclassWindow();
	//}}AFX_VIRTUAL

// Implementation
public:
	void SetText(CString str);
	BOOL bHS;  //确定这个按钮是横向文本还是纵向文本?
	void SetTextNormalColor(COLORREF color1);
	void Copy(JnBmpButton &buttonSet);
	BOOL CheckEnable();
	BOOL bEnableWnd;
	BOOL EnableWindow(BOOL bEnable=TRUE);
	COLORREF crActive;
	COLORREF crNormal;
	void SetTextColor(COLORREF color1,COLORREF color2);
	void SetText(CString &str);
	CString sTitle;
	BOOL m_bSetFocus;
	BOOL m_bMouseCaptured;
	void OnMouseEnter(UINT nFlags,CPoint point);
	void OnMouseLeave(UINT nFlags,CPoint point);
	int nMouseState;  //0:鼠标在外面;1:鼠标在上面;2:鼠标按下
	virtual ~JnBmpButton();

	// Generated message map functions
protected:
	//{{AFX_MSG(JnBmpButton)
	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 OnSetFocus(CWnd* pOldWnd);
	afx_msg void OnKillFocus(CWnd* pNewWnd);
	afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
	afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	//}}AFX_MSG

	DECLARE_MESSAGE_MAP()
};

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

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

#endif // !defined(AFX_JNBMPBUTTON_H__89B4CC60_9939_11D4_8126_0000E8235359__INCLUDED_)

⌨️ 快捷键说明

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