00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #pragma once
00023
00024 class CSkinWindow;
00025
00026
00027 class CMainTabBarCtrl : public CControlBar
00028 {
00029
00030 public:
00031 CMainTabBarCtrl();
00032 virtual ~CMainTabBarCtrl();
00033
00034 DECLARE_DYNAMIC(CMainTabBarCtrl)
00035
00036
00037 public:
00038 class TabItem : public CCmdUI
00039 {
00040 public:
00041 CMainTabBarCtrl* m_pCtrl;
00042 CString m_sName;
00043 CRect m_rc;
00044 CRect m_rcSrc[5];
00045 BOOL m_bEnabled;
00046 BOOL m_bSelected;
00047
00048 public:
00049 TabItem(CMainTabBarCtrl* pCtrl, LPCTSTR pszName);
00050 void Skin(CSkinWindow* pSkin, CDC* pdcCache, CBitmap* pbmCache);
00051 BOOL Update(CFrameWnd* pTarget);
00052 BOOL HitTest(const CPoint& point) const;
00053 void Paint(CDC* pDstDC, CDC* pSrcDC, const CPoint& ptOffset, BOOL bHover, BOOL bDown);
00054 public:
00055 virtual void Enable(BOOL bEnable);
00056 virtual void SetCheck(BOOL bCheck);
00057 };
00058
00059
00060 protected:
00061 CPtrList m_pItems;
00062 CSkinWindow* m_pSkin;
00063 TabItem* m_pHover;
00064 TabItem* m_pDown;
00065 protected:
00066 CDC m_dcSkin;
00067 CBitmap m_bmSkin;
00068 HBITMAP m_hOldSkin;
00069
00070
00071 public:
00072 BOOL Create(CWnd* pParentWnd, DWORD dwStyle, UINT nID);
00073 BOOL HasLocalVersion();
00074 void OnSkinChange();
00075 virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler);
00076 virtual CSize CalcFixedLayout(BOOL bStretch, BOOL bHorz);
00077 TabItem* HitTest(const CPoint& point) const;
00078 virtual int OnToolHitTest(CPoint point, TOOLINFO* pTI) const;
00079 virtual void DoPaint(CDC* pDC);
00080
00081
00082 protected:
00083 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00084 afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
00085 afx_msg void OnMouseMove(UINT nFlags, CPoint point);
00086 afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
00087 afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
00088 afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
00089 afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
00090 afx_msg void OnTimer(UINT nIDEvent);
00091
00092 DECLARE_MESSAGE_MAP()
00093 };