Page 1 of 1

How find Column's ListboxItem of MultiColumnList?

Posted: Sun Dec 07, 2008 13:50
by yuunanase
My English is very poor
I hope you know my mean

Code:
mrankingbrothers =(CEGUI::MultiColumnList*)cewin->getWindow((CEGUI::utf8*)"BattleRoot/RankingBrothers");
mrankingbrothers->addColumn("Name",0,CEGUI::UDim(0.3f, 0.0f));
mrankingbrothers->addColumn("Score", 1, CEGUI::UDim(0.55f, 0.0f));
mrankingbrothers->setUserColumnSizingEnabled(FALSE);


//addrow...
CEGUI::ListboxItem* nameItem;
int id=0;
string name="abc";

nameItem = new CEGUI::ListboxTextItem(int2str(id));
unsigned int row = mcl->addRow();
mcl->setItem(nameItem, 0, row);

nameItem = new CEGUI::ListboxTextItem(name);
mcl->setItem(nameItem, 1, row); <<-----this nameItem,I want to find



then,How find mcl.row(0,1) ListboxItem*
I don't have find any function for this

Please,Tell me

Posted: Sun Dec 07, 2008 15:50
by CrazyEddie
Hi,

I'm not sure what inputs you want to give (such as 'name' string, pointer to ListboxItem, something else?), nor what outputs you're wanting (pointer to item, grid reference?).

If you want to find an item with a specified string, you can use MultiColumnList::findListItemWithText which you pass in a string and get back a pointer to the item.

If you have the item and want the grid location, you can use MultiColumnList::getItemGridReference

If these answers are no good, please specify what information you have that you can pass as input, and what you want back as output.

CE.

thanks

Posted: Mon Dec 08, 2008 02:32
by yuunanase
I find CEGUI::getItemAtGridReference

thanks

Posted: Mon Dec 08, 2008 12:58
by CrazyEddie
Aha, the one option I failed to mention :) Glad you found it anyway.