📄 gridtreecell.cpp
字号:
/*****************************************************************************
COPYRIGHT (C) 2000, Ken Bertelson <kenbertelson@hotmail.com>
*****************************************************************************/
#include "stdafx.h"
#include "..\Include\GridTreeCell.h"
#include "..\Include\GridCtrl.h"
#include "..\Include\InPlaceEdit.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
IMPLEMENT_DYNCREATE(CGridTreeCell, CGridTreeCellBase)
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CGridTreeCell::CGridTreeCell()
: CGridTreeCellBase()
{
}
CGridTreeCell::~CGridTreeCell()
{
}
void CGridTreeCell::Reset()
{
m_strText.Empty();
}
BOOL CGridTreeCell::Edit(int nRow, int nCol, CRect rect, CPoint /* point */, UINT nID, UINT nChar)
{
ASSERT( m_pTreeColumn != NULL);
DWORD dwStyle = ES_LEFT;
if (GetFormat() & DT_RIGHT)
dwStyle = ES_RIGHT;
else if (GetFormat() & DT_CENTER)
dwStyle = ES_CENTER;
m_ucEditing = TRUE;
// InPlaceEdit auto-deletes itself
CGridCtrl* pGrid = GetGrid();
m_pTreeColumn->SetEditWnd( new CInPlaceEdit(pGrid, rect, dwStyle, nID, nRow, nCol, GetText(), nChar) );
return TRUE;
}
void CGridTreeCell::EndEdit()
{
CWnd* pEditWnd = m_pTreeColumn->GetEditWnd();
if (pEditWnd)
((CInPlaceEdit*)(pEditWnd))->EndEdit();
m_pTreeColumn->SetEditWnd( NULL);
}
void CGridTreeCell::OnEndEdit()
{
EndEdit();
m_ucEditing = FALSE;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -