[SOLVED] Userdata is lost after removeRow (MultiColumnList)

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

saejox
Just popping in
Just popping in
Posts: 8
Joined: Sun Nov 20, 2011 18:17

[SOLVED] Userdata is lost after removeRow (MultiColumnList)

Postby saejox » Thu Dec 29, 2011 20:31

Hi,

after I call removeRow only once on a single row like this;

Code: Select all

for(uint j=0; j < bag->getRowCount(); ++j)
               {
                  CEGUI::ListboxItem *listitem = bag->getItemAtGridReference(CEGUI::MCLGridRef(j,0));
                  if(listitem->getUserData() == static_cast<void*>(item))
                  {
                     bag->removeRow(j);
                     break;
                  }
               }




every listitems userdata in multicolumlist is set to userdata of the one just below it. all listitems are affected by it.

i fill the multicolumnlist like this

Code: Select all

unsigned int mRow = mListBox->addRow();
      CEGUI::ListboxTextItem* item = new CEGUI::ListboxTextItem(c1, 0);
      mListBox->setItem(item, 0, mRow);
      item->setSelected(isSelected);
      item->setSelectionBrushImage( "TaharezLook", "MultiListSelectionBrush");
      item->setUserData(data);


in short, userdata of every listbox item below the deleted one are changed.
what i am doing wrong ?
thank you

edit: i'm using cegui 0.7.5 vc++9. problem is present in both debug and relase builds.

saejox
Just popping in
Just popping in
Posts: 8
Joined: Sun Nov 20, 2011 18:17

Re: [SOLVED] Userdata is lost after removeRow (MultiColumnLi

Postby saejox » Fri Dec 30, 2011 16:47

solution was here;

viewtopic.php?f=3&t=4360


Return to “Help”

Who is online

Users browsing this forum: No registered users and 14 guests