📄 unibutton.h
字号:
#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
class CUniButton : public CButton
{
public:
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CUniButton)
public:
virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
protected:
virtual void PreSubclassWindow();
virtual LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam);
//}}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 void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
CBitmap * m_pNormal; // bitmaps to hold button images
CBitmap * m_pSelected;
CBitmap * m_pHover;
CBitmap * m_pDisabled;
CPoint m_CenterPoint; // button caption will be centered around this point
BOOL m_bHilighted;
BOOL m_bMouseDown; // indicated that mouse is pressed down
BOOL m_bHover; // indicates if mouse is over the button
BOOL m_bCapture; // indicates that mouse is captured in the buton
HRGN m_hRgn; // region in screen coordinates
void DrawButton(CDC * pDC, CRect * pRect, UINT state); // draws button to the screen
void CheckHover(CPoint point);
BOOL HitTest(CPoint point);
protected:
public:
void SetState( BOOL bHighlight );
CUniButton(); // constructor
virtual ~CUniButton(); // destructor
BOOL Create(LPCTSTR lpszCaption,
DWORD dwStyle,
const CPoint point, // Button Position. Left-Up
const HRGN hRgn,
CWnd* pParentWnd,
UINT nID, // Button Resource ID
UINT nIDBkNormal, // Button background bitmap resource ID(Normal Status)
UINT nIDBkPush, // Button background bitmap resource ID(Selected Status)
UINT nIDBkHover, // Button background bitmap resource ID(Hover Status)
UINT nIDBkDisable); // Button background bitmap resource ID(Disabled Status)
};
/////////////////////////////////////////////////////////////////////////////
//{{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_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -