MCPcopy Create free account
hub / github.com/amule-project/amule / DrawClientItem

Method DrawClientItem

src/GenericClientListCtrl.cpp:752–1149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

750}
751
752void CGenericClientListCtrl::DrawClientItem(wxDC* dc, int nColumn, const wxRect& rect, ClientCtrlItem_Struct* item, int iTextOffset, int iBitmapOffset, int iBitmapXSize ) const
753{
754 wxDCClipper clipper( *dc, rect.GetX(), rect.GetY(), rect.GetWidth(), rect.GetHeight() );
755 wxString buffer;
756
757 const CClientRef& client = item->GetSource();
758
759 switch (nColumn) {
760 // Client name + various icons
761 case ColumnUserName: {
762 // Point will get shifted per drawing.
763
764 wxPoint point( rect.GetX(), rect.GetY() );
765
766 uint8 image = Client_Grey_Smiley;
767
768 if (item->GetType() != A4AF_SOURCE) {
769
770 switch (client.GetDownloadState()) {
771 case DS_CONNECTING:
772 case DS_CONNECTED:
773 case DS_WAITCALLBACK:
774 case DS_TOOMANYCONNS:
775 image = Client_Red_Smiley;
776 break;
777 case DS_ONQUEUE:
778 if (client.IsRemoteQueueFull()) {
779 image = Client_Grey_Smiley;
780 } else {
781 image = Client_Yellow_Smiley;
782 }
783 break;
784 case DS_DOWNLOADING:
785 case DS_REQHASHSET:
786 image = Client_Green_Smiley;
787 break;
788 case DS_NONEEDEDPARTS:
789 case DS_LOWTOLOWIP:
790 image = Client_Grey_Smiley; // Redundant
791 break;
792 default: // DS_NONE i.e.
793 image = Client_White_Smiley;
794 }
795
796 } else {
797 // Default (Client_Grey_Smiley)
798 }
799
800 m_ImageList.Draw(image, *dc, point.x, point.y + iBitmapOffset, wxIMAGELIST_DRAW_TRANSPARENT);
801
802 // Next
803
804 point.x += iBitmapXSize;
805
806 uint8 clientImage = Client_Unknown;
807
808 if ( client.IsFriend() ) {
809 clientImage = Client_Friend_Smiley;

Callers

nothing calls this directly

Calls 15

CastItoXBytesFunction · 0.85
CFormatClass · 0.85
GetTickCount64Function · 0.85
DownloadStateToStrFunction · 0.85
OriginToTextFunction · 0.85
GetXMethod · 0.80
GetYMethod · 0.80
GetWidthMethod · 0.80
GetHeightMethod · 0.80
GetPrintableMethod · 0.80
wxRectClass · 0.70
GetTypeMethod · 0.45

Tested by

no test coverage detected