www.pudn.com > NewFlash.rar > xSkinButton.h


#if !defined(AFX_MYB_H__3832DDEF_0C12_11D5_B6BE_00E07D8144D0__INCLUDED_) 
#define AFX_MYB_H__3832DDEF_0C12_11D5_B6BE_00E07D8144D0__INCLUDED_ 
 
#if _MSC_VER > 1000 
#pragma once 
#endif // _MSC_VER > 1000 
// CxSkinButton.h : header file 
/** 15/03/2001 v1.00 
 * ing.davide.pizzolato@libero.it 
 ** 29/03/2001 v1.10 
 * Milan.Gardian@LEIBINGER.com 
 * - mouse tracking 
 ** 02/04/2001 v1.20 
 * ing.davide.pizzolato@libero.it 
 * - new CreateRgnFromBitmap 
 ** 14/04/2001 v1.21 
 * - OnMouseLeave cast fixed 
 * - Over bitmap consistency check 
 ** 25/04/2001 v1.30 
 * Fable@aramszu.net 
 * - ExtCreateRegion replacement 
 ** 24/06/2001 v1.40 
 * - check & radio button add on 
 * - added "focus" bitmap 
 * - fixed CreateRgnFromBitmap bug 
 * - fixed shortcut bug 
 ** 27/10/2001 v1.41 
 * - fixed memory leakage in CreateRgnFromBitmap 
 */ 
 
#define WM_CXSHADE_RADIO WM_USER+0x100 
///////////////////////////////////////////////////////////////////////////// 
// CxSkinButton window 
//##ModelId=4181E950005D 
class CxSkinButton : public CButton 
{ 
// Construction 
public: 
	//##ModelId=4181E950008C 
	CxSkinButton(); 
 
// Attributes 
private: 
	HCURSOR m_hCursor; 
 
// Operations 
public: 
// Overrides 
	// ClassWizard generated virtual function overrides 
	//{{AFX_VIRTUAL(CxSkinButton) 
	public: 
	//##ModelId=4181E950009C 
	virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct); 
	protected: 
	//##ModelId=4181E95000AD 
	virtual void PreSubclassWindow(); 
	//}}AFX_VIRTUAL 
// Implementation 
public: 
	BOOL SetBtnCursor(int nCursorId = NULL); 
	//##ModelId=4181E95000BB 
	void SetToolTipText(CString s); 
	//##ModelId=4181E95000BD 
	COLORREF SetTextColor(COLORREF new_color); 
	//##ModelId=4181E95000CC 
	void SetSkin(UINT normal,UINT down, UINT over=0, UINT disabled=0, UINT focus=0,UINT mask=0, 
				short drawmode=1,short border=1,short margin=4); 
	//##ModelId=4181E95000DF 
	virtual ~CxSkinButton(); 
	// Generated message map functions 
protected: 
	//##ModelId=4181E95000EA 
	bool	m_Checked;					//radio & check buttons 
	//##ModelId=4181E95000EB 
	DWORD	m_Style;					//radio & check buttons 
	//##ModelId=4181E95000FA 
    bool m_tracking; 
	//##ModelId=4181E95000FB 
    bool m_button_down; 
	//##ModelId=4181E95000FC 
	void RelayEvent(UINT message, WPARAM wParam, LPARAM lParam); 
	//##ModelId=4181E9500149 
	CToolTipCtrl m_tooltip; 
	CBitmap m_bNormal,m_bDown,m_bDisabled,m_bMask,m_bOver,m_bFocus; //skin bitmaps 
	//##ModelId=4181E9500177 
	short	m_FocusRectMargin;		//dotted margin offset 
	//##ModelId=4181E9500178 
	COLORREF m_TextColor;			//button text color 
	//##ModelId=4181E9500186 
	HRGN	hClipRgn;				//clipping region 
	//##ModelId=4181E9500187 
	BOOL	m_Border;				//0=flat; 1=3D; 
	//##ModelId=4181E9500196 
	short	m_DrawMode;				//0=normal; 1=stretch; 2=tiled; 
	//##ModelId=4181E9500197 
	HRGN	CreateRgnFromBitmap(HBITMAP hBmp, COLORREF color); 
	//##ModelId=4181E95001A7 
	void	FillWithBitmap(CDC* dc, HBITMAP hbmp, RECT r); 
	//##ModelId=4181E95001B8 
	void	DrawBitmap(CDC* dc, HBITMAP hbmp, RECT r, int DrawMode); 
	//##ModelId=4181E95001D4 
	int		GetBitmapWidth (HBITMAP hBitmap); 
	//##ModelId=4181E95001E4 
	int		GetBitmapHeight (HBITMAP hBitmap); 
	//{{AFX_MSG(CxSkinButton) 
	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 void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); 
	afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message); 
	afx_msg BOOL OnClicked() ; 
	//}}AFX_MSG 
	//##ModelId=4181E9500245 
	afx_msg LRESULT OnMouseLeave(WPARAM, LPARAM); 
	//##ModelId=4181E9500254 
	afx_msg LRESULT OnRadioInfo(WPARAM, LPARAM); 
	//##ModelId=4181E9500262 
	afx_msg LRESULT OnBMSetCheck(WPARAM, LPARAM); 
	//##ModelId=4181E9500271 
	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_MYB_H__3832DDEF_0C12_11D5_B6BE_00E07D8144D0__INCLUDED_)