MultiColumnList headers problem

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

mukai
Just popping in
Just popping in
Posts: 6
Joined: Sat Oct 24, 2009 10:52

MultiColumnList headers problem

Postby mukai » Sat Oct 24, 2009 11:35

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.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: MultiColumnList headers problem

Postby CrazyEddie » Sat Oct 24, 2009 16:31

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.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 12 guests