Editbox and listbox size limits and scrolling to the end


18-02-2014 16:32:22

I am using an editbox as a chat history. I also tried a listbox thinking that was the best solution.

I have two problems:

(1) The editbox appears to stop accepting text after a while. Does the editbox have a text size limit?
(2) How do I scroll to the end of the listbox each time an item is added? Does the listbox have a size limit?



18-02-2014 19:02:19

(1) There is get/setMaxTextLength (2048 by default). Also it is possible to make edit box trim oldest text instead of newest: setOverflowToTheLeft(true)
(2) That's how you can scroll list from code:
/** @name Item Visibility Methods
Methods used to determine and manipulate item visibility.
//! Move all elements so specified becomes visible
void beginToItemAt(size_t _index);

//! Move all elements so first becomes visible
void beginToItemFirst();

//! Move all elements so last becomes visible
void beginToItemLast();

//! Move all elements so selected becomes visible
void beginToItemSelected();
I guess beginToItemLast is what you need.


19-02-2014 00:37:30

Thanks for the quick reply. It looks like I have it working as desired now.