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

CtrlTaskPanel.h

Go to the documentation of this file.
00001 //
00002 // CtrlTaskPanel.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_CTRLTASKPANEL_H__509DBC3E_C56B_4A11_993A_3F227C6D9621__INCLUDED_)
00023 #define AFX_CTRLTASKPANEL_H__509DBC3E_C56B_4A11_993A_3F227C6D9621__INCLUDED_
00024 
00025 #pragma once
00026 
00027 class CTaskBox;
00028 
00029 
00030 class CTaskPanel : public CWnd
00031 {
00032 // Construction
00033 public:
00034         CTaskPanel();
00035         virtual ~CTaskPanel();
00036 
00037         DECLARE_DYNAMIC(CTaskPanel)
00038 
00039 // Attributes
00040 protected:
00041         CPtrList        m_pBoxes;
00042         CTaskBox*       m_pStretch;
00043         int                     m_nMargin;
00044         int                     m_nCurve;
00045         CBitmap         m_bmWatermark;
00046         CBitmap         m_bmFooter;
00047         BOOL            m_bLayout;
00048 
00049 // Operations
00050 public:
00051         CTaskBox*       AddBox(CTaskBox* pBox, POSITION posBefore = NULL);
00052         POSITION        GetBoxIterator() const;
00053         CTaskBox*       GetNextBox(POSITION& pos) const;
00054         int                     GetBoxCount() const;
00055         void            RemoveBox(CTaskBox* pBox);
00056         void            ClearBoxes(BOOL bDelete);
00057 public:
00058         void            SetStretchBox(CTaskBox* pBox);
00059         void            SetMargin(int nMargin, int nCurve = 2);
00060         void            SetWatermark(HBITMAP hBitmap);
00061         void            SetFooter(HBITMAP hBitmap, BOOL bDefault = TRUE);
00062         void            OnChanged();
00063 protected:
00064         void            Layout(CRect& rcClient);
00065 
00066 // Overrides
00067 public:
00068         //{{AFX_VIRTUAL(CTaskPanel)
00069         public:
00070         virtual BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);
00071         //}}AFX_VIRTUAL
00072 
00073 // Implementation
00074 protected:
00075         //{{AFX_MSG(CTaskPanel)
00076         afx_msg void OnSize(UINT nType, int cx, int cy);
00077         afx_msg void OnPaint();
00078         afx_msg BOOL OnEraseBkgnd(CDC* pDC);
00079         afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00080         //}}AFX_MSG
00081         DECLARE_MESSAGE_MAP()
00082 
00083         friend class CTaskBox;
00084 };
00085 
00086 
00087 class CTaskBox : public CWnd
00088 {
00089 // Construction
00090 public:
00091         CTaskBox();
00092         virtual ~CTaskBox();
00093 
00094         DECLARE_DYNAMIC(CTaskBox)
00095 
00096 // Attributes
00097 private:
00098         CTaskPanel*     m_pPanel;
00099         int                     m_nHeight;
00100         BOOL            m_bVisible;
00101         BOOL            m_bOpen;
00102         BOOL            m_bHover;
00103         BOOL            m_bPrimary;
00104         HICON           m_hIcon;
00105         BOOL            m_bIconDel;
00106 protected:
00107         CBitmap         m_bmWatermark;
00108         CBitmap         m_bmCaptionmark;
00109         BOOL            m_bCaptionCurve;
00110 
00111 // Operations
00112 public:
00113         CTaskPanel*     GetPanel() const;
00114         void            SetCaption(LPCTSTR pszCaption);
00115         void            SetIcon(HICON hIcon, BOOL bDelete = FALSE);
00116         void            SetSize(int nHeight);
00117         void            SetPrimary(BOOL bPrimary = TRUE);
00118         void            SetWatermark(HBITMAP hBitmap);
00119         void            SetCaptionmark(HBITMAP hBitmap, BOOL bDefault = TRUE);
00120         void            Expand(BOOL bOpen = TRUE);
00121 protected:
00122         int             GetOuterHeight() const;
00123         void    PaintBorders();
00124         void    InvalidateNonclient();
00125 
00126         virtual void OnExpanded(BOOL bOpen);
00127 
00128 // Overrides
00129 public:
00130         //{{AFX_VIRTUAL(CTaskBox)
00131         public:
00132         virtual BOOL Create(CTaskPanel* pPanel, int nHeight = 0, LPCTSTR pszCaption = NULL, UINT nIDIcon = 0);
00133         //}}AFX_VIRTUAL
00134 
00135 // Implementation
00136 protected:
00137         //{{AFX_MSG(CTaskBox)
00138         afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp);
00139         afx_msg void OnNcPaint();
00140         afx_msg UINT OnNcHitTest(CPoint point);
00141         afx_msg BOOL OnNcActivate(BOOL bActive);
00142         afx_msg void OnPaint();
00143         afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
00144         afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
00145         afx_msg void OnNcLButtonUp(UINT nHitTest, CPoint point);
00146         afx_msg void OnTimer(UINT nIDEvent);
00147         afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point);
00148         //}}AFX_MSG
00149         DECLARE_MESSAGE_MAP()
00150 
00151         friend class CTaskPanel;
00152 };
00153 
00154 //{{AFX_INSERT_LOCATION}}
00155 
00156 #endif // !defined(AFX_CTRLTASKPANEL_H__509DBC3E_C56B_4A11_993A_3F227C6D9621__INCLUDED_)

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