/************************************************************************/ /* Copyright (C), 2016-2020, [IT], 保留所有权利; /* 模 块 名:; /* 描 述:; /* /* 版 本:[V]; /* 作 者:[IT]; /* 日 期:[8/19/2016]; /* /* /* 注 意:; /* /* 修改记录:[IT]; /* 修改日期:; /* 修改版本:; /* 修改内容:; /************************************************************************/ #ifndef __GFX_OUTBARCTRL_20160823__ #define __GFX_OUTBARCTRL_20160823__ #pragma once #include #include "EnBitmap.h" class CGfxOutBarCtrl : public CWnd { // Construction DECLARE_DYNCREATE(CGfxOutBarCtrl) public: CGfxOutBarCtrl(); public: CEnBitmap m_bmpNormalFolder; CEnBitmap m_bmpHoverFolder; COLORREF m_crBackground; // 图片高度; UINT m_nFolderHeight; // 鼠标位置; CPoint m_curpoint; COLORREF m_crText; CFont *m_pFont; HCURSOR hHandCursor; int iLastFolderHighlighted; int iHoverFolder; // 当前选中的项; int m_nCurSelFolder; HICON iSelcon; CPtrArray m_arFolder; class CBm_arFolder { public: CBm_arFolder(const TCHAR * name, DWORD exData); virtual ~CBm_arFolder(); TCHAR * cName; DWORD dwData; CWnd * pChild; }; public: enum { htNothing = -1, htFolder,htFind}; public: void SetAutoFolder(IN const DWORD& dwTime); DWORD GetFolderData(int iFolder = -1); CWnd * GetFolderChild(int iFolder = -1); int AddFolderBar(const TCHAR * pFolder, CWnd * pSon, const DWORD exData = 0); void HighlightFolder(const int index); void SetFolderText(const int index, const TCHAR * text); void SetFolderImage(LPCTSTR lpszPath); void SetSelIcon(LPCTSTR lpszIconPath); void RemoveFolder(const int index); int GetSelFolder() const; int GetFolderCount() const; void SetSelFolder(const int index); int HitTestEx(const CPoint &point, int &index); void GetInsideRect(CRect &rect) const; int AddFolder(const TCHAR * cFolderName, const DWORD exData); bool GetFolderRect(const int nIndex, CRect &rect) const; bool PtInFolderHeadRect(CPoint pt) const; BOOL Create(DWORD dwStyle, const RECT& rect, CWnd * pParentWnd, UINT nID); void SetFolderHeight(UINT nHeight){m_nFolderHeight = nHeight;}; virtual ~CGfxOutBarCtrl(); // Generated message map functions protected: void DrawFolder(CDC * pDC, const int iIdx, CRect rect); //{{AFX_MSG(CGfxOutBarCtrl) afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); afx_msg void OnPaint(); afx_msg BOOL OnEraseBkgnd(CDC* pDC); afx_msg void OnLButtonDown(UINT nFlags, CPoint point); afx_msg void OnMouseMove(UINT nFlags, CPoint point); afx_msg void OnTimer(UINT_PTR nIDEvent); afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message); afx_msg void OnSize(UINT nType, int cx, int cy); //}}AFX_MSG DECLARE_MESSAGE_MAP() public: afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt); }; #endif // __GFX_OUTBARCTRL_20160823__