FileView.cpp
上传用户:libwxy
上传日期:2007-01-02
资源大小:200k
文件大小:2k
源码类别:

工具条

开发平台:

Visual C++

  1. // FileView.cpp: Implementierungsdatei
  2. //
  3. #include "stdafx.h"
  4. #include "FileView.h"
  5. #ifdef _DEBUG
  6. #define new DEBUG_NEW
  7. #undef THIS_FILE
  8. static char THIS_FILE[] = __FILE__;
  9. #endif
  10. /////////////////////////////////////////////////////////////////////////////
  11. // CFileView
  12. IMPLEMENT_DYNCREATE(CFileView, CTreeView)
  13. CFileView::CFileView()
  14. {
  15. }
  16. CFileView::~CFileView()
  17. {
  18. }
  19. BEGIN_MESSAGE_MAP(CFileView, CTreeView)
  20. //{{AFX_MSG_MAP(CFileView)
  21. ON_WM_CREATE()
  22. //}}AFX_MSG_MAP
  23. END_MESSAGE_MAP()
  24. /////////////////////////////////////////////////////////////////////////////
  25. // Zeichnung CFileView 
  26. void CFileView::OnDraw(CDC* pDC)
  27. {
  28. CDocument* pDoc = GetDocument();
  29. // ZU ERLEDIGEN: Code zum Zeichnen hier einf黦en
  30. }
  31. /////////////////////////////////////////////////////////////////////////////
  32. // Diagnose CFileView
  33. #ifdef _DEBUG
  34. void CFileView::AssertValid() const
  35. {
  36. CTreeView::AssertValid();
  37. }
  38. void CFileView::Dump(CDumpContext& dc) const
  39. {
  40. CTreeView::Dump(dc);
  41. }
  42. #endif //_DEBUG
  43. /////////////////////////////////////////////////////////////////////////////
  44. // Behandlungsroutinen f黵 Nachrichten CFileView 
  45. int CFileView::OnCreate(LPCREATESTRUCT lpCreateStruct) 
  46. {
  47. if (CTreeView::OnCreate(lpCreateStruct) == -1)
  48. return -1;
  49. GetTreeCtrl().ModifyStyle(0, 
  50. TVS_HASBUTTONS|TVS_LINESATROOT|TVS_HASLINES|TVS_SHOWSELALWAYS);
  51. HTREEITEM hRootItem = GetTreeCtrl().InsertItem("Files",0,0);
  52. for (int i=0; i<5; i++)
  53. {
  54. CString strItem;
  55. strItem.Format("File %d", i);
  56. GetTreeCtrl().InsertItem(strItem,i,i,hRootItem);
  57. }
  58. GetTreeCtrl().SelectItem(hRootItem);
  59. GetTreeCtrl().Expand(hRootItem, TVE_EXPAND);
  60. return 0;
  61. }