gridcelltext.cpp

来自「此次上传的使linux下的文件传输协议」· C++ 代码 · 共 75 行

CPP
75
字号
// GridCellText.cpp: implementation of the CGridCellText class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "Prog.h"
#include "GridCellText.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

IMPLEMENT_SERIAL(CGridCellText, CGridCell, 0)

CGridCellText::CGridCellText()
{
	CGridCell::CGridCell();
	m_nDataType=JnGridChar;
	m_crFg=CLR_DEFAULT;      //前景颜色
	m_crBk=CLR_DEFAULT;      //背景颜色
	m_sText=_T("");
	m_nLenght=-1;                         //可以显示很长的长度
	m_nFormat=JnDrawTextVCenLeft;
}

CGridCellText::~CGridCellText()
{

}

void CGridCellText::Serialize( CArchive& ar )
{
	ASSERT_VALID(this);

	CGridCell::Serialize(ar);

	int n;
	long l;
	if (ar.IsStoring())
	{
		ar << m_sText;
		n=m_nDataType;
		ar << n;
		l=m_crFg;
		ar << l;
		l=m_crBk;
		ar << l;
		n=m_nFormat;
		ar <<n;
		ar << m_nLenght;
		ar.Write(&lfFont,sizeof(LOGFONT));
	}
	else
	{
		ar >> m_sText;
		ar >> n;
		m_nDataType=(GridDataTypeEnum)n;
		ar >> l;
		m_crFg=l;
		ar >> l;
		m_crBk=l;
		ar >> n;
		m_nFormat=(GridDrawTextTypeEnum)n;
		ar >> m_nLenght;
		ar.Read(&lfFont,sizeof(LOGFONT));
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?