GfxOutBarCtrl.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /************************************************************************/
  2. /* Copyright (C), 2016-2020, [IT], 保留所有权利;
  3. /* 模 块 名:;
  4. /* 描 述:;
  5. /*
  6. /* 版 本:[V];
  7. /* 作 者:[IT];
  8. /* 日 期:[8/19/2016];
  9. /*
  10. /*
  11. /* 注 意:;
  12. /*
  13. /* 修改记录:[IT];
  14. /* 修改日期:;
  15. /* 修改版本:;
  16. /* 修改内容:;
  17. /************************************************************************/
  18. #ifndef __GFX_OUTBARCTRL_20160823__
  19. #define __GFX_OUTBARCTRL_20160823__
  20. #pragma once
  21. #include <afxcoll.h>
  22. #include "EnBitmap.h"
  23. class CGfxOutBarCtrl : public CWnd
  24. {
  25. // Construction
  26. DECLARE_DYNCREATE(CGfxOutBarCtrl)
  27. public:
  28. CGfxOutBarCtrl();
  29. public:
  30. CEnBitmap m_bmpNormalFolder;
  31. CEnBitmap m_bmpHoverFolder;
  32. COLORREF m_crBackground;
  33. // 图片高度;
  34. UINT m_nFolderHeight;
  35. // 鼠标位置;
  36. CPoint m_curpoint;
  37. COLORREF m_crText;
  38. CFont *m_pFont;
  39. HCURSOR hHandCursor;
  40. int iLastFolderHighlighted;
  41. int iHoverFolder;
  42. // 当前选中的项;
  43. int m_nCurSelFolder;
  44. HICON iSelcon;
  45. CPtrArray m_arFolder;
  46. class CBm_arFolder
  47. {
  48. public:
  49. CBm_arFolder(const TCHAR * name, DWORD exData);
  50. virtual ~CBm_arFolder();
  51. TCHAR * cName;
  52. DWORD dwData;
  53. CWnd * pChild;
  54. };
  55. public:
  56. enum { htNothing = -1, htFolder,htFind};
  57. public:
  58. void SetAutoFolder(IN const DWORD& dwTime);
  59. DWORD GetFolderData(int iFolder = -1);
  60. CWnd * GetFolderChild(int iFolder = -1);
  61. int AddFolderBar(const TCHAR * pFolder, CWnd * pSon, const DWORD exData = 0);
  62. void HighlightFolder(const int index);
  63. void SetFolderText(const int index, const TCHAR * text);
  64. void SetFolderImage(LPCTSTR lpszPath);
  65. void SetSelIcon(LPCTSTR lpszIconPath);
  66. void RemoveFolder(const int index);
  67. int GetSelFolder() const;
  68. int GetFolderCount() const;
  69. void SetSelFolder(const int index);
  70. int HitTestEx(const CPoint &point, int &index);
  71. void GetInsideRect(CRect &rect) const;
  72. int AddFolder(const TCHAR * cFolderName, const DWORD exData);
  73. bool GetFolderRect(const int nIndex, CRect &rect) const;
  74. bool PtInFolderHeadRect(CPoint pt) const;
  75. BOOL Create(DWORD dwStyle, const RECT& rect, CWnd * pParentWnd, UINT nID);
  76. void SetFolderHeight(UINT nHeight){m_nFolderHeight = nHeight;};
  77. virtual ~CGfxOutBarCtrl();
  78. // Generated message map functions
  79. protected:
  80. void DrawFolder(CDC * pDC, const int iIdx, CRect rect);
  81. //{{AFX_MSG(CGfxOutBarCtrl)
  82. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  83. afx_msg void OnPaint();
  84. afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  85. afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  86. afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  87. afx_msg void OnTimer(UINT_PTR nIDEvent);
  88. afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
  89. afx_msg void OnSize(UINT nType, int cx, int cy);
  90. //}}AFX_MSG
  91. DECLARE_MESSAGE_MAP()
  92. public:
  93. afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
  94. };
  95. #endif // __GFX_OUTBARCTRL_20160823__