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

CtrlMainTabBar.h

Go to the documentation of this file.
00001 //
00002 // CtrlMainTabBar.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 CSkinWindow;
00025 
00026 
00027 class CMainTabBarCtrl : public CControlBar
00028 {
00029 // Construction
00030 public:
00031         CMainTabBarCtrl();
00032         virtual ~CMainTabBarCtrl();
00033 
00034         DECLARE_DYNAMIC(CMainTabBarCtrl)
00035 
00036 // Item Class
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 // Attributes
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 // Operations
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 // Implementation
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 };

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