UIOption.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. #ifndef __UIOPTION_H__
  2. #define __UIOPTION_H__
  3. #pragma once
  4. namespace DuiLib
  5. {
  6. class UILIB_API COptionUI : public CButtonUI
  7. {
  8. DECLARE_DUICONTROL(COptionUI)
  9. public:
  10. COptionUI();
  11. virtual ~COptionUI();
  12. LPCTSTR GetClass() const;
  13. LPVOID GetInterface(LPCTSTR pstrName);
  14. void SetManager(CPaintManagerUI* pManager, CControlUI* pParent, bool bInit = true);
  15. bool Activate();
  16. LPCTSTR GetSelectedImage();
  17. void SetSelectedImage(LPCTSTR pStrImage);
  18. LPCTSTR GetSelectedHotImage();
  19. void SetSelectedHotImage(LPCTSTR pStrImage);
  20. LPCTSTR GetSelectedPushedImage();
  21. void SetSelectedPushedImage(LPCTSTR pStrImage);
  22. void SetSelectedTextColor(DWORD dwTextColor);
  23. DWORD GetSelectedTextColor();
  24. void SetSelectedBkColor(DWORD dwBkColor);
  25. DWORD GetSelectBkColor();
  26. LPCTSTR GetSelectedForedImage();
  27. void SetSelectedForedImage(LPCTSTR pStrImage);
  28. void SetSelectedStateCount(int nCount);
  29. int GetSelectedStateCount() const;
  30. virtual LPCTSTR GetSelectedStateImage();
  31. virtual void SetSelectedStateImage(LPCTSTR pStrImage);
  32. void SetSelectedFont(int index);
  33. int GetSelectedFont() const;
  34. LPCTSTR GetGroup() const;
  35. void SetGroup(LPCTSTR pStrGroupName = NULL);
  36. LPCTSTR GetGroupType() const;
  37. void SetGroupType(LPCTSTR pStrGroupType = NULL);
  38. bool IsSelected() const;
  39. virtual void Selected(bool bSelected, bool bMsg = true);
  40. void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue);
  41. void PaintBkColor(HDC hDC);
  42. void PaintStatusImage(HDC hDC);
  43. void PaintForeImage(HDC hDC);
  44. void PaintText(HDC hDC);
  45. protected:
  46. bool m_bSelected;
  47. CDuiString m_sGroupName;
  48. CDuiString m_sGroupType;
  49. int m_iSelectedFont;
  50. DWORD m_dwSelectedBkColor;
  51. DWORD m_dwSelectedTextColor;
  52. CDuiString m_sSelectedImage;
  53. CDuiString m_sSelectedHotImage;
  54. CDuiString m_sSelectedPushedImage;
  55. CDuiString m_sSelectedForeImage;
  56. int m_nSelectedStateCount;
  57. CDuiString m_sSelectedStateImage;
  58. };
  59. class UILIB_API CCheckBoxUI : public COptionUI
  60. {
  61. DECLARE_DUICONTROL(CCheckBoxUI)
  62. public:
  63. CCheckBoxUI();
  64. public:
  65. virtual LPCTSTR GetClass() const;
  66. virtual LPVOID GetInterface(LPCTSTR pstrName);
  67. void SetCheck(bool bCheck);
  68. bool GetCheck() const;
  69. public:
  70. virtual void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue);
  71. void SetAutoCheck(bool bEnable);
  72. virtual void DoEvent(TEventUI& event);
  73. virtual void Selected(bool bSelected, bool bMsg = true);
  74. protected:
  75. bool m_bAutoCheck;
  76. };
  77. } // namespace DuiLib
  78. #endif // __UIOPTION_H__