本文整理汇总了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
}