MultiColumnListBox vs ItemListbox

Forum for general chit-chat or off-topic discussion.

Moderators: CEGUI MVP, CEGUI Team

AlexThomas
Just popping in
Just popping in
Posts: 17
Joined: Mon Sep 28, 2009 17:28

MultiColumnListBox vs ItemListbox

Postby AlexThomas » Thu Oct 01, 2009 20:58

Hello,
I am in the process of converting one of my listboxes to a multicolumn listbox. My problem is that I am trying to be very diligent to keep all stylization/event subscription code out of the c++. However, because I am adding itemEntries to the listbox (and now ListboxTextItems to the MultiColumnListBox) dynamically I've been doing some workarounds in LUA.

Previously, my ItemListbox looked like this:

Code: Select all

<Window Type="WindowsLook/ItemListbox" Name="MapLoad/ListBox" >
   <Property Name="Font" Value="DejaVuSans-10" />
   <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
   <Property Name="UnifiedAreaRect" Value="{{0,17},{0,20},{1,-17},{1.0,-25}}" />
        <Event Name="AddedChild" Function="MapLoad_ListboxChildAdd" />
</Window>


Within that LUA function I was able to do any stylization of the added items, referencing them by the CEGUI.toWindowEventArgs(e).window. However, because the ListboxTextItems are (as I recall) not derived from the CEGUI::Window class, this does not appear to work.

Is there any other way to achieve this same sort of workaround for stylization outside of the c++ code? Or is there a more direct route, perhaps using the AutoWindow tag?

Any help is appreciated.

Alex

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

Re: MultiColumnListBox vs ItemListbox

Postby CrazyEddie » Sat Oct 03, 2009 08:25

Hi,

First, I have to say this post is going to be very 'low content' - I do not yet have my system up and running entire correctly after a rebuild so am first very distracted and second do not have all the info at hand. I'll reply again soon with better informed answers!

There is an event MultiColumnList::EventListContentsChanged that I think is fired when items are added to the list (I don't have the code on here yet, I think the string version is "ListContentsChanged" though it could be "EventListContentChanged"). I think the usefulness may be limited - meaning the event args likely just contains the MCL window, you'd have to then manually scan for the change.

CE.

AlexThomas
Just popping in
Just popping in
Posts: 17
Joined: Mon Sep 28, 2009 17:28

Re: MultiColumnListBox vs ItemListbox

Postby AlexThomas » Mon Oct 05, 2009 17:24

Thanks for the point in (hopefully) the right direction CE, I'll take a look and respond again.


Return to “Offtopic Discussion”

Who is online

Users browsing this forum: No registered users and 17 guests