Page 1 of 1

MultiColumnList headers problem

Posted: Sat Oct 24, 2009 11:35
by mukai
Hi.
I want to change MultiColumnList column headers font but have no idea how to...
I wrote this code:

Code: Select all

CEGUI::MultiColumnList* mclbox = (CEGUI::MultiColumnList*)CEGUI::WindowManager::getSingleton().getWindow("PlayersColumn");

    mclbox->setProperty("Font", "Hudini-6");
    mclbox->addColumn("Server name", 0, CEGUI::UDim(0.6f,0));
    mclbox->addColumn("Ping", 1, CEGUI::UDim(0.3f,0));

    for(int i=0; i<20; i++)
    {
        mclbox->addRow();
        mclbox->setItem(new MyListItem("Name"), 0, i);
        mclbox->setItem(new MyListItem("999"), 1, i);
    }

It changed all ListboxTextItem font but headers didn't.

Re: MultiColumnList headers problem

Posted: Sat Oct 24, 2009 16:31
by CrazyEddie
This is a bit of a 'missing feature' TBH (though I think it's maybe the first time someone mentioned it!).

I think the only way to do this is to access the individual ListHeaderSegment windows and set the font on them directly. If the font is known ahead of time, and will be the same for all lists, you could alternatively kind of 'hard wire' the font property in the appropriate WidgetLook definiton in the looknfeel XML.

To get the segment windows, they are named... <ListName>__auto_listheader____auto_seg_<Seg Sequence>
Where <ListName> is obviously the name of the MCL, and <Seg Sequence> is a number that corresponds to the creation of the segment ("0" for the first created segment, and so on - this count is not an id or index number and continues regardless of removed or deleted segments).

HTH

CE.