⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 treeview.cpp

📁 一个使用VRmap控件编成的VC实例
💻 CPP
字号:
// HexView.cpp : implementation of the CHexView class
//

#include "stdafx.h"
#include "C3Q.h"

#include "C3QDoc.h"
#include "TreeView.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CHexView

IMPLEMENT_DYNCREATE(CCTreeView, CTreeView)

BEGIN_MESSAGE_MAP(CCTreeView, CTreeView)
	//{{AFX_MSG_MAP(CCTreeView)
		// NOTE - the ClassWizard will add and remove mapping macros here.
		//    DO NOT EDIT what you see in these blocks of generated code!
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CHexView construction/destruction

CCTreeView::CCTreeView() : m_rectPrint(0, 0, 11520, -15120)
{
}

CCTreeView::~CCTreeView()
{
}

BOOL CCTreeView::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs
	cs.style |= TVS_HASLINES | TVS_HASBUTTONS | TVS_LINESATROOT | TVS_EDITLABELS;
	return CTreeView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CHexView drawing

void CCTreeView::OnDraw(CDC* pDC)
{
	CC3QDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
}

void CCTreeView::OnInitialUpdate()
{
	/*
	CLogScrollView::OnInitialUpdate();
	CSize sizeTotal(m_rectPrint.Width(), -m_rectPrint.Height());
	SetLogScrollSizes(sizeTotal);
	CTreeCtrl& trCtrl = GetTreeCtrl(); 
	m_TreeImages.Create( IDB_TREEIMAGES, 20, 1, RGB(0, 255, 0) ); 
	trCtrl.SetImageList( &m_TreeImages, TVSIL_NORMAL );
	*/

	CTreeCtrl&  trCtrl = GetTreeCtrl(); 
	HTREEITEM hItem; 
	hItem = trCtrl.InsertItem( "Cameroon", 0, 2 ); 
	
	trCtrl.InsertItem( "Yaounde", 1, 3, hItem );
	trCtrl.InsertItem( "Douala", 1, 3, hItem );
	trCtrl.InsertItem( "Ebolowa", 1, 3, hItem );

	hItem = trCtrl.InsertItem( "U.S.A.", 0, 2 );
	trCtrl.InsertItem( "Washington, DC", 1, 3, hItem );
	trCtrl.InsertItem( "New York", 1, 3, hItem );
		
	hItem = trCtrl.InsertItem( "Germany", 0, 2 );
	trCtrl.InsertItem( "Bonn", 1, 3, hItem );
	trCtrl.InsertItem( "Francfort", 1, 3, hItem );

	CTreeView::OnInitialUpdate();
}

/////////////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////////////
// CHexView diagnostics

#ifdef _DEBUG
void CCTreeView::AssertValid() const
{
	CTreeView::AssertValid();
}

void CCTreeView::Dump(CDumpContext& dc) const
{
	CTreeView::Dump(dc);
}

CC3QDoc* CCTreeView::GetDocument() // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CC3QDoc)));
	return (CC3QDoc*)m_pDocument;
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -