本文整理汇总了C++中CKnownFile::GetPartCount方法的典型用法代码示例。如果您正苦于以下问题:C++ CKnownFile::GetPartCount方法的具体用法?C++ CKnownFile::GetPartCount怎么用?C++ CKnownFile::GetPartCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CKnownFile
的用法示例。
在下文中一共展示了CKnownFile::GetPartCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnDrawItem
//.........这里部分代码省略.........
textBuffer = file->GetFileName().GetPrintable();
if (file->GetFileRating() || file->GetFileComment().Length()) {
int image = Client_CommentOnly_Smiley;
if (file->GetFileRating()) {
image = Client_InvalidRating_Smiley + file->GetFileRating() - 1;
}
wxASSERT(image >= Client_InvalidRating_Smiley);
wxASSERT(image <= Client_CommentOnly_Smiley);
int imgWidth = 16;
theApp->amuledlg->m_imagelist.Draw(image, *dc, columnRect.x,
columnRect.y + 1, wxIMAGELIST_DRAW_TRANSPARENT);
// Move the text to the right
columnRect.x += (imgWidth + 4);
}
break;
case ID_SHARED_COL_SIZE:
textBuffer = CastItoXBytes(file->GetFileSize());
break;
case ID_SHARED_COL_TYPE:
textBuffer = GetFiletypeByName(file->GetFileName());
break;
case ID_SHARED_COL_PRIO:
textBuffer = PriorityToStr(file->GetUpPriority(), file->IsAutoUpPriority());
break;
case ID_SHARED_COL_ID:
textBuffer = file->GetFileHash().Encode();
break;
case ID_SHARED_COL_REQ:
textBuffer = CFormat(wxT("%u (%u)"))
% file->statistic.GetRequests()
% file->statistic.GetAllTimeRequests();
break;
case ID_SHARED_COL_AREQ:
textBuffer = CFormat(wxT("%u (%u)"))
% file->statistic.GetAccepts()
% file->statistic.GetAllTimeAccepts();
break;
case ID_SHARED_COL_TRA:
textBuffer = CastItoXBytes(file->statistic.GetTransferred())
+ wxT(" (") + CastItoXBytes(file->statistic.GetAllTimeTransferred()) + wxT(")");
break;
case ID_SHARED_COL_RTIO:
textBuffer = CFormat(wxT("%.2f")) % ((double)file->statistic.GetAllTimeTransferred() / file->GetFileSize());
break;
case ID_SHARED_COL_PART:
if ( file->GetPartCount() ) {
wxRect barRect(columnRect.x, columnRect. y + 1,
columnRect.width, columnRect.height - 2);
DrawAvailabilityBar(file, dc, barRect);
}
break;
case ID_SHARED_COL_CMPL:
if ( file->m_nCompleteSourcesCountLo == 0 ) {
if ( file->m_nCompleteSourcesCountHi ) {
textBuffer = CFormat(wxT("< %u")) % file->m_nCompleteSourcesCountHi;
} else {
textBuffer = wxT("0");
}
} else if (file->m_nCompleteSourcesCountLo == file->m_nCompleteSourcesCountHi) {
textBuffer = CFormat(wxT("%u")) % file->m_nCompleteSourcesCountLo;
} else {
textBuffer = CFormat(wxT("%u - %u")) % file->m_nCompleteSourcesCountLo % file->m_nCompleteSourcesCountHi;
}
break;
case ID_SHARED_COL_PATH:
if ( file->IsPartFile() ) {
textBuffer = _("[PartFile]");
} else {
textBuffer = file->GetFilePath().GetPrintable();
}
}
if (!textBuffer.IsEmpty()) {
dc->DrawText(textBuffer, columnRect.x, columnRect.y + textVOffset);
}
}
// Move to the next column
columnLeft += columnWidth;
}
}