wxString DictionaryListCtrl::OnGetItemText(long item, long column) const { Dictionary *dict = m_items[item]; if (column == 0) { return dict->GetName(); } else if (column == 1) { return DisplaySize(item); } return wxT(""); }
void Typewriter::DrawSymbol( const char* ac_pcCharacterName ) { m_pcoFont->SetSlug( *this, ac_pcCharacterName, m_dFontSize ); Draw(); SetPosition( m_oPosition.x + DisplaySize().x, m_oPosition.y ); double dSpace = m_dLetterSpacing * m_pcoFont->Em(); if( 0.0 != dSpace ) { m_pcoFont->SetTabSlug( *this, dSpace, m_dFontSize ); Draw(); SetPosition( m_oPosition.x + dSpace, m_oPosition.y ); } }
void CDLGsoap::DisplayerList() { m_list.DeleteAllItems(); soapList.clear(); if(0==ListTotal) { GetDlgItem(IDC_STATIC_INFO)->SetWindowText("共0条 1/1页"); InvalidateRect(printf_Rect, TRUE); return ; } unsigned long int si,ei; si=ListNow+1; if((ListNow+PAGE_MAX_NUM) < ListTotal) ei=ListNow+PAGE_MAX_NUM ; else ei=ListTotal; if(m_sreach.IsEmpty()) soapDB.SOAP_Read(soapList,si-1,ei-(si-1)); else soapDB.SOAP_ReadForSearch(m_sreach.GetBuffer(0),soapList,si-1,ei-(si-1)); if(soapList.size()<=0) return ; list<struct FILE_SOAP_READ_ST>::iterator beglist; char str[128]; int i=0; for(beglist=soapList.begin();beglist!=soapList.end();beglist++) { sprintf(str,"%I64u",beglist->file_nid); m_list.InsertItem( i,str); m_list.SetItemText(i,1,beglist->name); DisplaySize(beglist->filesize,str); m_list.SetItemText(i,2,str); m_list.SetItemText(i,3,beglist->ed2k); m_list.SetItemText(i,4,beglist->aich); m_list.SetItemText(i,5,beglist->btih); i++; } if(ListTotal%PAGE_MAX_NUM) { sprintf(str,ConvertString("共%d条 %d/%d页 每页%d条"), ListTotal, ListNow/PAGE_MAX_NUM+1,ListTotal/PAGE_MAX_NUM+1,PAGE_MAX_NUM); } else { sprintf(str,ConvertString("共%d条 %d/%d页 每页%d条"), ListTotal, ListNow/PAGE_MAX_NUM+1,ListTotal/PAGE_MAX_NUM,PAGE_MAX_NUM); } GetDlgItem(IDC_STATIC_INFO)->SetWindowText(str); InvalidateRect(printf_Rect, TRUE); UpdateData(FALSE); }
void CZogvmDlg::DisplayerList() { m_list.DeleteAllItems(); WinfileviewList.clear(); if(0==ListTotal) { GetDlgItem(IDC_STATIC_INFO)->SetWindowText("共0条 1/1页"); InvalidateRect(printf_Rect, TRUE); return ; } unsigned long int si,ei; si=ListNow+1; if((ListNow+PAGE_MAX_NUM) < ListTotal) ei=ListNow+PAGE_MAX_NUM ; else ei=ListTotal; switch(ModeFlag) { case MODE_DOUBLE: SQLDB.File_ReadDouble(WinfileviewList,si-1,ei-(si-1)); break; case MODE_FIND: if(m_sreach.IsEmpty()) SQLDB.File_Read(SQLstr,WinfileviewList,si-1,ei-(si-1)); else SQLDB.File_ReadForSearch(SQLstr,m_sreach.GetBuffer(0),WinfileviewList,si-1,ei-(si-1)); break; case MODE_TRASH: SQLDB.File_ReadTrash(WinfileviewList,si-1,ei-(si-1)); break; default:return ; } if(WinfileviewList.size()<=0) return ; list<struct FILE_VIEW_ST>::iterator beglist; char str[128]; int i=0; SYSTEMTIME systime; FILETIME temptime; ULARGE_INTEGER uli; for(beglist=WinfileviewList.begin();beglist!=WinfileviewList.end();beglist++) { //带复选框 LVS_EX_CHECKBOXES if(MAINTYPE_OTHER == beglist->file_data.maintype ) { m_list.InsertItem( i,beglist->hdd_data.serno,5); } else if( MAINTYPE_SUB == beglist->file_data.maintype) { m_list.InsertItem( i,beglist->hdd_data.serno,4); } else if(MAINTYPE_VIDEO == beglist->file_data.maintype ) { m_list.InsertItem( i,beglist->hdd_data.serno,2); } else if(MAINTYPE_MUSIC == beglist->file_data.maintype ) { m_list.InsertItem( i,beglist->hdd_data.serno,3); } m_list.SetItemText(i,1,beglist->hdd_data.mark); m_list.SetItemText(i,2,beglist->hdd_data.area); sprintf(str,"%I64u",beglist->file_data.file_nid); m_list.SetItemText(i,3,str); m_list.SetItemText(i,4,beglist->file_data.path); m_list.SetItemText(i,5,beglist->file_data.name); m_list.SetItemText(i,6, MainType2Str(beglist->file_data.maintype)); m_list.SetItemText(i,7,beglist->file_data.type); if(beglist->file_data.CreationTime) { uli.QuadPart=beglist->file_data.CreationTime; temptime.dwLowDateTime=uli.LowPart; temptime.dwHighDateTime=uli.HighPart; FileTimeToSystemTime(&temptime,&systime); sprintf(str,"%04d-%02d-%02d %02d:%02d:%02d", systime.wYear,systime.wMonth,systime.wDay, systime.wHour,systime.wMinute,systime.wSecond); m_list.SetItemText(i,8,str); } if(beglist->file_data.LastWriteTime) { uli.QuadPart=beglist->file_data.LastWriteTime; temptime.dwLowDateTime=uli.LowPart; temptime.dwHighDateTime=uli.HighPart; FileTimeToSystemTime(&temptime,&systime); sprintf(str,"%04d-%02d-%02d %02d:%02d:%02d", systime.wYear,systime.wMonth,systime.wDay, systime.wHour,systime.wMinute,systime.wSecond); m_list.SetItemText(i,9,str); } //sprintf(str,"%I64u",); DisplaySize(beglist->file_data.filesize,str); m_list.SetItemText(i,10,str); if(beglist->file_data.resolutionW && beglist->file_data.resolutionH) { sprintf(str,"%d*%d",beglist->file_data.resolutionW,beglist->file_data.resolutionH); m_list.SetItemText(i,11,str); } else m_list.SetItemText(i,11,""); if(beglist->file_data.filetime) { sprintf(str,"%d:%02d:%02d", beglist->file_data.filetime / 3600, (beglist->file_data.filetime % 3600) / 60, beglist->file_data.filetime % 60); m_list.SetItemText(i,12,str); } else m_list.SetItemText(i,12,""); if(beglist->hdd_data.insertflag) { m_list.SetItemText(i,13,"接入"); m_list.SetItem(i, 13, LVIF_IMAGE, NULL, 0, 0, 0, 0); } else { m_list.SetItemText(i,13,"脱机"); m_list.SetItem(i, 13, LVIF_IMAGE, NULL, 1, 0, 0, 0); } /* //名称 LV_ITEM lvitem; memset ((char *) &lvitem, 0, sizeof (LV_ITEM)); lvitem.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_STATE; lvitem.iItem = i; lvitem.iSubItem = 12; lvitem.stateMask = 0; lvitem.iImage =1; //显示不同的图标时,可以把一个int 变量赋给这个属性值 lvitem.pszText = "a"; m_list.SetItem (&lvitem); m_list.SetItem(i, 12, LVIF_IMAGE, NULL, 0, 0, 0, 0); */ m_list.SetItemText(i,14,beglist->file_data.zidian_3d); m_list.SetItemText(i,15,beglist->file_data.zidian_huazhi); m_list.SetItemText(i,16,beglist->file_data.zidian_fenbianlv); m_list.SetItemText(i,17,beglist->file_data.zidian_yazhi); m_list.SetItemText(i,18,beglist->file_data.zidian_year); m_list.SetItemText(i,19,beglist->file_data.md5); if(MODE_DOUBLE == ModeFlag) { sprintf(str,"%I64u",beglist->file_data.double_nid); m_list.SetItemText(i,20,str); } else m_list.SetItemText(i,20,"0"); i++; } if(ListTotal%PAGE_MAX_NUM) { sprintf(str,"共%d条 %d/%d页 每页%d条", ListTotal, ListNow/PAGE_MAX_NUM+1,ListTotal/PAGE_MAX_NUM+1,PAGE_MAX_NUM); } else { sprintf(str,"共%d条 %d/%d页 每页%d条", ListTotal, ListNow/PAGE_MAX_NUM+1,ListTotal/PAGE_MAX_NUM,PAGE_MAX_NUM); } GetDlgItem(IDC_STATIC_INFO)->SetWindowText(str); InvalidateRect(printf_Rect, TRUE); m_c_delete_trash=FALSE; UpdateData(FALSE); }
static int do_list_from_opened_pack_archive(unzFile uf, U_FILE * fileout, int filename_only) { uLong i; unz_global_info gi; int err; if (fileout == NULL) { fileout = U_STDOUT; } err = unzGetGlobalInfo(uf,&gi); if ((err != UNZ_OK) && (filename_only == 0)) { u_fprintf(fileout, "error %d with zipfile in unzGetGlobalInfo \n", err); } if (gi.number_entry != 0) { err = unzGoToFirstFile(uf); if ((err != UNZ_OK) && (filename_only == 0)) u_fprintf(fileout, "error %d with zipfile in unzGoToFirstFile \n", err); } if (filename_only == 0) { u_fprintf(fileout, " Length Method Size Ratio Date Time CRC-32 Name\n"); u_fprintf(fileout, " ------ ------ ---- ----- ---- ---- ------ ----\n"); } for (i=0;i<gi.number_entry;i++) { char filename_inzip[0x200]; unz_file_info file_info; uLong ratio=0; const char *string_method; char charCrypt=' '; err = unzGetCurrentFileInfo(uf,&file_info,filename_inzip,sizeof(filename_inzip),NULL,0,NULL,0); if (err!=UNZ_OK) { if (filename_only == 0) { u_fprintf(fileout, "error %d with zipfile in unzGetCurrentFileInfo\n", err); } break; } if (file_info.uncompressed_size>0) ratio = (uLong)((file_info.compressed_size*100)/file_info.uncompressed_size); /* display a '*' if the file is crypted */ if ((file_info.flag & 1) != 0) charCrypt='*'; if (file_info.compression_method==0) string_method="Stored"; else string_method="COMPRESSED!"; if (filename_only == 0) { DisplaySize(fileout, file_info.uncompressed_size, 7); if (filename_only == 0) { u_fprintf(fileout, " %6s%c", string_method, charCrypt); } DisplaySize(fileout, file_info.compressed_size, 7); u_fprintf(fileout, " %3lu%% %2.2lu-%2.2lu-%2.2lu %2.2lu:%2.2lu %8.8lx %s\n", ratio, (uLong)file_info.tmu_date.tm_mon + 1, (uLong)file_info.tmu_date.tm_mday, (uLong)file_info.tmu_date.tm_year % 100, (uLong)file_info.tmu_date.tm_hour, (uLong)file_info.tmu_date.tm_min, (uLong)file_info.crc, filename_inzip); } else { u_fprintf(fileout, "%s\n", filename_inzip); } if ((i+1)<gi.number_entry) { err = unzGoToNextFile(uf); if (err!=UNZ_OK) { u_fprintf(fileout, "error %d with zipfile in unzGoToNextFile\n", err); break; } } } return 0; }