📄 mytree1.cpp
字号:
// MyTree1.cpp : implementation file
//
#include "stdafx.h"
#include "Library.h"
#include "MyTree1.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMyTree1
IMPLEMENT_DYNCREATE(CMyTree1, CTreeView)
CMyTree1::CMyTree1()
{
}
CMyTree1::~CMyTree1()
{
}
BEGIN_MESSAGE_MAP(CMyTree1, CTreeView)
//{{AFX_MSG_MAP(CMyTree1)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMyTree1 drawing
void CMyTree1::OnDraw(CDC* pDC)
{
CDocument* pDoc = GetDocument();
// TODO: add draw code here
}
/////////////////////////////////////////////////////////////////////////////
// CMyTree1 diagnostics
#ifdef _DEBUG
void CMyTree1::AssertValid() const
{
CTreeView::AssertValid();
}
void CMyTree1::Dump(CDumpContext& dc) const
{
CTreeView::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CMyTree1 message handlers
void CMyTree1::OnInitialUpdate()
{
CTreeView::OnInitialUpdate();
m_imagelist.Create(16,16,ILC_COLOR24|ILC_MASK,5,5);
m_imagelist.Add(AfxGetApp()->LoadIcon(IDI_ICON6));
m_imagelist.Add(AfxGetApp()->LoadIcon(IDI_ICON7));
m_imagelist.Add(AfxGetApp()->LoadIcon(IDI_ICON8));
this->GetTreeCtrl().SetImageList(&m_imagelist,TVSIL_NORMAL);
this->GetTreeCtrl().DeleteAllItems();
this->ModifyStyle(0,TVS_HASLINES|TVS_LINESATROOT|TVS_HASBUTTONS);
HTREEITEM h_root,h_root1,h_root2,h_root3,h_root4;
CString tempstr;
h_root=this->GetTreeCtrl().InsertItem("功能列表",0,0);
h_root1=this->GetTreeCtrl().InsertItem("常用操作",1,2,h_root);
this->GetTreeCtrl().InsertItem("出借资料",1,2,h_root1);
this->GetTreeCtrl().InsertItem("归还资料",1,2,h_root1);
this->GetTreeCtrl().InsertItem("读者查询",1,2,h_root1);
this->GetTreeCtrl().InsertItem("图书查询",1,2,h_root1);
this->GetTreeCtrl().InsertItem("逾期列表",1,2,h_root1);
h_root2=this->GetTreeCtrl().InsertItem("信息管理",1,2,h_root);
this->GetTreeCtrl().InsertItem("图书管理",1,2,h_root2);
this->GetTreeCtrl().InsertItem("读者管理",1,2,h_root2);
this->GetTreeCtrl().InsertItem("类别管理",1,2,h_root2);
this->GetTreeCtrl().InsertItem("罚款管理",1,2,h_root2);
h_root3=this->GetTreeCtrl().InsertItem("统计分析",1,2,h_root);
this->GetTreeCtrl().InsertItem("借阅排行榜",1,2,h_root3);
this->GetTreeCtrl().InsertItem("当前状态统计",1,2,h_root3);
h_root4=this->GetTreeCtrl().InsertItem("系统设置",1,2,h_root);
this->GetTreeCtrl().InsertItem("信息管理",1,2,h_root4);
this->GetTreeCtrl().InsertItem("系统参数设置",1,2,h_root4);
this->GetTreeCtrl().InsertItem("用户管理",1,2,h_root4);
this->GetTreeCtrl().InsertItem("切换用户",1,2,h_root4);
this->GetTreeCtrl().InsertItem("修改密码",1,2,h_root4);
this->GetTreeCtrl().InsertItem("信息管理",1,2,h_root4);
this->GetTreeCtrl().InsertItem("暂时离开",1,2,h_root4);
this->GetTreeCtrl().InsertItem("系统初始化",1,2,h_root4);
this->GetTreeCtrl().InsertItem("退出",1,2,h_root4);
this->GetTreeCtrl().Expand(h_root,TVE_EXPAND);
/* m_font.CreateFont(0,0,0,0,FW_BOLD,0,0,0,DEFAULT_CHARSET,OUT_STRING_PRECIS
,CLIP_TT_ALWAYS,DEFAULT_QUALITY,DEFAULT_PITCH,"宋体");
this->SetFont(&m_font);
*/
// TODO: Add your specialized code here and/or call the base class
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -