SkinTab.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. #if !defined(AFX_BMPTAB_H__7DCB7FED_B1D0_46B0_852D_9E7B6F93D59B__INCLUDED_)
  19. #define AFX_BMPTAB_H__7DCB7FED_B1D0_46B0_852D_9E7B6F93D59B__INCLUDED_
  20. #if _MSC_VER > 1000
  21. #pragma once
  22. #endif // _MSC_VER > 1000
  23. // BmpTab.h : header file
  24. //
  25. /////////////////////////////////////////////////////////////////////////////
  26. // CSkinTab window
  27. #include <afxtempl.h>
  28. #include <afxcoll.h>
  29. #include "EnBitmap.h"
  30. class CSkinTab : public CStatic
  31. {
  32. // Construction
  33. public:
  34. CSkinTab();
  35. public:
  36. typedef struct tabitem
  37. {
  38. int nIndex;
  39. HICON icon;
  40. void *pVoid;
  41. }TABITEM,*PTABITEM;
  42. // Attributes
  43. public:
  44. // Operations
  45. public:
  46. CDC m_memDC;
  47. CPtrArray m_aryItem;
  48. HICON m_hIconHand;
  49. BOOL m_bIsCDC;
  50. DWORD m_dwState;
  51. CEnBitmap m_bmpBG;
  52. CEnBitmap m_bmpNormal;
  53. CEnBitmap m_bmpHover;
  54. CEnBitmap m_bmpHdown;
  55. int m_iCurrentSelect;
  56. int m_iCurrentFouce;
  57. enum{
  58. HTNORMAL =0x0001,
  59. HTHOVER =0x0002,
  60. HTHDOWN =0x0003
  61. };
  62. // Overrides
  63. // ClassWizard generated virtual function overrides
  64. //{{AFX_VIRTUAL(CSkinTab)
  65. public:
  66. protected:
  67. virtual void PreSubclassWindow();
  68. //}}AFX_VIRTUAL
  69. // Implementation
  70. public:
  71. void GetTabItemRect(int nIndex,CRect *rc);
  72. void AddTabItem(TABITEM &item);
  73. void SetBmp(UINT nBmpNormal, UINT nBmpHover, UINT nBmpHdown);
  74. void SetSkin(CString strNormal, CString strHover, CString strDown);
  75. void SetSkin(CString strBmp);
  76. void SetSkinBG(CString strBmpBG);
  77. void SetIcon(int nIndex,UINT nIcon,void *pVoid);
  78. void SetIcon(int nIndex,LPCTSTR szIcon,void *pVoid);
  79. void AddTabItem(UINT nBmpNormal, UINT nBmpHover, UINT nBmpHdown, UINT nIcon, void *pVoid);
  80. virtual ~CSkinTab();
  81. int Width(){return 35;}
  82. int Heighth(){return m_aryItem.GetSize()*35;}
  83. // Generated message map functions
  84. protected:
  85. //{{AFX_MSG(CSkinTab)
  86. afx_msg void OnPaint();
  87. afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  88. afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  89. afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  90. afx_msg void OnTimer(UINT nIDEvent);
  91. afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
  92. //}}AFX_MSG
  93. DECLARE_MESSAGE_MAP()
  94. };
  95. /////////////////////////////////////////////////////////////////////////////
  96. //{{AFX_INSERT_LOCATION}}
  97. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  98. #endif // !defined(AFX_BMPTAB_H__7DCB7FED_B1D0_46B0_852D_9E7B6F93D59B__INCLUDED_)