00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #pragma once
00023
00024 #include "CtrlUploadTip.h"
00025
00026 class CUploadFile;
00027 class CUploadQueue;
00028
00029
00030 class CUploadsCtrl : public CWnd
00031 {
00032
00033 public:
00034 CUploadsCtrl();
00035 virtual ~CUploadsCtrl();
00036
00037 DECLARE_DYNAMIC(CUploadsCtrl)
00038
00039
00040 public:
00041 BOOL Create(CWnd* pParentWnd, UINT nID);
00042 BOOL Update();
00043 protected:
00044 void InsertColumn(int nColumn, LPCTSTR pszCaption, int nFormat, int nWidth);
00045 void SaveColumnState();
00046 BOOL LoadColumnState();
00047 void SelectTo(int nIndex);
00048 void DeselectAll(CUploadFile* pExcept = NULL);
00049 BOOL HitTest(const CPoint& point, CUploadQueue** ppQueue, CUploadFile** ppFile, int* pnIndex, RECT* prcItem);
00050 BOOL GetAt(int nSelect, CUploadQueue** ppQueue, CUploadFile** ppFile);
00051 void PaintQueue(CDC& dc, const CRect& rcRow, CUploadQueue* pQueue, BOOL bFocus);
00052 void PaintFile(CDC& dc, const CRect& rcRow, CUploadQueue* pQueue, CUploadFile* pFile, int nPosition, BOOL bFocus);
00053 int GetExpandableColumnX() const;
00054
00055 friend class CUploadsWnd;
00056
00057
00058 protected:
00059 CHeaderCtrl m_wndHeader;
00060 CUploadTipCtrl m_wndTip;
00061 CImageList m_pProtocols;
00062 int m_nFocus;
00063 CUploadFile* m_pDeselect;
00064 int m_nScrollWheelLines;
00065
00066
00067 public:
00068 static POSITION GetQueueIterator();
00069 static CUploadQueue* GetNextQueue(POSITION& pos);
00070 static POSITION GetFileIterator(CUploadQueue* pQueue);
00071 static CUploadFile* GetNextFile(CUploadQueue* pQueue, POSITION& pos, int* pnPosition = NULL);
00072
00073
00074 protected:
00075 DECLARE_MESSAGE_MAP()
00076 public:
00077 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00078 afx_msg void OnDestroy();
00079 afx_msg void OnSize(UINT nType, int cx, int cy);
00080 afx_msg void OnPaint();
00081 afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
00082 afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
00083 afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
00084 afx_msg void OnChangeHeader(NMHDR* pNotifyStruct, LRESULT* pResult);
00085 afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
00086 afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
00087 afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
00088 afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
00089 afx_msg void OnMouseMove(UINT nFlags, CPoint point);
00090 afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
00091 afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
00092 afx_msg void OnSetFocus(CWnd* pOldWnd);
00093 afx_msg void OnKillFocus(CWnd* pNewWnd);
00094 };
00095
00096 #define ULF_ACTIVE 0x01
00097 #define ULF_QUEUED 0x02
00098 #define ULF_HISTORY 0x04
00099 #define ULF_TORRENT 0x08
00100
00101 #define ULF_ALL (ULF_ACTIVE|ULF_QUEUED|ULF_HISTORY|ULF_TORRENT)