00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #if !defined(AFX_CTRLWNDTABBAR_H__879DC787_89B3_41D4_A23E_0D690E04D000__INCLUDED_)
00023 #define AFX_CTRLWNDTABBAR_H__879DC787_89B3_41D4_A23E_0D690E04D000__INCLUDED_
00024
00025 #pragma once
00026
00027 class CChildWnd;
00028
00029
00030 class CWndTabBar : public CControlBar
00031 {
00032
00033 public:
00034 CWndTabBar();
00035 virtual ~CWndTabBar();
00036
00037 friend class CWindowManager;
00038
00039 public:
00040 class TabItem
00041 {
00042
00043 public:
00044 TabItem(CChildWnd* pWnd, DWORD nCookie, LPCTSTR pszCaption);
00045 virtual ~TabItem();
00046
00047
00048 public:
00049 HWND m_hWnd;
00050 CRuntimeClass* m_pClass;
00051 int m_nImage;
00052 public:
00053 CString m_sCaption;
00054 BOOL m_bVisible;
00055 BOOL m_bAlert;
00056 DWORD m_nCookie;
00057
00058
00059 public:
00060 void Paint(CWndTabBar* pBar, CDC* pDC, CRect* pRect, BOOL bSelected, BOOL bHot, BOOL bTransparent);
00061
00062 };
00063
00064
00065 protected:
00066 CPtrList m_pItems;
00067 TabItem* m_pSelected;
00068 TabItem* m_pHot;
00069 DWORD m_nCookie;
00070 BOOL m_bTimer;
00071 BOOL m_bMenuGray;
00072 protected:
00073 CImageList m_pImages;
00074 CMapPtrToWord m_pIcons;
00075 int m_nCloseImage;
00076 CMenu m_mnuChild;
00077 protected:
00078 int m_nMaximumWidth;
00079 UINT m_nMessage;
00080 CString m_sMessage;
00081 CRect m_rcMessage;
00082 CBitmap m_bmImage;
00083
00084
00085 public:
00086 void SetMaximumWidth(int nWidth);
00087 void SetMessage(UINT nMessageID);
00088 void SetMessage(LPCTSTR pszText);
00089 void SetWatermark(HBITMAP hBitmap);
00090 protected:
00091 TabItem* HitTest(const CPoint& point, CRect* pItemRect = NULL) const;
00092 int ImageIndexForWindow(CWnd* pChild);
00093
00094
00095 public:
00096
00097 virtual BOOL Create(CWnd* pParentWnd, DWORD dwStyle = WS_CHILD|WS_VISIBLE|CBRS_BOTTOM, UINT nID = AFX_IDW_STATUS_BAR);
00098 virtual CSize CalcFixedLayout(BOOL bStretch, BOOL bHorz);
00099 virtual int OnToolHitTest(CPoint point, TOOLINFO* pTI) const;
00100 virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler);
00101 virtual void DoPaint(CDC* pDC);
00102
00103
00104
00105 protected:
00106
00107 afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
00108 afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
00109 afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
00110 afx_msg void OnMouseMove(UINT nFlags, CPoint point);
00111 afx_msg void OnTimer(UINT nIDEvent);
00112 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00113 afx_msg void OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct);
00114 afx_msg void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct);
00115 afx_msg void OnMButtonUp(UINT nFlags, CPoint point);
00116 afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
00117 afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
00118
00119
00120 DECLARE_MESSAGE_MAP()
00121
00122 friend class TabItem;
00123 };
00124
00125
00126
00127 #endif