skin.h

来自「菜单下加小图标示例,详细源代码」· C头文件 代码 · 共 95 行

H
95
字号
#if !defined(AFX_SKIN_H__77F69A75_C89B_4BBC_B709_973ECE8DA2B6__INCLUDED_)
#define AFX_SKIN_H__77F69A75_C89B_4BBC_B709_973ECE8DA2B6__INCLUDED_

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

// Skin.h : header file
//
#include <afxcmn.h>

#define WM_CXSHADE_RADIO WM_USER + 0x100
/////////////////////////////////////////////////////////////////////////////
// Skin window

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

	// Attributes
public:

	// Operations
public:

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

	// Implementation
public:
	//void SetToolTipText(CString s);
	//void SetToolTipText(int nText);
	COLORREF SetTextColor(COLORREF new_color);
	void SetSkin(UINT nBitmap, short drawmode = 0, short border = 0, short
		margin = 0, BOOL bMask = FALSE);

	virtual ~CSkin();

protected:
	bool m_Checked;     // radio & check buttons
	DWORD m_Style;      // radio & check buttons
	BOOL m_bMask;
	bool m_tracking;
	bool m_button_down;
	//void RelayEvent(UINT message, WPARAM wParam, LPARAM lParam);
	//CToolTipCtrl m_tooltip;
	CBitmap m_bImage;
	CSize m_ButtonSize;
	short m_FocusRectMargin;    // dotted margin offset
	COLORREF m_TextColor;       // button text color
	HRGN hClipRgn;              // clipping region
	BOOL m_Border;              // 0 = flat; 1 = 3D;
	short m_DrawMode;           // 0 = normal; 1 = stretch; 2 = tiled;
	HRGN CreateRgnFromBitmap(HBITMAP hBmp, COLORREF color);
	void FillWithBitmap(CDC *dc, HBITMAP hbmp, RECT r);
	void DrawBitmap(CDC *dc, int nState, RECT r, int DrawMode);
	int GetBitmapWidth(HBITMAP hBitmap);
	int GetBitmapHeight(HBITMAP hBitmap);

	// Generated message map functions
protected:
	//{{AFX_MSG(CSkin)
	afx_msg BOOL OnEraseBkgnd(CDC *pDC);
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
	afx_msg void OnKillFocus(CWnd *pNewWnd);
	afx_msg BOOL OnClicked();
	//afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
	//}}AFX_MSG
	afx_msg LRESULT OnMouseLeave(WPARAM, LPARAM);
	//afx_msg LRESULT OnRadioInfo(WPARAM, LPARAM);
	afx_msg LRESULT OnBMSetCheck(WPARAM, LPARAM);
	//afx_msg LRESULT OnBMGetCheck(WPARAM, LPARAM);

	DECLARE_MESSAGE_MAP()
};

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

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

#endif 
// !defined(AFX_SKIN_H__77F69A75_C89B_4BBC_B709_973ECE8DA2B6__INCLUDED_)

⌨️ 快捷键说明

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