Okay, I've created and populated a multi-column list, but I end up with the following:
http://qmx.dnsalias.com/private/screenshot1.png
Is there anyway that the items can line up across the rows instead of the first 5 items being on rows 1-5 and the next 5 being on rows 6-10? Any help would be greatly appreciated.
Problems with the 'MultiColumnList' Widget
Moderators: CEGUI MVP, CEGUI Team
- Legolas1681
- Not too shy to talk
- Posts: 24
- Joined: Fri Jan 28, 2005 00:32
- spannerman
- Home away from home
- Posts: 330
- Joined: Wed Jan 12, 2005 12:06
Re: Problems with the MultiColumnList Widget
Try using the addRow method to get the last row, then use that to add your columns. I havent tested this code, but you should get the idea:
Hope that helps
Code: Select all
/*
Where
- mcl is your MultiColumnList
- itmCol is a ListboxTextItem
- sel_img is your selection image
*/
int newRow;
// First Row
itmCol = new ListboxTextItem("item 1a");
itmCol->setSelectionBrushImage(sel_img);
newRow = (int)mcl->addRow(itmCol,0);
itmCol = new ListboxTextItem("item 1b");
itmCol->setSelectionBrushImage(sel_img);
mcl->setItem(itmCol, 1, newRow);
// Second Row
itmCol = new ListboxTextItem("item 2a");
itmCol->setSelectionBrushImage(sel_img);
newRow = (int)mcl->addRow(itmCol,0);
itmCol = new ListboxTextItem("item 2b");
itmCol->setSelectionBrushImage(sel_img);
mcl->setItem(itmCol, 1, newRow);
Hope that helps
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: Problems with the MultiColumnList Widget
Yeah, basically it's a (common) problem of understanding...
addRow does just that; it adds a row. You then need use setItem to set other items in the row as shown in spannermans code above.
CE
addRow does just that; it adds a row. You then need use setItem to set other items in the row as shown in spannermans code above.
CE
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
- Legolas1681
- Not too shy to talk
- Posts: 24
- Joined: Fri Jan 28, 2005 00:32
Re: Problems with the MultiColumnList Widget
Ahhh... ::enlightenment:: Thanx alot guys! Works great now. BTW, great job so far Eddie. I can't wait to see the other great features you implement next.
- Legolas1681
- Not too shy to talk
- Posts: 24
- Joined: Fri Jan 28, 2005 00:32
Re: Problems with the MultiColumnList Widget
Okay, now I've noticed there seems to be a bug in the multi-column list. When I have a large list that needs a vertical scrollbar, the last item in the list usually gets clipped like so:
http://qmx.dnsalias.com/private/screenshot1.png
Also, I've noticed that on long lists (with or without a scrollbar) the click-coords become inacurate the lower to the bottom of the list you get. For example, I'll click almost near the middle of one item, but the item directly below it will become selected instead. In the following screenshot, the point of the MouseCursor is where I clicked, but you can see that the item below the one I clicked got selected:
http://qmx.dnsalias.com/private/screenshot2.png
I've also noticed the above undesired behavior in other widgets that use scrollbars ( i.e. the multi-column editbox ).
Just thought I'd let you know so you can look into it.
http://qmx.dnsalias.com/private/screenshot1.png
Also, I've noticed that on long lists (with or without a scrollbar) the click-coords become inacurate the lower to the bottom of the list you get. For example, I'll click almost near the middle of one item, but the item directly below it will become selected instead. In the following screenshot, the point of the MouseCursor is where I clicked, but you can see that the item below the one I clicked got selected:
http://qmx.dnsalias.com/private/screenshot2.png
I've also noticed the above undesired behavior in other widgets that use scrollbars ( i.e. the multi-column editbox ).
Just thought I'd let you know so you can look into it.
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: Problems with the MultiColumnList Widget
Thanks for the report. This is probably linked to a similar issue in the standard Listbox widget. I have an idea what's causing these issues, if I am correct and it's an easy fix I'll do it over the next day or two.
CE.
CE.
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: Problems with the MultiColumnList Widget
Could you please try this patch and let me know if it resolves the issue for you.
Thanks.
Code: Select all
Index: src/elements/CEGUIListboxTextItem.cpp
===================================================================
RCS file: /cvsroot/crayzedsgui/cegui_mk2/src/elements/CEGUIListboxTextItem.cpp,v
retrieving revision 1.6
diff -u -r1.6 CEGUIListboxTextItem.cpp
--- src/elements/CEGUIListboxTextItem.cpp 5 Feb 2005 09:08:56 -0000 1.6
+++ src/elements/CEGUIListboxTextItem.cpp 28 Feb 2005 10:45:49 -0000
@@ -92,8 +92,8 @@
if (fnt != NULL)
{
- tmp.d_height = fnt->getLineSpacing();
- tmp.d_width = fnt->getTextExtent(d_itemText);
+ tmp.d_height = PixelAligned(fnt->getLineSpacing());
+ tmp.d_width = PixelAligned(fnt->getTextExtent(d_itemText));
}
return tmp;
Thanks.
- Legolas1681
- Not too shy to talk
- Posts: 24
- Joined: Fri Jan 28, 2005 00:32
Re: Problems with the MultiColumnList Widget
Oh yeah! Fixed it right up perfectly! Amazing how modifying two lines of code can make such a difference.
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: Problems with the MultiColumnList Widget
Cool. This fix has been put into CVS for both 0.2.0 and HEAD.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Return to “Modifications / Integrations / Customisations”
Who is online
Users browsing this forum: No registered users and 7 guests