XPButton.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #if !defined(AFX_XPBUTTON_H__44CD5B2A_756E_4939_9261_E0034E0F2DEF__INCLUDED_)
  2. #define AFX_XPBUTTON_H__44CD5B2A_756E_4939_9261_E0034E0F2DEF__INCLUDED_
  3. #if _MSC_VER > 1000
  4. #pragma once
  5. #endif // _MSC_VER > 1000
  6. // XPButton.h : header file
  7. //
  8. /////////////////////////////////////////////////////////////////////////////
  9. // CXPButton window
  10. class CXPButton : public CButton
  11. {
  12. // Construction
  13. public:
  14. CXPButton();
  15. // Attributes
  16. protected:
  17. //按钮的外边框
  18. CPen m_BoundryPen;
  19. //鼠标指针置于按钮之上时按钮的内边框
  20. CPen m_InsideBoundryPenLeft;
  21. CPen m_InsideBoundryPenRight;
  22. CPen m_InsideBoundryPenTop;
  23. CPen m_InsideBoundryPenBottom;
  24. //按钮获得焦点时按钮的内边框
  25. CPen m_InsideBoundryPenLeftSel;
  26. CPen m_InsideBoundryPenRightSel;
  27. CPen m_InsideBoundryPenTopSel;
  28. CPen m_InsideBoundryPenBottomSel;
  29. //按钮的底色,包括有效和无效两种状态
  30. CBrush m_FillActive;
  31. CBrush m_FillInactive;
  32. //按钮的状态
  33. BOOL m_bOver; //鼠标位于按钮之上时该值为true,反之为flase
  34. BOOL m_bTracking; //在鼠标按下没有释放时该值为true
  35. BOOL m_bSelected; //按钮被按下是该值为true
  36. BOOL m_bFocus; //按钮为当前焦点所在时该值为true
  37. // Operations
  38. public:
  39. // Overrides
  40. // ClassWizard generated virtual function overrides
  41. //{{AFX_VIRTUAL(CXPButton)
  42. protected:
  43. virtual void PreSubclassWindow();
  44. //}}AFX_VIRTUAL
  45. // Implementation
  46. public:
  47. virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
  48. virtual void DoGradientFill(CDC *pDC, CRect* rect);
  49. virtual void DrawInsideBorder(CDC *pDC, CRect* rect);
  50. virtual ~CXPButton();
  51. // Generated message map functions
  52. protected:
  53. //{{AFX_MSG(CXPButton)
  54. afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  55. afx_msg LRESULT OnMouseLeave(WPARAM wParam, LPARAM lParam);
  56. afx_msg LRESULT OnMouseHover(WPARAM wParam, LPARAM lParam);
  57. //}}AFX_MSG
  58. DECLARE_MESSAGE_MAP()
  59. public:
  60. afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  61. afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  62. };
  63. /////////////////////////////////////////////////////////////////////////////
  64. //{{AFX_INSERT_LOCATION}}
  65. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  66. #endif // !defined(AFX_XPBUTTON_H__44CD5B2A_756E_4939_9261_E0034E0F2DEF__INCLUDED_)