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

CtrlWndTabBar.h

Go to the documentation of this file.
00001 //
00002 // CtrlWndTabBar.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 #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 // Construction
00033 public:
00034         CWndTabBar();
00035         virtual ~CWndTabBar();
00036 
00037         friend class CWindowManager;
00038 // Item Class
00039 public:
00040         class TabItem
00041         {
00042         // Construction
00043         public:
00044                 TabItem(CChildWnd* pWnd, DWORD nCookie, LPCTSTR pszCaption);
00045                 virtual ~TabItem();
00046 
00047         // Attributes
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         // Operations
00059         public:
00060                 void    Paint(CWndTabBar* pBar, CDC* pDC, CRect* pRect, BOOL bSelected, BOOL bHot, BOOL bTransparent);
00061 
00062         };
00063 
00064 // Attributes
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 // Operations
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 // Overrides
00095 public:
00096         //{{AFX_VIRTUAL(CWndTabBar)
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         //}}AFX_VIRTUAL
00103 
00104 // Implementation
00105 protected:
00106         //{{AFX_MSG(CWndTabBar)
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         //}}AFX_MSG
00119 
00120         DECLARE_MESSAGE_MAP()
00121 
00122         friend class TabItem;
00123 };
00124 
00125 //{{AFX_INSERT_LOCATION}}
00126 
00127 #endif // !defined(AFX_CTRLWNDTABBAR_H__879DC787_89B3_41D4_A23E_0D690E04D000__INCLUDED_)

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