📄 dirtreeview.h
字号:
// DirTreeView.h : interface of the CDirTreeView class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_DIRTREEVIEW_H__DB685468_4F32_11D4_85C6_00A0CC253EAC__INCLUDED_)
#define AFX_DIRTREEVIEW_H__DB685468_4F32_11D4_85C6_00A0CC253EAC__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "ExplorerDoc.h"
#include "DirListView.h"
class CDummyDoc;
class CDirTreeView : public CTreeView
{
protected: // create from serialization only
CDirTreeView();
DECLARE_DYNCREATE(CDirTreeView)
// Attributes
public:
CDummyDoc* GetDocument();
public:
enum TreeModes
{
tmShort = 0,
tmDetail,
tmExpanded
};
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDirTreeView)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
virtual void OnInitialUpdate(); // called first time after construct
virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
//}}AFX_VIRTUAL
public:
void SetDirectoryName (CString& dir, bool Display = false);
private:
void DeleteNode (CString& NodeName);
void RefreshSelection();
void BuildPath(CString& path, HTREEITEM node);
void SelectStartDir(char * StartDir);
HTREEITEM InsertChild (HTREEITEM parent, char *label, int image, int selimage, HTREEITEM SortType);
void AddNode (const char * path, HTREEITEM node, int type, int mode);
void LoadTree();
void InitializeTree();
int GetIconIndex (WIN32_FIND_DATA fd);
// Implementation
public:
virtual ~CDirTreeView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
CString & GetCurrentDirectory();
//{{AFX_MSG(CDirTreeView)
afx_msg void OnDestroy();
afx_msg void OnItemexpanded(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnSelchanged(NMHDR* pNMHDR, LRESULT* pResult);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
bool m_bInitialized;
CImageList m_Images;
int m_nLevel;
CString m_StartPath;
friend class CDirListView;
};
#ifndef _DEBUG // debug version in DirTreeView.cpp
inline CDummyDoc* CDirTreeView::GetDocument()
{ return (CDummyDoc*)m_pDocument; }
#endif
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DIRTREEVIEW_H__DB685468_4F32_11D4_85C6_00A0CC253EAC__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -