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


C++ CKnownFile::GetPopularityRatio方法代码示例

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


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

示例1: DrawItem


//.........这里部分代码省略.........
					strBuffer = _T("");
				break;

			case QLCOL_PROGRESS:
			{
				if (pClient->GetUpPartCount() && g_App.m_pPrefs->IsUploadPartsEnabled())
				{
					if (!bMeasuring)
					{
						RECT	r2;

						r2.bottom = r.bottom - 1;
						r2.top = r.top + 1;
						r2.right = r.right + LIST_CELL_PADDING / 2;
						r2.left = r.left - LIST_CELL_PADDING / 2;
						pClient->DrawUpStatusBar(dc, &r2, g_App.m_pPrefs->UseFlatBar());
					}
					iWidth = 300;
				}
				break;
			}
			case QLCOL_QLRATING:
				strBuffer.Format(_T("%u"), pClient->GetScore(true));
				break;

			case QLCOL_SCORE:
			//	Note: actually the client, which is downloading from us should be not in WaitingQueue
				if (pClient->IsDownloading())
					strBuffer = _T("-");
				else
					strBuffer.Format((pClient->IsAddNextConnect()) ? _T("%u*") : _T("%u"), pClient->GetScore());
				break;

			case QLCOL_SFRATIO:
				if (pKnownFile != NULL)
					strBuffer.Format(_T("%.2f"), pKnownFile->GetSizeRatio());
				else
					strBuffer = _T("-");
				break;

			case QLCOL_RFRATIO:
				if (pKnownFile != NULL)
					strBuffer.Format(_T("%.2f"), pKnownFile->GetPopularityRatio());
				else
					strBuffer = _T("-");
				break;

			case QLCOL_TIMESASKED:
				strBuffer.Format(_T("%u"), pClient->GetAskedCount());
				break;

			case QLCOL_LASTSEEN:
				strBuffer = CastSecondsToHM((GetTickCount() - pClient->GetLastUpRequest())/1000);
				break;

			case QLCOL_ENTEREDQUEUE:
				strBuffer = CastSecondsToHM((GetTickCount() - pClient->GetWaitStartTime())/1000);
				break;

			case QLCOL_BANNED:
				strBuffer = YesNoStr(pClient->IsBanned());
				break;

			case QLCOL_COUNTRY:
				strBuffer = pClient->GetCountryName();
				break;
		}
		if (iColumn != QLCOL_PROGRESS)
		{
			dc->DrawText(strBuffer, &r, iCalcFlag);
			if (bMeasuring && !strBuffer.IsEmpty())
				iWidth += r.right - r.left + 1;
		}
		r.left = r.right + LIST_CELL_PADDING;

		if (bMeasuring)
		{
		//	Pin the column widths at some reasonable value
			if (iWidth < 40)
				iWidth = 40;
			if (iWidth > m_iColumnMaxWidths[m_iMeasuringColumn])
				m_iColumnMaxWidths[m_iMeasuringColumn] = iWidth;
		}
	}
//	Draw rectangle around selected item(s)
	if (lpDrawItemStruct->itemState & ODS_SELECTED)
	{
		RECT	rOutline = lpDrawItemStruct->rcItem;
		CBrush	FrmBrush((bCtrlFocused) ? m_crFocusLine : m_crNoFocusLine);

		rOutline.left++;
		rOutline.right--;
		dc->FrameRect(&rOutline, &FrmBrush);
	}
	if (pOldFont)
		dc.SelectObject(pOldFont);
	if (crOldTextColor)
		dc.SetTextColor(crOldTextColor);
#undef LIST_CELL_PADDING
}
开发者ID:rusingineer,项目名称:EmulePlus,代码行数:101,代码来源:QueueListCtrl.cpp


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