I recently need a LineCtrl with word wrap, and seeing no support for it, altered the TextCtrl class to handle it. I thought perhaps someone else might need it, so I figured I'd post it up here if anyone wants to use it. It just uses a public function called UseWordWrap(bool) to make the necessary changes. Call that function (true == wordwrap, false == no wordwrap) and then any Insert call will automatically wrap lines.
I'm sure there are situations that won't work that I haven't come across yet, so use at your own risk. I've marked all alterations that I've made, so you should be able to easily identify what's changed.
First, it should be in LineEdit. It should react to actual right margin set in LineEdit rather than actual screen width. And IMO it should work only while entering text (means, as part of character input handler) (not 100% sure about this last one .
And non-WString variant is useless. Just convert to WString and do the same, no?