📄 filetree.cpp
字号:
// FileTree.cpp : implementation file
//
#include "stdafx.h"
#include "Client.h"
#include "FileTree.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CFileTree
CFileTree::CFileTree()
{
}
CFileTree::~CFileTree()
{
}
BEGIN_MESSAGE_MAP(CFileTree, CTreeCtrl)
//{{AFX_MSG_MAP(CFileTree)
ON_WM_RBUTTONDOWN()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CFileTree message handlers
void CFileTree::SetMenuID(UINT nID)
{
m_menuID = nID;
}
UINT CFileTree::GetMenuID()
{
return m_menuID;
}
void CFileTree::OnRButtonDown(UINT nFlags, CPoint point)
{
CTreeCtrl::OnRButtonUp(nFlags, point);
HTREEITEM hItem = HitTest(point, &nFlags);
CTreeCtrl::Select( hItem, TVGN_CARET );
CRect Rect;
GetItemRect(hItem, Rect, TRUE);
if( point.x>=Rect.left && point.x<=Rect.right )
{
GetClientRect(Rect);
ClientToScreen(Rect);
point.Offset(Rect.TopLeft());
CMenu menu;
if( !GetParentItem( hItem ) )
//VERIFY(menu.LoadMenu(m_menuID));
return ;
else if( !GetParentItem( GetParentItem( hItem ) ) )
VERIFY(menu.LoadMenu(m_menuID));
else return;
CMenu* pPopup = menu.GetSubMenu(0);
ASSERT(pPopup != NULL);
CWnd* pWndPopupOwner = this;
while (pWndPopupOwner->GetStyle() & WS_CHILD)
pWndPopupOwner = pWndPopupOwner->GetParent();
pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, point.x, point.y,
pWndPopupOwner);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -