GfxOutBarCtrl.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /************************************************************************
  2. * 程序名: 精仿QQ主界面
  3. * 制作人: 李克平, 2011年04月11日
  4. * 版本号: 1.0
  5. ************************************************************************/
  6. #if !defined(AFX_GFXOUTBARCTRL_H__28FA2CA4_11B7_11D2_8437_0000B43382FE__INCLUDED_)
  7. #define AFX_GFXOUTBARCTRL_H__28FA2CA4_11B7_11D2_8437_0000B43382FE__INCLUDED_
  8. #if _MSC_VER >= 1000
  9. #pragma once
  10. #endif // _MSC_VER >= 1000
  11. // GfxOutBarCtrl.h : header file
  12. //
  13. /////////////////////////////////////////////////////////////////////////////
  14. // CGfxOutBarCtrl window
  15. #include <afxcoll.h>
  16. #include "EnBitmap.h"
  17. class CGfxOutBarCtrl : public CWnd
  18. {
  19. // Construction
  20. DECLARE_DYNCREATE(CGfxOutBarCtrl)
  21. public:
  22. CGfxOutBarCtrl();
  23. // Attributes
  24. public:
  25. CEnBitmap m_bmpNormalFolder;
  26. CEnBitmap m_bmpHoverFolder;
  27. COLORREF m_crBackground;
  28. UINT nFolderHeight;
  29. COLORREF m_crText;
  30. CFont *m_pFont;
  31. HCURSOR hHandCursor;
  32. int iLastFolderHighlighted;
  33. int iHoverFolder;
  34. int iSelFolder;
  35. HICON iSelcon;
  36. CPtrArray m_arFolder;
  37. class CBm_arFolder
  38. {
  39. public:
  40. CBm_arFolder(const char * name, DWORD exData);
  41. virtual ~CBm_arFolder();
  42. char * cName;
  43. DWORD dwData;
  44. CWnd * pChild;
  45. };
  46. // Operations
  47. public:
  48. enum { htNothing = -1, htFolder,htFind};
  49. // Overrides
  50. // ClassWizard generated virtual function overrides
  51. //{{AFX_VIRTUAL(CGfxOutBarCtrl)
  52. //}}AFX_VIRTUAL
  53. // Implementation
  54. public:
  55. DWORD GetFolderData(int iFolder = -1);
  56. CWnd * GetFolderChild(int iFolder = -1);
  57. int AddFolderBar(const char * pFolder, CWnd * pSon, const DWORD exData = 0);
  58. void HighlightFolder(const int index);
  59. void SetFolderText(const int index, const char * text);
  60. void SetFolderImage(LPCTSTR lpszPath);
  61. void SetSelIcon(LPCTSTR lpszIconPath);
  62. void RemoveFolder(const int index);
  63. int GetSelFolder() const;
  64. int GetFolderCount() const;
  65. void SetSelFolder(const int index);
  66. int HitTestEx(const CPoint &point, int &index);
  67. void GetInsideRect(CRect &rect) const;
  68. int AddFolder(const char * cFolderName, const DWORD exData);
  69. bool GetFolderRect(const int iIndex, CRect &rect) const;
  70. BOOL Create(DWORD dwStyle, const RECT& rect, CWnd * pParentWnd, UINT nID);
  71. void SetFolderHeight(UINT nHeight){nFolderHeight = nHeight;};
  72. virtual ~CGfxOutBarCtrl();
  73. // Generated message map functions
  74. protected:
  75. void DrawFolder(CDC * pDC, const int iIdx, CRect rect);
  76. //{{AFX_MSG(CGfxOutBarCtrl)
  77. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  78. afx_msg void OnPaint();
  79. afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  80. afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  81. afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  82. afx_msg void OnTimer(UINT_PTR nIDEvent);
  83. afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
  84. afx_msg void OnSize(UINT nType, int cx, int cy);
  85. //}}AFX_MSG
  86. DECLARE_MESSAGE_MAP()
  87. };
  88. /////////////////////////////////////////////////////////////////////////////
  89. //{{AFX_INSERT_LOCATION}}
  90. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  91. #endif // !defined(AFX_GFXOUTBARCTRL_H__28FA2CA4_11B7_11D2_8437_0000B43382FE__INCLUDED_)