Wrapping text for GuiTextListCtrl
by Lateral Punk · in Torque Game Engine · 02/10/2005 (10:55 am) · 6 replies
Hi I have a quick question regarding the functionality of GuiTextListCtrl. Basically I"m using it to populate with a list of strings that are quite long. So basically i want that row to wrap instead of clipping. Is this possible? If not, is it possible to modify the engine to support this? I think it is a simple enough request.
thanks
thanks
#2
02/10/2005 (1:48 pm)
It's not built in. You could add it. Look at GuiMLTextCtrl to see how other parts of the engine implement text wrapping.
#3
thanks
02/11/2005 (8:08 am)
I had a look over GuiMLTextCtrl, but unfortunately i was not able to figure out exactly which function/variables dealth with the text wrapping. I have a feeling it has something to do with the Atoms & the funciton splitAtomListEmit, but I may be wrong. could you direct me to exactly where i should look in GuiMLTextCtrl to mimic wrapping into GuiTextList.thanks
#4
02/11/2005 (2:22 pm)
That's about it. GuiMLTextCtrl also deals with a lot of other stuff so you can likely simplify what it does (which is wrap all manner of elements, not just text). Or add some newlines. :)
#5
02/11/2005 (9:48 pm)
Couldn't this be pretty easily done in script? Just do a count on the string and parse it with string replace? Example: You can't have more than 60 characters per line and you have a 150 character line. So you parse it and get approximately two lines of 60 and one line of 30. You would need to run a small check to see if the line break(60 chars) fell in the middle of a word and then back up if so, but overall this seems that it would be easy to accomplish in script.
#6
02/12/2005 (8:58 am)
My original posting referred to a GuiTextListCtrl, so if i was to break up the string into 60/30, then when the user selects the "ROW" which row is he selecting? the 60? the 30? I don't want it to be treated as two different entries, but it will according to the implementation. or am i wrong about this?
Torque 3D Owner Robert Blanchet Jr.