?? evsdlgpathselect.cpp
字號(hào):
// EvsDlgPathSelect.cpp : implementation file
//
#include "stdafx.h"
#include "EvsDlgPathSelect.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
/////////////////////////////////////////////////////////////////////////////
// CEvsDlgPathSelect dialog
CEvsDlgPathSelect::CEvsDlgPathSelect(CWnd* pParent /*=NULL*/)
: CDialog(CEvsDlgPathSelect::IDD, pParent)
{
//{{AFX_DATA_INIT(CEvsDlgPathSelect)
m_csPath = _T("");
m_csNew = _T("");
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
}
void CEvsDlgPathSelect::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CEvsDlgPathSelect)
DDX_Text(pDX, IDC_EDITPATH, m_csPath);
// DDX_Text(pDX, IDC_EDITNEW, m_csNew);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CEvsDlgPathSelect, CDialog)
//{{AFX_MSG_MAP(CEvsDlgPathSelect)
ON_WM_PAINT()
ON_NOTIFY(TVN_ITEMEXPANDING, IDC_BROWSE_TREE, OnItemexpandingBrowseTree)
ON_NOTIFY(NM_RCLICK, IDC_BROWSE_TREE, OnRclickBrowseTree)
ON_NOTIFY(TVN_DELETEITEM, IDC_BROWSE_TREE, OnDeleteitemBrowseTree)
ON_NOTIFY(TVN_SELCHANGED, IDC_BROWSE_TREE, OnSelchangedBrowseTree)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CEvsDlgPathSelect message handlers
BOOL CEvsDlgPathSelect::OnInitDialog()
{
CDialog::OnInitDialog();
// Add "About..." menu item to system menu.
// IDM_ABOUTBOX must be in the system command range.
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
// TODO: Add extra initialization here
// TODO: Add extra initialization here
m_TreeCtl = (CUmShellTree*)GetDlgItem(IDC_BROWSE_TREE);
m_TreeCtl->EnableImages();
m_TreeCtl->PopulateTree();
// CString csCurDir;
// GetCurrentDirectory(256,csCurDir.GetBuffer(256));
// csCurDir.ReleaseBuffer();
// m_TreeCtl->TunnelTree(csCurDir);
m_TreeCtl->TunnelTree(m_csPath);
return TRUE; // return TRUE unless you set the focus to a control
}
// If you add a minimize button to your dialog, you will need the code below
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.
void CEvsDlgPathSelect::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
}
else
{
CDialog::OnPaint();
}
}
// The system calls this to obtain the cursor to display while the user drags
// the minimized window.
void CEvsDlgPathSelect::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 CEvsDlgPathSelect::OnRclickBrowseTree(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
m_TreeCtl->GetContextMenu(pNMHDR,pResult);
*pResult = 0;
}
void CEvsDlgPathSelect::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;
}
void CEvsDlgPathSelect::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_csPath = szPath;
UpdateData(FALSE);
}
*pResult = 0;
}
void CEvsDlgPathSelect::OnBnapply()
{
// TODO: Add your control notification handler code here
//GetSelectedFolderPath
CString cs;
m_TreeCtl->GetSelectedFolderPath(cs);
AfxMessageBox(cs);
//UpdateData();
//TunnelTree(m_csPath);
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -