UIColorPalette.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #ifndef UI_PALLET_H
  2. #define UI_PALLET_H
  3. #pragma once
  4. namespace DuiLib {
  5. /////////////////////////////////////////////////////////////////////////////////////
  6. //
  7. class UILIB_API CColorPaletteUI : public CControlUI
  8. {
  9. DECLARE_DUICONTROL(CColorPaletteUI)
  10. public:
  11. CColorPaletteUI();
  12. virtual ~CColorPaletteUI();
  13. //获取最终被选择的颜色,可以直接用于设置duilib背景色
  14. DWORD GetSelectColor();
  15. void SetSelectColor(DWORD dwColor);
  16. virtual LPCTSTR GetClass() const;
  17. virtual LPVOID GetInterface(LPCTSTR pstrName);
  18. virtual void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue);
  19. //设置/获取 Pallet(调色板主界面)的高度
  20. void SetPalletHeight(int nHeight);
  21. int GetPalletHeight() const;
  22. //设置/获取 下方Bar(亮度选择栏)的高度
  23. void SetBarHeight(int nHeight);
  24. int GetBarHeight() const;
  25. //设置/获取 选择图标的路径
  26. void SetThumbImage(LPCTSTR pszImage);
  27. LPCTSTR GetThumbImage() const;
  28. virtual void SetPos(RECT rc, bool bNeedInvalidate = true);
  29. virtual void DoInit();
  30. virtual void DoEvent(TEventUI& event);
  31. virtual void PaintBkColor(HDC hDC);
  32. virtual void PaintPallet(HDC hDC);
  33. protected:
  34. //更新数据
  35. void UpdatePalletData();
  36. void UpdateBarData();
  37. private:
  38. HDC m_MemDc;
  39. HBITMAP m_hMemBitmap;
  40. BITMAP m_bmInfo;
  41. BYTE *m_pBits;
  42. UINT m_uButtonState;
  43. bool m_bIsInBar;
  44. bool m_bIsInPallet;
  45. int m_nCurH;
  46. int m_nCurS;
  47. int m_nCurB;
  48. int m_nPalletHeight;
  49. int m_nBarHeight;
  50. CDuiPoint m_ptLastPalletMouse;
  51. CDuiPoint m_ptLastBarMouse;
  52. CDuiString m_strThumbImage;
  53. };
  54. }
  55. #endif // UI_PALLET_H