SkinTab.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /************************************************************************
  2. * 程序名: 精仿QQ主界面
  3. * 制作人: 李克平, 2011年04月11日
  4. * 版本号: 1.0
  5. ************************************************************************/
  6. #if !defined(AFX_BMPTAB_H__7DCB7FED_B1D0_46B0_852D_9E7B6F93D59B__INCLUDED_)
  7. #define AFX_BMPTAB_H__7DCB7FED_B1D0_46B0_852D_9E7B6F93D59B__INCLUDED_
  8. #if _MSC_VER > 1000
  9. #pragma once
  10. #endif // _MSC_VER > 1000
  11. // BmpTab.h : header file
  12. //
  13. /////////////////////////////////////////////////////////////////////////////
  14. // CSkinTab window
  15. #include <afxtempl.h>
  16. #include <afxcoll.h>
  17. #include "EnBitmap.h"
  18. class CSkinTab : public CStatic
  19. {
  20. // Construction
  21. public:
  22. CSkinTab();
  23. public:
  24. typedef struct tabitem
  25. {
  26. int nIndex;
  27. HICON icon;
  28. void *pVoid;
  29. }TABITEM,*PTABITEM;
  30. // Attributes
  31. public:
  32. // Operations
  33. public:
  34. CDC m_memDC;
  35. CPtrArray m_aryItem;
  36. HICON m_hIconHand;
  37. BOOL m_bIsCDC;
  38. DWORD m_dwState;
  39. CEnBitmap m_bmpBG;
  40. CEnBitmap m_bmpNormal;
  41. CEnBitmap m_bmpHover;
  42. CEnBitmap m_bmpHdown;
  43. int m_iCurrentSelect;
  44. int m_iCurrentFouce;
  45. enum{
  46. HTNORMAL =0x0001,
  47. HTHOVER =0x0002,
  48. HTHDOWN =0x0003
  49. };
  50. // Overrides
  51. // ClassWizard generated virtual function overrides
  52. //{{AFX_VIRTUAL(CSkinTab)
  53. public:
  54. protected:
  55. virtual void PreSubclassWindow();
  56. //}}AFX_VIRTUAL
  57. // Implementation
  58. public:
  59. void GetTabItemRect(int nIndex,CRect *rc);
  60. void AddTabItem(TABITEM &item);
  61. void SetBmp(UINT nBmpNormal, UINT nBmpHover, UINT nBmpHdown);
  62. void SetSkin(CString strNormal, CString strHover, CString strDown);
  63. void SetSkin(CString strBmp);
  64. void SetSkinBG(CString strBmpBG);
  65. void SetIcon(int nIndex,UINT nIcon,void *pVoid);
  66. void SetIcon(int nIndex,LPCTSTR szIcon,void *pVoid);
  67. void AddTabItem(UINT nBmpNormal, UINT nBmpHover, UINT nBmpHdown, UINT nIcon, void *pVoid);
  68. virtual ~CSkinTab();
  69. int Width(){return 35;}
  70. int Heighth(){return m_aryItem.GetSize()*35;}
  71. // Generated message map functions
  72. protected:
  73. //{{AFX_MSG(CSkinTab)
  74. afx_msg void OnPaint();
  75. afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  76. afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  77. afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  78. afx_msg void OnTimer(UINT nIDEvent);
  79. afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
  80. //}}AFX_MSG
  81. DECLARE_MESSAGE_MAP()
  82. };
  83. /////////////////////////////////////////////////////////////////////////////
  84. //{{AFX_INSERT_LOCATION}}
  85. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  86. #endif // !defined(AFX_BMPTAB_H__7DCB7FED_B1D0_46B0_852D_9E7B6F93D59B__INCLUDED_)