#pragma once

#include "SchemeDoc.h"
#include <map>
// CSchemeTreeView view

class CSchemeView;

class CSchemeTreeView : public CView
{
	DECLARE_DYNCREATE(CSchemeTreeView)

protected:
	CSchemeTreeView();           // protected constructor used by dynamic creation
	virtual ~CSchemeTreeView();
private:
	CTreeCtrl m_wndTreeCtrl;
	BOOL UpdateSubTree(HTREEITEM hItem, const CBlockItem_Virtual* pItem);
	afx_msg void OnSelChanged(NMHDR*, LRESULT*);
	BOOL Select(CBlockItem_Virtual *ptr);
	std::map<CBlockItem_Virtual*, HTREEITEM> mapItems;
public:
	CSchemeDoc* GetDocument() const;

public:
	virtual void OnDraw(CDC* pDC);      // overridden to draw this view
#ifdef _DEBUG
	virtual void AssertValid() const;
#ifndef _WIN32_WCE
	virtual void Dump(CDumpContext& dc) const;
#endif
#endif

protected:
	DECLARE_MESSAGE_MAP()
public:
	virtual void OnInitialUpdate();
	afx_msg void OnSize(UINT nType, int cx, int cy);
protected:
	virtual void OnUpdate(CView* /*pSender*/, LPARAM /*lHint*/, CObject* /*pHint*/);
	friend class CSchemeView;
};


#ifndef _DEBUG  // debug version in SchemeView.cpp
inline CSchemeDoc* CSchemeTreeView::GetDocument() const
   { return reinterpret_cast<CSchemeDoc*>(m_pDocument); }
#endif