UIButton.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #ifndef __UIBUTTON_H__
  2. #define __UIBUTTON_H__
  3. #pragma once
  4. namespace DuiLib
  5. {
  6. class UILIB_API CButtonUI : public CLabelUI
  7. {
  8. public:
  9. CButtonUI();
  10. LPCTSTR GetClass() const;
  11. LPVOID GetInterface(LPCTSTR pstrName);
  12. UINT GetControlFlags() const;
  13. bool Activate();
  14. void SetEnabled(bool bEnable = true);
  15. void DoEvent(TEventUI& event);
  16. LPCTSTR GetNormalImage();
  17. void SetNormalImage(LPCTSTR pStrImage);
  18. LPCTSTR GetHotImage();
  19. void SetHotImage(LPCTSTR pStrImage);
  20. LPCTSTR GetPushedImage();
  21. void SetPushedImage(LPCTSTR pStrImage);
  22. LPCTSTR GetFocusedImage();
  23. void SetFocusedImage(LPCTSTR pStrImage);
  24. LPCTSTR GetDisabledImage();
  25. void SetDisabledImage(LPCTSTR pStrImage);
  26. LPCTSTR GetForeImage();
  27. void SetForeImage(LPCTSTR pStrImage);
  28. LPCTSTR GetHotForeImage();
  29. void SetHotForeImage(LPCTSTR pStrImage);
  30. // śÔÓŚ°´ĹĽľÄ5¸ö×´ĚŹÍź
  31. void SetFiveStatusImage(LPCTSTR pStrImage);
  32. void SetFadeAlphaDelta(BYTE uDelta);
  33. byte GetFadeAlphaDelta();
  34. void SetHotBkColor(DWORD dwColor);
  35. DWORD GetHotBkColor() const;
  36. void SetHotTextColor(DWORD dwColor);
  37. DWORD GetHotTextColor() const;
  38. void SetPushedTextColor(DWORD dwColor);
  39. DWORD GetPushedTextColor() const;
  40. void SetFocusedTextColor(DWORD dwColor);
  41. DWORD GetFocusedTextColor() const;
  42. SIZE EstimateSize(SIZE szAvailable);
  43. void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue);
  44. void PaintText(HDC hDC);
  45. void PaintStatusImage(HDC hDC);
  46. protected:
  47. enum
  48. {
  49. FADE_TIMERID = 11,
  50. FADE_ELLAPSE = 30,
  51. };
  52. UINT m_uButtonState;
  53. DWORD m_dwHotBkColor;
  54. DWORD m_dwHotTextColor;
  55. DWORD m_dwPushedTextColor;
  56. DWORD m_dwFocusedTextColor;
  57. BYTE m_uFadeAlpha;
  58. BYTE m_uFadeAlphaDelta;
  59. TDrawInfo m_diNormal;
  60. TDrawInfo m_diHot;
  61. TDrawInfo m_diHotFore;
  62. TDrawInfo m_diPushed;
  63. TDrawInfo m_diPushedFore;
  64. TDrawInfo m_diFocused;
  65. TDrawInfo m_diDisabled;
  66. };
  67. } // namespace DuiLib
  68. #endif // __UIBUTTON_H__