00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
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
00033 public:
00034 CTaskPanel();
00035 virtual ~CTaskPanel();
00036
00037 DECLARE_DYNAMIC(CTaskPanel)
00038
00039
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
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
00067 public:
00068
00069 public:
00070 virtual BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);
00071
00072
00073
00074 protected:
00075
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
00081 DECLARE_MESSAGE_MAP()
00082
00083 friend class CTaskBox;
00084 };
00085
00086
00087 class CTaskBox : public CWnd
00088 {
00089
00090 public:
00091 CTaskBox();
00092 virtual ~CTaskBox();
00093
00094 DECLARE_DYNAMIC(CTaskBox)
00095
00096
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
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
00129 public:
00130
00131 public:
00132 virtual BOOL Create(CTaskPanel* pPanel, int nHeight = 0, LPCTSTR pszCaption = NULL, UINT nIDIcon = 0);
00133
00134
00135
00136 protected:
00137
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
00149 DECLARE_MESSAGE_MAP()
00150
00151 friend class CTaskPanel;
00152 };
00153
00154
00155
00156 #endif