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 CDownloadGroup;
00025
00026
00027 class CDownloadTabBar : public CControlBar
00028 {
00029
00030 public:
00031 CDownloadTabBar();
00032 virtual ~CDownloadTabBar();
00033
00034
00035 public:
00036 class TabItem
00037 {
00038
00039 public:
00040 TabItem(CDownloadGroup* pGroup, int nCookie);
00041 virtual ~TabItem();
00042
00043
00044 public:
00045 CDownloadGroup* m_pGroup;
00046 CString m_sCaption;
00047 int m_nImage;
00048 CString m_sName;
00049 int m_nCount;
00050 BOOL m_bSelected;
00051
00052
00053 public:
00054 BOOL Update(int nCookie);
00055 BOOL Select(BOOL bSelect);
00056 void Paint(CDownloadTabBar* pBar, CDC* pDC, CRect* pRect, BOOL bHot, BOOL bTransparent);
00057 };
00058
00059
00060 protected:
00061 CPtrList m_pItems;
00062 TabItem* m_pHot;
00063 BOOL m_bTimer;
00064 BOOL m_bMenuGray;
00065 int m_nCookie;
00066 protected:
00067 int m_nMaximumWidth;
00068 UINT m_nMessage;
00069 CString m_sMessage;
00070 CBitmap m_bmImage;
00071
00072
00073 public:
00074 void SetWatermark(HBITMAP hBitmap);
00075 void Update(int nCookie);
00076 BOOL DropShowTarget(CPtrList* pList, const CPoint& ptScreen);
00077 BOOL DropObjects(CPtrList* pList, const CPoint& ptScreen);
00078 protected:
00079 void UpdateGroups(int nCookie);
00080 void UpdateStates(int nCookie);
00081 TabItem* HitTest(const CPoint& point, CRect* pItemRect = NULL) const;
00082 BOOL Select(TabItem* pHit);
00083 int GetSelectedCount(BOOL bDownloads = FALSE);
00084 TabItem* GetSelectedItem();
00085 CDownloadGroup* GetSelectedGroup();
00086 void GetSelectedDownloads(CPtrList* pDownloads);
00087 void NotifySelection();
00088
00089
00090 public:
00091 virtual BOOL Create(CWnd* pParentWnd, DWORD dwStyle = WS_CHILD|WS_VISIBLE|CBRS_BOTTOM, UINT nID = AFX_IDW_STATUS_BAR);
00092 virtual CSize CalcFixedLayout(BOOL bStretch, BOOL bHorz);
00093 virtual int OnToolHitTest(CPoint point, TOOLINFO* pTI) const;
00094 virtual void DoPaint(CDC* pDC);
00095 virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler) {};
00096
00097
00098 protected:
00099 DECLARE_MESSAGE_MAP()
00100 afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
00101 afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
00102 afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
00103 afx_msg void OnMouseMove(UINT nFlags, CPoint point);
00104 afx_msg void OnTimer(UINT nIDEvent);
00105 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00106 afx_msg void OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct);
00107 afx_msg void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct);
00108 afx_msg void OnDownloadGroupNew();
00109 afx_msg void OnUpdateDownloadGroupRemove(CCmdUI* pCmdUI);
00110 afx_msg void OnDownloadGroupRemove();
00111 afx_msg void OnUpdateDownloadGroupProperties(CCmdUI* pCmdUI);
00112 afx_msg void OnDownloadGroupProperties();
00113 afx_msg void OnUpdateDownloadGroupResume(CCmdUI* pCmdUI);
00114 afx_msg void OnDownloadGroupResume();
00115 afx_msg void OnUpdateDownloadGroupPause(CCmdUI* pCmdUI);
00116 afx_msg void OnDownloadGroupPause();
00117 afx_msg void OnUpdateDownloadGroupClear(CCmdUI* pCmdUI);
00118 afx_msg void OnDownloadGroupClear();
00119
00120 friend class TabItem;
00121 };