doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PropTreeView.cpp
Go to the documentation of this file.
1 // CPropTreeView.cpp : implementation file
2 //
3 
4 //#include "stdafx.h"
5 #include "../../../idlib/precompiled.h"
6 #pragma hdrstop
7 
8 
9 #include "PropTreeView.h"
10 
11 // CPropTreeView
12 
14 
16 : CFormView((LPCTSTR) NULL)
17 {
18 }
19 
21 {
22 }
23 
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
43 void CPropTreeView::AssertValid() const
44 {
45  CView::AssertValid();
46 }
47 
48 void CPropTreeView::Dump(CDumpContext& dc) const
49 {
50  CView::Dump(dc);
51 }
52 #endif //_DEBUG
53 
54 
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 
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 
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 
101 {
102  Default();
103 }
afx_msg void OnPaint()
CONST PIXELFORMATDESCRIPTOR UINT
Definition: win_qgl.cpp:47
virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT &rect, CWnd *pParentWnd, UINT nID, CCreateContext *pContext=NULL)
#define IDC_PROPERTYTREE
Definition: PropTreeView.h:6
DWORD
Definition: win_qgl.cpp:61
#define BOOL
Definition: mprintf.c:71
afx_msg void OnSize(UINT nType, int cx, int cy)
#define NULL
Definition: Lib.h:88
CPropTree m_Tree
Definition: PropTreeView.h:13
BOOL Create(DWORD dwStyle, const RECT &rect, CWnd *pParentWnd, UINT nID)
Definition: PropTree.cpp:130
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct)
IMPLEMENT_DYNCREATE(CCamWnd, CWnd)
#define FALSE
Definition: mprintf.c:70
#define PTS_NOTIFY
Definition: PropTree.h:75
#define TRUE
Definition: mprintf.c:69
virtual ~CPropTreeView()