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

工具条

开发平台:

Visual C++

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