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

📄 childview.cpp

📁 B+树的演示程序
💻 CPP
字号:
// ChildView.cpp : CChildView 类的实现
//

#include "stdafx.h"
#include "BPlusTree.h"
#include "ChildView.h"
#include "MainFrm.h"
#include ".\childview.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif


// CChildView

CChildView::CChildView()
{
	m_drawKey0 = -1;
	m_drawLevel = 1;
	m_iType = 0;
	m_inserPoint = NULL;
	m_iNumber = -1;
}

CChildView::~CChildView()
{
}


BEGIN_MESSAGE_MAP(CChildView, CWnd)
	ON_WM_PAINT()
	ON_WM_CREATE()
END_MESSAGE_MAP()



// CChildView 消息处理程序

BOOL CChildView::PreCreateWindow(CREATESTRUCT& cs) 
{
	if (!CWnd::PreCreateWindow(cs))
		return FALSE;

	cs.dwExStyle |= WS_EX_CLIENTEDGE;
	cs.style &= ~WS_BORDER;
	cs.lpszClass = AfxRegisterWndClass(CS_HREDRAW|CS_VREDRAW|CS_DBLCLKS, 
		::LoadCursor(NULL, IDC_ARROW), reinterpret_cast<HBRUSH>(COLOR_WINDOW+1), NULL);

	return TRUE;
}

void CChildView::Display()
{
	OnPaint();
}

void CChildView::OnPaint() 
{
	CPaintDC dc(this); // 用于绘制的设备上下文
	
	// TODO: 在此处添加消息处理程序代码
	m_tree.Create(&dc,((CMainFrame*)AfxGetMainWnd())->GetBPlusTree());
	RECT rect;
	GetWindowRect(&rect);
	m_tree.SetMyRect(rect);
	m_tree.DrawTree(m_drawKey0,m_drawLevel,m_iType,m_inserPoint,m_iNumber);
	
	// 不要为绘制消息而调用 CWnd::OnPaint()
}

⌨️ 快捷键说明

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