FileList.h
上传用户:wymy58
上传日期:2007-01-07
资源大小:2086k
文件大小:3k
源码类别:

DirextX编程

开发平台:

Visual C++

  1. #if !defined(AFX_FILELIST_H__F6646700_C4B7_11D2_BF7C_0080C8E05391__INCLUDED_)
  2. #define AFX_FILELIST_H__F6646700_C4B7_11D2_BF7C_0080C8E05391__INCLUDED_
  3. #if _MSC_VER > 1000
  4. #pragma once
  5. #endif // _MSC_VER > 1000
  6. // FileList.h : header file
  7. //
  8. #include "FileListHead.h"
  9. #include "FastFileManager.h"
  10. #include "FastFile.h"
  11. /////////////////////////////////////////////////////////////////////////////
  12. // CFileList window
  13. class CFileList : public CListCtrl
  14. {
  15. // Construction
  16. public:
  17. CFileList(BOOL bLeft = TRUE);
  18. // Attributes
  19. public:
  20. enum FileType {
  21. ftNormal = 0x0000,
  22. ftDirectory = 0x0001,
  23. ftFastFile = 0x0002,
  24. ftCompressedFile = 0x0004,
  25. ftExcutableFile = 0x0008
  26. };
  27. BOOL SetBkImage(UINT nIDResource);
  28. BOOL SetBkImage(LPCTSTR lpszResourceName);
  29. VOID SetSortOrder(int nSortCol, BOOL bSortAscend){
  30. //m_headerctrl.SetSortImage(nSortCol, bSortAscend);
  31. if (m_bLeftPan)
  32. {
  33. gOptions.m_nSortColLeft = nSortCol;
  34. gOptions.m_nSortOrderLeft = bSortAscend;
  35. }
  36. else
  37. {
  38. gOptions.m_nSortColRight = nSortCol;
  39. gOptions.m_nSortOrderRight = bSortAscend;
  40. }
  41. };
  42. CFastFileManager* GetFastFileManager()
  43. { return m_pFfm; };
  44. protected:
  45. BOOL m_bLeftPan;
  46. // CString m_strCurrentPath;
  47. CFastFileManager* m_pFfm;
  48. // int m_nSortedCol;
  49. // BOOL m_bSortAscending;
  50. CFileListHead m_headerctrl;
  51. CBitmap m_bitmap;
  52. int m_cxBitmap, m_cyBitmap;
  53. CPalette m_pal;
  54. // Operations
  55. public:
  56. VOID Unload();
  57. BOOL LoadItem(int nItem);
  58. BOOL LoadDirectory(LPCTSTR lpszPath);
  59. BOOL LoadFastfile(LPCTSTR lpszPath);
  60. // Overrides
  61. // ClassWizard generated virtual function overrides
  62. //{{AFX_VIRTUAL(CFileList)
  63. //}}AFX_VIRTUAL
  64. protected:
  65. static int CALLBACK Compare(LPARAM lParam1, LPARAM lParam2, LPARAM 
  66. lParamSort);
  67. virtual void DrawItem( LPDRAWITEMSTRUCT lpDrawItemStruct );
  68. // Implementation
  69. public:
  70. BOOL Create(CWnd* pParentWnd, UINT nID );
  71. virtual ~CFileList();
  72. // Generated message map functions
  73. protected:
  74. //{{AFX_MSG(CFileList)
  75. afx_msg BOOL OnQueryNewPalette();
  76. afx_msg void OnPaletteChanged(CWnd* pFocusWnd);
  77. afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  78. afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  79. afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
  80. afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  81. afx_msg void OnBegindrag(NMHDR* pNMHDR, LRESULT* pResult);
  82. afx_msg void OnSetFocus(CWnd* pOldWnd);
  83. //}}AFX_MSG
  84. afx_msg void OnHeaderClicked(NMHDR* pNMHDR, LRESULT* pResult);
  85. DECLARE_MESSAGE_MAP()
  86. };
  87. /////////////////////////////////////////////////////////////////////////////
  88. //{{AFX_INSERT_LOCATION}}
  89. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  90. #endif // !defined(AFX_FILELIST_H__F6646700_C4B7_11D2_BF7C_0080C8E05391__INCLUDED_)