RTButton.h
上传用户:qhonly
上传日期:2013-06-10
资源大小:487k
文件大小:1k
源码类别:

界面编程

开发平台:

Visual C++

  1. #pragma once
  2. // CRTButton
  3. class CRTButton : public CButton
  4. {
  5. DECLARE_DYNAMIC(CRTButton)
  6. public:
  7. CRTButton();
  8. virtual ~CRTButton();
  9. typedef enum _tagDrawState
  10. {
  11. StateNormal = 0,
  12. StateDown = 1,
  13. StateFocus = 2,
  14. StateDisable = 3
  15. }DrawState;
  16. typedef enum _tagMouseState
  17. {
  18. MouseStateNormal = 0,
  19. MouseStateDown =1,
  20. MouseStateUp = 2
  21. }MouseState;
  22. protected:
  23. static CBitmap* m_ButtonBitmap[5];
  24. static UINT     m_ButtonDrawMode[5];
  25. static BOOL     m_IsEnableSkin;
  26. DrawState       m_ButtonState;
  27. MouseState      m_MouseState;
  28. public:
  29. static void SetButtonBitmap(CBitmap* ButtonBitmap[],UINT DrawMode[]);
  30. static void EnableSkin(BOOL IsEnable = TRUE);
  31. protected:
  32. DECLARE_MESSAGE_MAP()
  33. LRESULT OnRTLButtonDown(WPARAM wParam,LPARAM lParam);
  34. LRESULT OnRTLButtonUp(WPARAM wParam,LPARAM lParam);
  35. LRESULT OnRTMouseMove(WPARAM wParam,LPARAM lParam);
  36. LRESULT OnRTLButtonDBClick(WPARAM wParam,LPARAM lParam);
  37. LRESULT OnRTMouseLeave(WPARAM wParam,LPARAM lParam);
  38. void    RTDrawButton(CDC *pDC);
  39. public:
  40. afx_msg void OnPaint();
  41. protected:
  42. virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
  43. };