📄 viewdlg.cpp
字号:
// ViewDlg.cpp : implementation file
//
#include "stdafx.h"
#include "DeformAdj.h"
#include "ViewDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CViewDlg dialog
CViewDlg::CViewDlg(CWnd* pParent /*=NULL*/)
: CDialog(CViewDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CViewDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CViewDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CViewDlg)
DDX_Control(pDX, IDC_FILELIST, m_FileListCtl);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CViewDlg, CDialog)
//{{AFX_MSG_MAP(CViewDlg)
ON_NOTIFY(TVN_ITEMEXPANDING, IDC_BROWSE_TREE, OnItemexpandingBrowseTree)
ON_NOTIFY(NM_RCLICK, IDC_BROWSE_TREE, OnRclickBrowseTree)
ON_NOTIFY(TVN_SELCHANGED, IDC_BROWSE_TREE, OnSelchangedBrowseTree)
ON_NOTIFY(TVN_DELETEITEM, IDC_BROWSE_TREE, OnDeleteitemBrowseTree)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CViewDlg message handlers
BOOL CViewDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
m_TreeCtl = (CShellTree*)GetDlgItem(IDC_BROWSE_TREE);
m_TreeCtl->EnableImages();
m_TreeCtl->PopulateTree();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CViewDlg::OnItemexpandingBrowseTree(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
// TODO: Add your control notification handler code here
m_TreeCtl->OnFolderExpanding(pNMHDR,pResult);
*pResult = 0;
}
void CViewDlg::OnRclickBrowseTree(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
m_TreeCtl->GetContextMenu(pNMHDR,pResult);
*pResult = 0;
}
void CViewDlg::OnSelchangedBrowseTree(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
// TODO: Add your control notification handler code here
CString szPath;
if(m_TreeCtl->OnFolderSelected(pNMHDR,pResult,szPath))
{
m_FileListCtl.SetWindowText(szPath);
strdire = szPath;
}
*pResult = 0;
}
void CViewDlg::OnDeleteitemBrowseTree(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
// TODO: Add your control notification handler code here
m_TreeCtl->OnDeleteShellItem(pNMHDR,pResult);
*pResult = 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -