?? unibutton.h
字號(hào):
#if !defined(AFX_UNIBUTTON_H__EBEB2EA0_A067_11D2_9E44_0020182F735A__INCLUDED_)
#define AFX_UNIBUTTON_H__EBEB2EA0_A067_11D2_9E44_0020182F735A__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
/////////////////////////////////////////////////////////////////////////////
// CUniButton window
//
// AUTHOR: Pavel A .Simakov
// DATE: 981226
// E-MAIL: psimakov@outplay.com
// ORGANIZATION: Outplay Consulting
// HTTP: www.outplay.com
// TERM OF USE: unlimited, must cite AUTHOR
// COPYRIHT: 1998 Outplay Consulting
//
/////////////////////////////////////////////////////////////////////////////
class CUniButton : public CButton
{
public:
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CUniButton)
public:
virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
protected:
virtual void PreSubclassWindow();
//}}AFX_VIRTUAL
protected:
//{{AFX_MSG(CUniButton)
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
UINT m_nBorder; // 3D高亮邊界的象素寬度 // orientation of the caption (in tenth of the degree as in LOGFONT)
COLORREF m_nColor, m_sColor, m_hColor, m_dColor; // 對(duì)normal/selected/hover/disabled不同狀態(tài)的背景色
CBitmap * m_pNormal; // 按鈕不同狀態(tài)下對(duì)應(yīng)的位圖
CPoint m_CenterPoint; // 按鈕的中心點(diǎn)--繪制標(biāo)題用
BOOL m_bHover; // 鼠標(biāo)在按鈕上
HRGN m_hRgn; // region in screen coordinates
BOOL bSunken;
BOOL m_bTracking; //在鼠標(biāo)按下沒有釋放時(shí)該值為true
BOOL m_bCapture;
CFont m_Font;
void FrameRgn3D(HDC hDC, const HRGN hRgn, BOOL bSunken);// frames region to show 3D shadows
protected:
public:
BOOL HitTest(CPoint point);
CUniButton(); // constructor
virtual ~CUniButton(); // destructor
// constructor with default colors and border
// constructor with hover & selected color specified
BOOL Create(LPCTSTR lpszCaption, DWORD dwStyle, const CPoint point, const HRGN hRgn, CWnd* pParentWnd, UINT nID, UINT nBorder, COLORREF nColor, COLORREF sColor, COLORREF hColor, COLORREF dColor);
// complex parameters constructor
// lpszCaption - window caption
// dwStyle - window styles
// point - position of the button on the parent window (in parent coordinates)
// hRgn - handle to region which represents the button (in button client coordinates)
// pParentWnd - handle to parent window
// nID - control Id
// nBorder - specifies width of the border in pixels for 3D highlight (allowed values are 1, 2)
// nColor - normal color
// sColor - selected color
// hColor - hover color
// dColor - disabled color
// variation of above
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_UNIBUTTON_H__EBEB2EA0_A067_11D2_9E44_0020182F735A__INCLUDED_)
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -