Hello all,
I would like to use custom items in a multicolumnlist. For example, I would like the items to be [a statictext, a combobox, a spinner, a statictext]. Is it possible or can we only use statictexts ?
thanks
custom items in a multicolumnlist
Moderators: CEGUI MVP, CEGUI Team
Look at my code within this other thread about using a CEGUI::Window within a Listbox (or put another way, attempting to put absolutely anything within a Listbox). I got it to work but wasn't happy with how the selected list item looked; the highlight wasn't good enough for my taste.
I had also attempted to use that ListboxItemWindow class (which is derived from CEGUI::ListboxItem) within a multi-column listbox but did not have perfect success; the listbox item window was too large and clipped to the right (I had placed it in the last (third) column). I did not spend time trying to fix it.
Right now my train of thought is to either use a ScrollPane widget or to simulate a listbox or a multi-column listbox.
What I mean by simulating is to use a window with a border as the container, add a scrollbar to the right, and put in as many list items as I need; for example, if I'm to display 4 items in that simulated listbox I would then physically put 4 items within the layout. Then I would listen to scrollbar events and display the proper items within those 4 "slots". For example if I had 6 items to display I would display items 1-2-3-4, 2-3-4-5, or 3-4-5-6.
My layout would look something like this:
I would not prevent dragging the scrollbar thumb such that parts of the list items are displayed; they will never move and will always be fully displayed.
I'm not sure how I would handle a Combobox or a multi-column list though. Not yet...
I had also attempted to use that ListboxItemWindow class (which is derived from CEGUI::ListboxItem) within a multi-column listbox but did not have perfect success; the listbox item window was too large and clipped to the right (I had placed it in the last (third) column). I did not spend time trying to fix it.
Right now my train of thought is to either use a ScrollPane widget or to simulate a listbox or a multi-column listbox.
What I mean by simulating is to use a window with a border as the container, add a scrollbar to the right, and put in as many list items as I need; for example, if I'm to display 4 items in that simulated listbox I would then physically put 4 items within the layout. Then I would listen to scrollbar events and display the proper items within those 4 "slots". For example if I had 6 items to display I would display items 1-2-3-4, 2-3-4-5, or 3-4-5-6.
My layout would look something like this:
Code: Select all
<layout>
<window type="DefaultWindow" with a border visible>
<window type="Scrollbar" placed to the right>
</window>
<window type="Parent container for my first list item>
<window type="First widget within the first list item>
</window>
</window>
<window type="Parent container for my second list item>
<window type="First widget within the second list item>
</window>
</window>
</window>
</layout>
I would not prevent dragging the scrollbar thumb such that parts of the list items are displayed; they will never move and will always be fully displayed.
I'm not sure how I would handle a Combobox or a multi-column list though. Not yet...
Who is online
Users browsing this forum: No registered users and 17 guests