how to auto update 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

watermoon
Just popping in
Just popping in
Posts: 5
Joined: Fri May 29, 2015 11:37

how to auto update MultiColumnList?

Postby watermoon » Fri May 29, 2015 12:08

Hi! I set values of ListboxTextItem on running time ,and I want to see change on my MultiColumnList.

Code: Select all

class MyListItem : public CEGUI::ListboxTextItem
{
public:
   MyListItem(const String& text, CEGUI::uint item_id = 0) :
     CEGUI::ListboxTextItem(text, item_id)
     {
        setSelectionBrushImage("Vanilla-Images/GenericBrush");
     }
};

CEGUI::MultiColumnList* multiList;
MyListItem* listItems[LIST_COUNT];

multiList=(CEGUI::MultiColumnList*)guiRoot->getChild(2);
   multiList->addColumn("attribute", 0, cegui_reldim(0.38f));
   multiList->addColumn("value ", 1, cegui_reldim(0.44f));

Ogre::String attributes[LIST_COUNT]={"Name","Id","test","test","test","test"};

   for(int i=0;i<LIST_COUNT;i++){
      multiList->addRow();

      multiList->setItem(new MyListItem(Ogre::String("[colour='FFFF6600']")+attributes[i]), 0, i);
      
      listItems[i]=new MyListItem("[colour='FFFF6600']");
      multiList->setItem(listItems[i],1,i);
   }



then i use following code to set values

Code: Select all

listItems[0]->setText("test");
listItems[1]->setText("test");


but nothing happens, how can i see changes in scene automatically?

another:
In ceed,I set autoRendingSurface of MultiColumnlist to true ,then it throws a exception, actually,it often throw exceptions when i use WindowsLook widgets

watermoon
Just popping in
Just popping in
Posts: 5
Joined: Fri May 29, 2015 11:37

Re: how to auto update MultiColumnList?

Postby watermoon » Fri May 29, 2015 12:58

sorry...
it changed but i didnit see it...
because the color of string and background are both white...

anyone knows how to change the background color of MultiColumnList,

I think white is not so cute

watermoon
Just popping in
Just popping in
Posts: 5
Joined: Fri May 29, 2015 11:37

Re: how to auto update MultiColumnList?

Postby watermoon » Fri May 29, 2015 13:02

oh......
actually it didn't change immediately, it changed when i clicked the MultiColumnList

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: how to auto update MultiColumnList?

Postby Ident » Fri May 29, 2015 18:23

Hi, first of all please use the EDIT function if nobody has replied yet instead of triple-posting.

Regarding the MLC, did you check the samples? MLCs are used in some. You can't see the selection unless you set a brush for each entry. The samples include a simple object-oriented solution for this.


watermoon wrote:In ceed,I set autoRendingSurface of MultiColumnlist to true ,then it throws a exception, actually,it often throw exceptions when i use WindowsLook widgets

This report is not helpful. Make a separate post and provide more info. Otherwise this is just useless information.
CrazyEddie: "I don't like GUIs"


Return to “Help”

Who is online

Users browsing this forum: No registered users and 8 guests