|
/*****************************************************************************
COPYRIGHT (C) 2000, Ken Bertelson <kenbertelson@hotmail.com>
*****************************************************************************/
#include "stdafx.h"
#include "GridTreeCell.h"
#include "..\GRIDCTRL_SRC\GridCtrl.h"
#include "..\GRIDCTRL_SRC\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;
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Began programming in 1968 on a Wang 720. Move to Fortran and began developing FEM (finite element model) applications on an IBM 360 in 1973. Developed custom FEM editors for most of my career until 1995.