UILabel.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. #ifndef __UILABEL_H__
  2. #define __UILABEL_H__
  3. #pragma once
  4. #include <GdiPlus.h>
  5. #pragma comment( lib, "GdiPlus.lib" )
  6. using namespace Gdiplus;
  7. class UILIB_API Gdiplus::RectF;
  8. struct UILIB_API Gdiplus::GdiplusStartupInput;
  9. namespace DuiLib
  10. {
  11. class UILIB_API CLabelUI : public CControlUI
  12. {
  13. public:
  14. CLabelUI();
  15. ~CLabelUI();
  16. LPCTSTR GetClass() const;
  17. LPVOID GetInterface(LPCTSTR pstrName);
  18. void SetText(LPCTSTR pstrText);
  19. void SetText (LPCSTR pstrText);
  20. void SetTextStyle(UINT uStyle);
  21. UINT GetTextStyle() const;
  22. void SetTextColor(DWORD dwTextColor);
  23. DWORD GetTextColor() const;
  24. void SetDisabledTextColor(DWORD dwTextColor);
  25. DWORD GetDisabledTextColor() const;
  26. void SetFont(int index);
  27. int GetFont() const;
  28. RECT GetTextPadding() const;
  29. void SetTextPadding(RECT rc);
  30. bool IsShowHtml();
  31. void SetShowHtml(bool bShowHtml = true);
  32. SIZE EstimateSize(SIZE szAvailable);
  33. void DoEvent(TEventUI& event);
  34. void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue);
  35. void PaintText(HDC hDC);
  36. void SetEnabledEffect(bool _EnabledEffect);
  37. bool GetEnabledEffect();
  38. void SetEnabledLuminous(bool bEnableLuminous);
  39. bool GetEnabledLuminous();
  40. void SetLuminousFuzzy(float fFuzzy);
  41. float GetLuminousFuzzy();
  42. void SetGradientLength(int _GradientLength);
  43. int GetGradientLength();
  44. void SetShadowOffset(int _offset,int _angle);
  45. RectF GetShadowOffset();
  46. void SetTextColor1(DWORD _TextColor1);
  47. DWORD GetTextColor1();
  48. void SetTextShadowColorA(DWORD _TextShadowColorA);
  49. DWORD GetTextShadowColorA();
  50. void SetTextShadowColorB(DWORD _TextShadowColorB);
  51. DWORD GetTextShadowColorB();
  52. void SetStrokeColor(DWORD _StrokeColor);
  53. DWORD GetStrokeColor();
  54. void SetGradientAngle(int _SetGradientAngle);
  55. int GetGradientAngle();
  56. void SetEnabledStroke(bool _EnabledStroke);
  57. bool GetEnabledStroke();
  58. void SetEnabledShadow(bool _EnabledShadowe);
  59. bool GetEnabledShadow();
  60. protected:
  61. LPWSTR m_pWideText;
  62. DWORD m_dwTextColor;
  63. DWORD m_dwDisabledTextColor;
  64. int m_iFont;
  65. UINT m_uTextStyle;
  66. RECT m_rcTextPadding;
  67. bool m_bShowHtml;
  68. float m_fLuminousFuzzy;
  69. int m_GradientLength;
  70. int m_GradientAngle;
  71. bool m_EnableEffect;
  72. bool m_bEnableLuminous;
  73. bool m_EnabledStroke;
  74. bool m_EnabledShadow;
  75. DWORD m_dwTextColor1;
  76. DWORD m_dwTextShadowColorA;
  77. DWORD m_dwTextShadowColorB;
  78. DWORD m_dwStrokeColor;
  79. RectF m_ShadowOffset;
  80. ULONG_PTR m_gdiplusToken;
  81. GdiplusStartupInput m_gdiplusStartupInput;
  82. };
  83. }
  84. #endif // __UILABEL_H__