Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

CtrlDownloadTabBar.h

Go to the documentation of this file.
00001 //
00002 // CtrlDownloadTabBar.h
00003 //
00004 // Copyright (c) Shareaza Development Team, 2002-2005.
00005 // This file is part of SHAREAZA (www.shareaza.com)
00006 //
00007 // Shareaza is free software; you can redistribute it
00008 // and/or modify it under the terms of the GNU General Public License
00009 // as published by the Free Software Foundation; either version 2 of
00010 // the License, or (at your option) any later version.
00011 //
00012 // Shareaza is distributed in the hope that it will be useful,
00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 // GNU General Public License for more details.
00016 //
00017 // You should have received a copy of the GNU General Public License
00018 // along with Shareaza; if not, write to the Free Software
00019 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020 //
00021 
00022 #pragma once
00023 
00024 class CDownloadGroup;
00025 
00026 
00027 class CDownloadTabBar : public CControlBar
00028 {
00029 // Construction
00030 public:
00031         CDownloadTabBar();
00032         virtual ~CDownloadTabBar();
00033 
00034 // Item Class
00035 public:
00036         class TabItem
00037         {
00038         // Construction
00039         public:
00040                 TabItem(CDownloadGroup* pGroup, int nCookie);
00041                 virtual ~TabItem();
00042 
00043         // Attributes
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         // Operations
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 // Attributes
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 // Operations
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 // Overrides
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 // Implementation
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 };

Generated on Thu Dec 15 10:39:35 2005 for Shareaza 2.2.1.0 by  doxygen 1.4.2