Hi,
I need to implement a dialog message box in my game, and I'm using Listbox to do that. By design, this dialog should add new messages at the bottom of the list (as it usual does) but move all the previous messages (items) one position up when added. Is there any easy way to implement that behavior, so my Listbox was aligned to the bottom, with the last added item at the very bottom and the first added at the very top?
Thank you
Listbox going bottom top
Moderators: CEGUI MVP, CEGUI Team
Re: Listbox going bottom top
I would also like to know
Re: Listbox going bottom top
What have you tried? Did you bother to look at the API of the Listbox object before posting? Both the old, deprecated Listbox and the newer ItemListbox interfaces provide an insertItem method. You can use this method to insert items in arbitrary positions.
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!
Re: Listbox going bottom top
No absolutely, I don't bother to look at the API. And a looked a lot before posting here. I think I wasn't able to express my problem correctly to you, Sir.
The question that I was not able to solve, is creating a List that grows up vertically in the upper direction, keeping the new item at the bottom. It's like a stack where you add new objects from the bottom not on top. I'm really sorry if this is something clear in the API, but my ignorance was not able to figure this out from it.
Thank you
The question that I was not able to solve, is creating a List that grows up vertically in the upper direction, keeping the new item at the bottom. It's like a stack where you add new objects from the bottom not on top. I'm really sorry if this is something clear in the API, but my ignorance was not able to figure this out from it.
Thank you
Re: Listbox going bottom top
As I said, depending on which Listbox you are using, you can use the CEGUI::Listbox::insertItem or CEGUI::ItemListbox::insertItem method to add items to the list arbitrarily. In other words, you can add items to the bottom of the list; after you add the item, scroll it into view, and then you seemingly have a listbox that grows up. If you are looking for an explicit block of code to copy/paste, I cannot provide that.
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!
Re: Listbox going bottom top
Thank you again Jamarr, I really don't need a chunk of code to copy and paste. I just need an insight of how to code in the best way and you just gave me that!
best wishes
best wishes
Who is online
Users browsing this forum: Google [Bot] and 17 guests