CEGUI::MultiColumnList force to sort?

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
tomj
Just popping in
Just popping in
Posts: 1
Joined: Wed Jan 11, 2006 18:52

CEGUI::MultiColumnList force to sort?

Postby tomj » Thu Jan 12, 2006 08:09

Hi,

I have some pre-allocated items in CEGUI::MultiColumnList. When I actualize some of the items, sorting is not applied? Maybe I'm doing something wrong but I haven't found anything which could be able to force list to re-sort..
Init code:

CEGUI::MultiColumnList* lbp = SAFE_CAST<CEGUI::MultiColumnList*>(m_scene->GetGUIWindowManager()->
createWindow("TaharezLook/MultiColumnList", windowName + "/ListboxPlayers"));

if (lbp)
{
m_window->addChildWindow(lbp);

lbp->setSelectionMode(CEGUI::MultiColumnList::RowSingle);
lbp->setPosition(CEGUI::Point(0.05f, 0.08f));
lbp->setSize(CEGUI::Size(0.9f, 0.47f));

lbp->addColumn("Player", 0, 0.68f);
lbp->addColumn("Score", 1, 0.25f);

for(size_t i=0; i < m_maxPlayers; i++)
{
lbp->addRow();
}
for(size_t i=0; i < m_maxPlayers; i++)
{
lbp->setItem(new CEGUI::ListboxTextItem(""), 0, (CEGUI::uint)i);
lbp->setItem(new CEGUI::ListboxTextItem(""), 1, (CEGUI::uint)i);
}

lbp->setUserSortControlEnabled(true);
lbp->setSortColumn(1);
lbp->setSortDirection(CEGUI::ListHeaderSegment::Descending);
}

And Update code:

for(i = players.size(); i < m_maxPlayers; i++)
{
m_playersList->getItemAtGridReference(CEGUI::MCLGridRef((CEGUI::uint)i, 1))->setText("Anything in sort column");

}

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Re: CEGUI::MultiColumnList force to sort?

Postby lindquist » Thu Jan 12, 2006 12:25

from the api ref:
void handleUpdatedItemData (void)
Inform the list box that one or more attached ListboxItems have been externally modified, and the list should re-sync its internal state and refresh the display as needed.

http://www.cegui.org.uk/api_reference/c ... nList.html


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 5 guests