Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
2.0 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. // PakViewFiles.cpp : implementation file
  9. //
  10. #include "stdafx.h"
  11. #include "hammer.h"
  12. #include "PakDoc.h"
  13. #include "PakViewFiles.h"
  14. #ifdef _DEBUG
  15. #define new DEBUG_NEW
  16. #undef THIS_FILE
  17. static char THIS_FILE[] = __FILE__;
  18. #endif
  19. /////////////////////////////////////////////////////////////////////////////
  20. // CPakViewFiles
  21. IMPLEMENT_DYNCREATE(CPakViewFiles, CListView)
  22. CPakViewFiles::CPakViewFiles()
  23. {
  24. }
  25. CPakViewFiles::~CPakViewFiles()
  26. {
  27. }
  28. BEGIN_MESSAGE_MAP(CPakViewFiles, CListView)
  29. //{{AFX_MSG_MAP(CPakViewFiles)
  30. // NOTE - the ClassWizard will add and remove mapping macros here.
  31. //}}AFX_MSG_MAP
  32. END_MESSAGE_MAP()
  33. /////////////////////////////////////////////////////////////////////////////
  34. // CPakViewFiles drawing
  35. void CPakViewFiles::OnDraw(CDC* pDC)
  36. {
  37. CDocument* pDoc = GetDocument();
  38. // TODO: add draw code here
  39. }
  40. /////////////////////////////////////////////////////////////////////////////
  41. // CPakViewFiles diagnostics
  42. #ifdef _DEBUG
  43. void CPakViewFiles::AssertValid() const
  44. {
  45. CListView::AssertValid();
  46. }
  47. void CPakViewFiles::Dump(CDumpContext& dc) const
  48. {
  49. CListView::Dump(dc);
  50. }
  51. #endif //_DEBUG
  52. /////////////////////////////////////////////////////////////////////////////
  53. // CPakViewFiles message handlers
  54. void CPakViewFiles::OnInitialUpdate()
  55. {
  56. CListView::OnInitialUpdate();
  57. CListCtrl& lc = GetListCtrl();
  58. // modify the list control's attributes
  59. DWORD dwStyle = GetWindowLong(lc.m_hWnd, GWL_STYLE);
  60. SetWindowLong(lc.m_hWnd, GWL_STYLE, (dwStyle & ~LVS_TYPEMASK) |
  61. LVS_ALIGNLEFT | LVS_AUTOARRANGE | LVS_REPORT | // LVS_ICON |
  62. // LVS_NOITEMDATA |
  63. LVS_SORTASCENDING);
  64. // add some headers
  65. // 1. name of entry
  66. lc.InsertColumn(0, "Name", LVCFMT_LEFT, 150, colName);
  67. // 2. size of entry
  68. lc.InsertColumn(1, "Size", LVCFMT_RIGHT, 80, colSize);
  69. // 3. type of entry
  70. lc.InsertColumn(2, "Type", LVCFMT_LEFT, 180, colType);
  71. }