Exemple #1
0
CUIListBoxItem* CUIListBox::GetItemByTAG(u32 tag_val)
{
	for(WINDOW_LIST_it it = m_pad->GetChildWndList().begin(); m_pad->GetChildWndList().end()!=it; ++it)
	{
		CUIListBoxItem* item = smart_cast<CUIListBoxItem*>(*it);
		if (item)
		{
			if (item->GetTAG() == tag_val)
				return item;
		}
		
	}
	return NULL;
}
Exemple #2
0
int CUIListBox::GetIdxByTAG(u32 tag_val)
{
	int result = -1;

	for(WINDOW_LIST_it it = m_pad->GetChildWndList().begin(); m_pad->GetChildWndList().end()!=it; ++it)
	{
		CUIListBoxItem* item = smart_cast<CUIListBoxItem*>(*it);
		if (item)
		{
			if(result==-1)	result=0;
			else			++result;

			if (item->GetTAG() == tag_val)
				break;
		}
	}
	return result;
}