UIRollText.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #ifndef __UITEXTSCROLLH__
  2. #define __UITEXTSCROLLH__
  3. #pragma once
  4. namespace DuiLib
  5. {
  6. #define ROLLTEXT_LEFT 0
  7. #define ROLLTEXT_RIGHT 1
  8. #define ROLLTEXT_UP 2
  9. #define ROLLTEXT_DOWN 3
  10. #define ROLLTEXT_TIMERID 20
  11. #define ROLLTEXT_TIMERID_SPAN 50U
  12. #define ROLLTEXT_ROLL_END 21
  13. #define ROLLTEXT_ROLL_END_SPAN 1000*6U
  14. class UILIB_API CRollTextUI : public CLabelUI
  15. {
  16. DECLARE_DUICONTROL(CRollTextUI)
  17. public:
  18. CRollTextUI(void);
  19. ~CRollTextUI(void);
  20. public:
  21. LPCTSTR GetClass() const;
  22. LPVOID GetInterface(LPCTSTR pstrName);
  23. public:
  24. virtual void PaintText(HDC hDC);
  25. virtual void DoEvent(TEventUI& event);
  26. virtual void SetPos(RECT rc);
  27. virtual void SetText(LPCTSTR pstrText);
  28. public:
  29. void BeginRoll(int nDirect = ROLLTEXT_RIGHT, LONG lTimeSpan = ROLLTEXT_TIMERID_SPAN, LONG lMaxTimeLimited = 60);
  30. void EndRoll();
  31. private:
  32. int m_nStep;
  33. int m_nScrollPos;
  34. BOOL m_bUseRoll;
  35. int m_nRollDirection;
  36. int m_nText_W_H;
  37. };
  38. } // namespace DuiLib
  39. #endif // __UITEXTSCROLLH__