本文整理汇总了C++中CKnownFile::IsAutoUpPriority方法的典型用法代码示例。如果您正苦于以下问题:C++ CKnownFile::IsAutoUpPriority方法的具体用法?C++ CKnownFile::IsAutoUpPriority怎么用?C++ CKnownFile::IsAutoUpPriority使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CKnownFile
的用法示例。
在下文中一共展示了CKnownFile::IsAutoUpPriority方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawItem
//.........这里部分代码省略.........
}
else {
if (client->credits->GetScoreRatio(client/*->GetIP()*/) > 1)
//==> Xman CreditSystem [shadow2004]
image = 2;
else
image = 0;
}
POINT point = {cur_rec.left, cur_rec.top+1};
imagelist.Draw(dc,image, point, ILD_NORMAL | ((client->Credits() && client->Credits()->GetCurrentIdentState(client->GetIP()) == IS_IDENTIFIED) ? INDEXTOOVERLAYMASK(1) : 0));
Sbuffer = client->GetUserName();
cur_rec.left +=20;
dc.DrawText(Sbuffer,Sbuffer.GetLength(),&cur_rec,DLC_DT_TEXT);
cur_rec.left -=20;
break;
}
case 1:
if(file)
Sbuffer = file->GetFileName();
else
Sbuffer = _T("?");
break;
case 2:
if(file) {
switch (file->GetUpPriority()) {
case PR_VERYLOW : {
Sbuffer = GetResString(IDS_PRIOVERYLOW);
break;
}
case PR_LOW : {
if( file->IsAutoUpPriority() )
Sbuffer = GetResString(IDS_PRIOAUTOLOW);
else
Sbuffer = GetResString(IDS_PRIOLOW);
break;
}
case PR_NORMAL : {
if( file->IsAutoUpPriority() )
Sbuffer = GetResString(IDS_PRIOAUTONORMAL);
else
Sbuffer = GetResString(IDS_PRIONORMAL);
break;
}
case PR_HIGH : {
if( file->IsAutoUpPriority() )
Sbuffer = GetResString(IDS_PRIOAUTOHIGH);
else
Sbuffer = GetResString(IDS_PRIOHIGH);
break;
}
case PR_VERYHIGH : {
Sbuffer = GetResString(IDS_PRIORELEASE);
break;
}
default:
Sbuffer.Empty();
}
}
else
Sbuffer = _T("?");
break;
case 3:
Sbuffer.Format(_T("%i"),client->GetScore(false,false,true));
示例2: OnDrawItem
void CSharedFilesCtrl::OnDrawItem( int item, wxDC* dc, const wxRect& rect, const wxRect& rectHL, bool highlighted )
{
CKnownFile *file = (CKnownFile*)GetItemData(item);
wxASSERT( file );
if ( highlighted ) {
CMuleColour newcol(GetFocus() ? wxSYS_COLOUR_HIGHLIGHT : wxSYS_COLOUR_BTNSHADOW);
dc->SetBackground(newcol.Blend(125).GetBrush());
dc->SetTextForeground( CMuleColour(wxSYS_COLOUR_HIGHLIGHTTEXT));
// The second blending goes over the first one.
dc->SetPen(newcol.Blend(65).GetPen());
} else {
dc->SetBackground( CMuleColour(wxSYS_COLOUR_LISTBOX).GetBrush() );
dc->SetTextForeground(CMuleColour(wxSYS_COLOUR_WINDOWTEXT));
dc->SetPen(*wxTRANSPARENT_PEN);
}
dc->SetBrush(dc->GetBackground());
dc->DrawRectangle(rectHL);
dc->SetPen(*wxTRANSPARENT_PEN);
// Offset based on the height of the fonts
const int textVOffset = ( rect.GetHeight() - dc->GetCharHeight() ) / 2;
// Empty space to each side of a column
const int SPARE_PIXELS_HORZ = 4;
// The leftmost position of the current column
int columnLeft = 0;
for ( int i = 0; i < GetColumnCount(); ++i ) {
const int columnWidth = GetColumnWidth(i);
if (columnWidth > 2*SPARE_PIXELS_HORZ) {
wxRect columnRect(
columnLeft + SPARE_PIXELS_HORZ, rect.y,
columnWidth - 2 * SPARE_PIXELS_HORZ, rect.height);
wxDCClipper clipper(*dc, columnRect);
wxString textBuffer;
switch ( i ) {
case ID_SHARED_COL_NAME:
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;
//.........这里部分代码省略.........
示例3: DrawItem
//.........这里部分代码省略.........
if (client->credits->GetScoreRatio(client->GetIP()) > 1)
image = 2;
else
image = 0;
}
uint32 nOverlayImage = 0;
if ((client->Credits() && client->Credits()->GetCurrentIdentState(client->GetIP()) == IS_IDENTIFIED))
nOverlayImage |= 1;
if (client->IsObfuscatedConnectionEstablished())
nOverlayImage |= 2;
int iIconPosY = (cur_rec.Height() > 16) ? ((cur_rec.Height() - 16) / 2) : 1;
POINT point = {cur_rec.left, cur_rec.top + iIconPosY};
imagelist.Draw(dc,image, point, ILD_NORMAL | INDEXTOOVERLAYMASK(nOverlayImage));
Sbuffer = client->GetUserName();
cur_rec.left += 20;
dc.DrawText(Sbuffer, Sbuffer.GetLength(), &cur_rec, DLC_DT_TEXT);
cur_rec.left -= 20;
break;
}
case 1:
if(file)
Sbuffer = file->GetFileName();
else
Sbuffer = _T("?");
break;
case 2:
if(file){
switch (file->GetUpPriority()) {
case PR_VERYLOW : {
Sbuffer = GetResString(IDS_PRIOVERYLOW);
break; }
case PR_LOW : {
if( file->IsAutoUpPriority() )
Sbuffer = GetResString(IDS_PRIOAUTOLOW);
else
Sbuffer = GetResString(IDS_PRIOLOW);
break; }
case PR_NORMAL : {
if( file->IsAutoUpPriority() )
Sbuffer = GetResString(IDS_PRIOAUTONORMAL);
else
Sbuffer = GetResString(IDS_PRIONORMAL);
break; }
case PR_HIGH : {
if( file->IsAutoUpPriority() )
Sbuffer = GetResString(IDS_PRIOAUTOHIGH);
else
Sbuffer = GetResString(IDS_PRIOHIGH);
break; }
case PR_VERYHIGH : {
Sbuffer = GetResString(IDS_PRIORELEASE);
break; }
default:
Sbuffer.Empty();
}
}
else
Sbuffer = _T("?");
break;
case 3:
Sbuffer.Format(_T("%i"),client->GetScore(false,false,true));
break;
case 4:
if (client->HasLowID()){
if (client->m_bAddNextConnect)
示例4: OnRightClick
void CSharedFilesCtrl::OnRightClick(wxListEvent& event)
{
long item_hit = CheckSelection(event);
if ( (m_menu == NULL) && (item_hit != -1)) {
m_menu = new wxMenu(_("Shared Files"));
wxMenu* prioMenu = new wxMenu();
prioMenu->AppendCheckItem(MP_PRIOVERYLOW, _("Very low"));
prioMenu->AppendCheckItem(MP_PRIOLOW, _("Low"));
prioMenu->AppendCheckItem(MP_PRIONORMAL, _("Normal"));
prioMenu->AppendCheckItem(MP_PRIOHIGH, _("High"));
prioMenu->AppendCheckItem(MP_PRIOVERYHIGH, _("Very High"));
prioMenu->AppendCheckItem(MP_POWERSHARE, _("Release"));
prioMenu->AppendCheckItem(MP_PRIOAUTO, _("Auto"));
m_menu->Append(0,_("Priority"),prioMenu);
m_menu->AppendSeparator();
CKnownFile* file = (CKnownFile*)GetItemData(item_hit);
if (file->GetFileComment().IsEmpty() && !file->GetFileRating()) {
m_menu->Append(MP_CMT, _("Add Comment/Rating"));
} else {
m_menu->Append(MP_CMT, _("Edit Comment/Rating"));
}
m_menu->AppendSeparator();
m_menu->Append(MP_RENAME, _("Rename"));
m_menu->AppendSeparator();
if (file->GetFileName().GetExt() == wxT("emulecollection")) {
m_menu->Append( MP_ADDCOLLECTION, _("Add files in collection to transfer list"));
m_menu->AppendSeparator();
}
m_menu->Append(MP_GETMAGNETLINK,_("Copy magnet &URI to clipboard"));
m_menu->Append(MP_GETED2KLINK,_("Copy eD2k &link to clipboard"));
m_menu->Append(MP_GETSOURCEED2KLINK,_("Copy eD2k link to clipboard (&Source)"));
m_menu->Append(MP_GETCRYPTSOURCEDED2KLINK,_("Copy eD2k link to clipboard (Source) (&With Crypt options)"));
m_menu->Append(MP_GETHOSTNAMESOURCEED2KLINK,_("Copy eD2k link to clipboard (&Hostname)"));
m_menu->Append(MP_GETHOSTNAMECRYPTSOURCEED2KLINK,_("Copy eD2k link to clipboard (Hostname) (With &Crypt options)"));
m_menu->Append(MP_GETAICHED2KLINK,_("Copy eD2k link to clipboard (&AICH info)"));
m_menu->Append(MP_WS,_("Copy feedback to clipboard"));
m_menu->Enable(MP_GETAICHED2KLINK, file->HasProperAICHHashSet());
m_menu->Enable(MP_GETHOSTNAMESOURCEED2KLINK, !thePrefs::GetYourHostname().IsEmpty());
m_menu->Enable(MP_GETHOSTNAMECRYPTSOURCEED2KLINK, !thePrefs::GetYourHostname().IsEmpty());
int priority = file->IsAutoUpPriority() ? PR_AUTO : file->GetUpPriority();
prioMenu->Check(MP_PRIOVERYLOW, priority == PR_VERYLOW);
prioMenu->Check(MP_PRIOLOW, priority == PR_LOW);
prioMenu->Check(MP_PRIONORMAL, priority == PR_NORMAL);
prioMenu->Check(MP_PRIOHIGH, priority == PR_HIGH);
prioMenu->Check(MP_PRIOVERYHIGH,priority == PR_VERYHIGH);
prioMenu->Check(MP_POWERSHARE, priority == PR_POWERSHARE);
prioMenu->Check(MP_PRIOAUTO, priority == PR_AUTO);
PopupMenu( m_menu, event.GetPoint() );
delete m_menu;
m_menu = NULL;
}
}