ListHeader::getSortSegment Exception

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
TheBren
Just popping in
Just popping in
Posts: 3
Joined: Thu Apr 07, 2005 05:21
Location: 0, 0, 0

ListHeader::getSortSegment Exception

Postby TheBren » Thu Apr 07, 2005 05:28

I'm getting an exception when I try to add an item to a MultiColumnList:

ListHeader::getSortSegment - Sort segment was NULL! (No segments are attached to the ListHeader?)

It happens when I call MultiColumnList::insertRow().

I tried calling MultiColumnList::setSortColumn(0), same error.

I have no idea what I'm doing really. Just sorta feeling my way along. Are there any docs or samples for MultiColumnList? Anyone have any suggestions?

Thanks!

User avatar
gcarlton
Just can't stay away
Just can't stay away
Posts: 149
Joined: Wed Jan 12, 2005 12:06

Re: ListHeader::getSortSegment Exception

Postby gcarlton » Thu Apr 07, 2005 06:56

Here's what I do. First, set up your columns:

Code: Select all

float fTotalWidth = 0.99f;
float fDivider = 0.70f;
m_pSettings->addColumn("Setting", COLUMN_NAME, fDivider);
m_pSettings->addColumn("Value", COLUMN_VALUE, (fTotalWidth-fDivider));
m_pSettings->setSelectionMode(CEGUI::MultiColumnList::RowSingle);


Then, add your elements:

Code: Select all

void AddSetting(int a_iIndex, const utf8* a_szName, const utf8* a_szValue, bool a_bChangedColour)
{
  uint32 iRow = m_pSettings->addRow();
   
  static uint32 s_iNormalColour = MakeXRGB(200, 200, 200);
  static uint32 s_iChangedColour = MakeXRGB(200, 255, 255);
   
  CEGUI::ListboxTextItem* pName = ANew_Gui CEGUI::ListboxTextItem(a_szName, a_iIndex);
  pName->setSelectionBrushImage("TaharezLook", "ListboxSelectionBrush");
  pName->setTextColours(CEGUI::colour(s_iNormalColour));
  m_pSettings->setItem(pName, COLUMN_NAME, iRow);
   
  CEGUI::ListboxTextItem* pValue = ANew_Gui CEGUI::ListboxTextItem(a_szValue, a_iIndex);
  pValue->setSelectionBrushImage("TaharezLook", "ListboxSelectionBrush");
  pValue->setTextColours(CEGUI::colour(a_bChangedColour ? s_iChangedColour : s_iNormalColour));
  m_pSettings->setItem(pValue, COLUMN_VALUE, iRow);
}

User avatar
TheBren
Just popping in
Just popping in
Posts: 3
Joined: Thu Apr 07, 2005 05:21
Location: 0, 0, 0

Re: ListHeader::getSortSegment Exception

Postby TheBren » Sun Apr 10, 2005 18:42

I was using CELayoutEditor to create the parent MultiColumnList and then trying to add the headers/list to the XML manually. I should probably have mentioned this.

So now I have the MultiColumnList in XML and add the columns through code as you suggested, and it works fine. Thanks!

How do I apply my own scheme? It appears to be using WindowsLook by default.


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 3 guests