1 // CPropTreeView.cpp : implementation file
2 //
3 
4 //#include "stdafx.h"
5 #include "tools/edit_gui_common.h"
6 
7 
8 
9 #include "PropTreeView.h"
10 
11 // CPropTreeView
12 
IMPLEMENT_DYNCREATE(CPropTreeView,CFormView)13 IMPLEMENT_DYNCREATE(CPropTreeView, CFormView)
14 
15 CPropTreeView::CPropTreeView()
16 : CFormView((LPCTSTR) NULL)
17 {
18 }
19 
~CPropTreeView()20 CPropTreeView::~CPropTreeView()
21 {
22 }
23 
BEGIN_MESSAGE_MAP(CPropTreeView,CView)24 BEGIN_MESSAGE_MAP(CPropTreeView, CView)
25 	ON_WM_CREATE()
26 	ON_WM_SIZE()
27 	ON_WM_PAINT()
28 END_MESSAGE_MAP()
29 
30 
31 // CPropTreeView drawing
32 
33 void CPropTreeView::OnDraw(CDC* pDC)
34 {
35 	CDocument* pDoc = GetDocument();
36 	// TODO: add draw code here
37 }
38 
39 
40 // CPropTreeView diagnostics
41 
42 #ifdef _DEBUG
AssertValid() const43 void CPropTreeView::AssertValid() const
44 {
45 	CView::AssertValid();
46 }
47 
Dump(CDumpContext & dc) const48 void CPropTreeView::Dump(CDumpContext& dc) const
49 {
50 	CView::Dump(dc);
51 }
52 #endif //_DEBUG
53 
54 
Create(LPCTSTR lpszClassName,LPCTSTR lpszWindowName,DWORD dwStyle,const RECT & rect,CWnd * pParentWnd,UINT nID,CCreateContext * pContext)55 BOOL CPropTreeView::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName,
56 					   DWORD dwStyle, const RECT& rect, CWnd* pParentWnd,
57 					   UINT nID, CCreateContext* pContext)
58 {
59 	// create the view window itself
60 	m_pCreateContext = pContext;
61 	if (!CView::Create(lpszClassName, lpszWindowName,
62 		dwStyle, rect, pParentWnd,  nID, pContext))
63 	{
64 		return FALSE;
65 	}
66 
67 	return TRUE;
68 }
69 // CPropTreeView message handlers
70 
OnCreate(LPCREATESTRUCT lpCreateStruct)71 int CPropTreeView::OnCreate(LPCREATESTRUCT lpCreateStruct)
72 {
73 	if (CView::OnCreate(lpCreateStruct) == -1)
74 		return -1;
75 
76 	DWORD dwStyle;
77 	CRect rc;
78 
79 	// PTS_NOTIFY - CPropTree will send notification messages to the parent window
80 	dwStyle = WS_CHILD|WS_VISIBLE|PTS_NOTIFY;
81 
82 	// Init the control's size to cover the entire client area
83 	GetClientRect(rc);
84 
85 	// Create CPropTree control
86 	m_Tree.Create(dwStyle, rc, this, IDC_PROPERTYTREE);
87 
88 	return 0;
89 }
90 
OnSize(UINT nType,int cx,int cy)91 void CPropTreeView::OnSize(UINT nType, int cx, int cy)
92 {
93 		CView::OnSize(nType, cx, cy);
94 
95 		if (::IsWindow(m_Tree.GetSafeHwnd()))
96 			m_Tree.SetWindowPos(NULL, -1, -1, cx, cy, SWP_NOMOVE|SWP_NOZORDER);
97 }
98 
99 
OnPaint()100 void CPropTreeView::OnPaint()
101 {
102 	Default();
103 }
104