Esempio n. 1
0
void CSearchResultDlg::displayPage(int page, BOOL showStatus)
{
	if (page < 0 || page >= pageCount)
		return;

	if (showStatus) {
		CString str;
		str.Format(IDS_SEARCH_PAGE_NO, page + 1);
		SetDlgItemText(IDC_STATUS, str);
	}

	PtrList *l = pages[page];
	PtrList::iterator it;
	for (it = l->begin(); it != l->end(); ++it) {
		SEARCH_RESULT *p = (SEARCH_RESULT *) *it;

		int image = p->face;
		if (!p->online)
			image += NR_FACES;
		CString str;
		str.Format("%lu", p->uin);
		int i = m_ctlResult.InsertItem(m_ctlResult.GetItemCount(), str, image);
		m_ctlResult.SetItemData(i, (DWORD) p);
		m_ctlResult.SetItemText(i, 1, p->nick.c_str());
		m_ctlResult.SetItemText(i, 2, p->province.c_str());
	}
}
Esempio n. 2
0
void CSearchResultDlg::deleteResults()
{
	for (int i = 0; i < pageCount; i++) {
		PtrList *l = pages[i];
		PtrList::iterator it;
		for (it = l->begin(); it != l->end(); ++it)
			delete (SEARCH_RESULT *) *it;
		l->clear();
	}
	curPage = -1;
	pageCount = 0;
	startUIN = 0;
}
Esempio n. 3
0
void CGroupSearchResultPage::onGroupListReply(PtrList &l)
{
	CGroupSearchWizard *wiz = (CGroupSearchWizard *) GetParent();
	int type = wiz->typePage.getGroupType();

	PtrList::iterator it;
	for (it = l.begin(); it != l.end(); ++it) {
		GROUP_INFO *p = (GROUP_INFO *) *it;
		p->type = type;
		addResult(p);
	}

	GetDlgItem(IDC_REFRESH)->EnableWindow();
}