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

📄 ccebutton.h

📁 WinCE 下实现Listctrl自画
💻 H
字号:
/////////////////////////////////////////////////////////////////////////////
// CCeButton window

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

// Attributes
public:
	CBitmap BkImage;//背景图
	CBitmap fImage;	//前景图1
	CBitmap eImage;	//前景图2
	CBrush	brush;	//画刷
	CBrush  brush1;
	CBrush  brush2;
	bool	m_change;//是否状态改变就更换图片
	bool	m_gray;//是否灰化
	bool	m_state;//当前状态,即是否使用第一张图片
	HMENU		m_hMenu;			// Handle to associated menu
	HWND		m_hParentWndMenu;	// Handle to window for menu selection
	BOOL		m_bMenuDisplayed;	// Is menu displayed ?
	CString m_text;
	COLORREF m_TextColor;
	//矩形左上角坐标
	BOOL m_transparent;
// Operations
public:
	DWORD SetMenu(UINT nMenu, HWND hParentWnd, BOOL bRepaint = TRUE);
	virtual void SetTransparent(bool tran);
	virtual void SetState(bool state);
    virtual void SetText(CString text);
    virtual void SetTextColor(COLORREF	TextColor);
	/*void			SetTextColor(COLORREF TextColor = RGB(0,0,0));
	BOOL			FontStyle(CString sFont = "MS Sans Serif",  int iHeight = 10, int iWidth = 6, BOOL bFont3D = FALSE, BOOL bConcave = FALSE);
	inline void		HideText(BOOL bHide = TRUE) { m_bHideText = bHide; }
	void			PaintText(HDC h_clientDC, CRect rect);*/

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(UniButton)
	virtual void SetImage(int BkID,int fID,int eID,bool change=true);
	virtual void SetGray(bool gray);
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CCeButton();

	// Generated message map functions
protected:
/*	CFont		m_Font;
	BOOL		m_bFontCreated;
	BOOL		m_bFont3D;
	BOOL		m_bConcave;
	BOOL		m_bHideText;
	COLORREF	m_TextColor;*/
	//{{AFX_MSG(UniButton)
	afx_msg void OnPaint();
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg BOOL OnClicked();
	//}}AFX_MSG

	DECLARE_MESSAGE_MAP()
};

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

⌨️ 快捷键说明

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