UIFadeButton.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef __UIFADEBUTTON_H__
  2. #define __UIFADEBUTTON_H__
  3. #include "UIAnimation.h"
  4. #pragma once
  5. namespace DuiLib {
  6. class UILIB_API CFadeButtonUI : public CButtonUI, public CUIAnimation
  7. {
  8. DECLARE_DUICONTROL(CFadeButtonUI)
  9. public:
  10. CFadeButtonUI();
  11. virtual ~CFadeButtonUI();
  12. LPCTSTR GetClass() const;
  13. LPVOID GetInterface(LPCTSTR pstrName);
  14. void SetNormalImage(LPCTSTR pStrImage);
  15. void DoEvent(TEventUI& event);
  16. void OnTimer( int nTimerID );
  17. void PaintStatusImage(HDC hDC);
  18. virtual void OnAnimationStart(INT nAnimationID, BOOL bFirstLoop) {}
  19. virtual void OnAnimationStep(INT nTotalFrame, INT nCurFrame, INT nAnimationID);
  20. virtual void OnAnimationStop(INT nAnimationID) {}
  21. protected:
  22. CDuiString m_sOldImage;
  23. CDuiString m_sNewImage;
  24. CDuiString m_sLastImage;
  25. BYTE m_bFadeAlpha;
  26. BOOL m_bMouseHove;
  27. BOOL m_bMouseLeave;
  28. enum{
  29. FADE_IN_ID = 8,
  30. FADE_OUT_ID = 9,
  31. FADE_ELLAPSE = 10,
  32. FADE_FRAME_COUNT = 30,
  33. };
  34. };
  35. } // namespace DuiLib
  36. #endif // __UIFADEBUTTON_H__