当前位置: 首页>>代码示例>>C++>>正文


C++ Person::ToCString方法代码示例

本文整理汇总了C++中Person::ToCString方法的典型用法代码示例。如果您正苦于以下问题:C++ Person::ToCString方法的具体用法?C++ Person::ToCString怎么用?C++ Person::ToCString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Person的用法示例。


在下文中一共展示了Person::ToCString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnDraw

void CZarplataView::OnDraw(CDC* pDC)
{
	CZarplataDoc* pDoc = GetDocument();
	MyCollection* myColl = pDoc->myColl;
	ASSERT_VALID(pDoc);
	if (!pDoc)
		return;
	pDoc->table.Draw(pDC, myColl);
	pDoc->table.DrawCap(pDC);
	CBitmap* bitmap;
	if(myColl->isReverse)
		bitmap = tRed;
	else
		bitmap = tBlue;
	pDoc->table.drawTriangleSort(pDC, myColl, bitmap, tSort);
	if(myColl->GetLength() > 0)
	{
		CString summa;
		Person* p = myColl->getOnIndex(myColl->curMap, 1);
		summa = p->ToCString(myColl->getSumSalary());
		pDoc->table.DrawDedicated(pDC);
		pDoc->table.DrawCellar(pDC, pDoc->table.sumCell, summa);
	}
	else
		curCell = 0;
	
	//pDC->Rectangle(0, 0, 1390, 300); //
	
	// TODO: добавьте здесь код отрисовки для собственных данных
}
开发者ID:SergeyVorobiev,项目名称:ZP,代码行数:30,代码来源:ZarplataView.cpp

示例2: Draw

void CMyTable::Draw(CDC* pDC, MyCollection* coll)
{
	//pDC->MoveTo(X, Y);
	int startX = X, startY = Y + cellHeight, finishX, finishY;
	CRect rect;
	CPen aPen;
	aPen.CreatePen(PS_SOLID, 1, RGB(150, 150, 150));
	CPen* oldPen;
	oldPen = pDC->SelectObject(&aPen);
	coll->startPos = true;
	sumCell = 0;
	for(int i = 0; i < coll->GetLength(); i++)
	{
		Person* p = coll->getPerson();
		if(p == NULL)break;
		sumCell++;
		finishY = startY + cellHeight;
		for(int j = 0; j < 5; j++)
		{
			if(j == 0)
			{
				finishX = startX + 340;
				rect.SetRect(startX, startY, finishX + 1, finishY + 1);
				pDC->Rectangle(&rect);
				rect.SetRect(startX + 20, startY, finishX + 20 + 1, finishY + 1);
				pDC->SetTextColor(RGB(20, 20, 20));
				pDC->DrawTextW(p->getInitial(), &rect, DT_LEFT | DT_VCENTER | DT_SINGLELINE | DT_NOCLIP);
				//pDC->SelectObject(oldPen);
			}
			if(j == 1)
			{
				startX = finishX;
				finishX = startX + 145;
				rect.SetRect(startX, startY, finishX + 1, finishY + 1);
				pDC->Rectangle(&rect);
				CString str = p->ToCString(p->getSumHours());
				pDC->DrawTextW(str, &rect, DT_CENTER | DT_VCENTER | DT_SINGLELINE | DT_NOCLIP);
			}
			if(j == 2)
			{
				startX = finishX;
				finishX = startX + 145;
				rect.SetRect(startX, startY, finishX + 1, finishY + 1);
				pDC->Rectangle(&rect);
				CString str = p->ToCString(p->getTarif());
				str = str + ' ' + 'p';
				pDC->DrawTextW(str, &rect, DT_CENTER | DT_VCENTER | DT_SINGLELINE | DT_NOCLIP);
			}
			if(j == 3)
			{
				startX = finishX;
				finishX = startX + 340;
				rect.SetRect(startX, startY, finishX + 1, finishY + 1);
				pDC->Rectangle(&rect);
				CString str = p->ToCString(p->getSalary());
				str = str + ' ' + 'p';
				pDC->DrawTextW(str, &rect, DT_CENTER | DT_VCENTER | DT_SINGLELINE | DT_NOCLIP);
			}
			if(j == 4)
			{
				startX = finishX;
				finishX = startX + 340;
				rect.SetRect(startX, startY, finishX + 1, finishY + 1);
				pDC->Rectangle(&rect);
				CString str = p->ToCString(p->getId());
				pDC->DrawTextW(str, &rect, DT_CENTER | DT_VCENTER | DT_SINGLELINE | DT_NOCLIP);
			}
		}
		startX = X;
		startY += cellHeight;
	}
	pDC->SelectObject(oldPen);
}
开发者ID:SergeyVorobiev,项目名称:ZP,代码行数:73,代码来源:MyTable.cpp


注:本文中的Person::ToCString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。