Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » LineEdit, EditFields, DocEdit » Added word wrap to LineEdit
Added word wrap to LineEdit [message #18494] Fri, 03 October 2008 20:10 Go to next message
engineereeyore is currently offline  engineereeyore
Messages: 1
Registered: October 2008
Junior Member
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.
  • Attachment: Text.cpp
    (Size: 14.96KB, Downloaded 345 times)
  • Attachment: TextEdit.h
    (Size: 14.13KB, Downloaded 341 times)
Re: Added word wrap to LineEdit [message #18510 is a reply to message #18494] Sun, 05 October 2008 18:52 Go to previous messageGo to next message
zsolt is currently offline  zsolt
Messages: 629
Registered: December 2005
Location: Budapest, Hungary
Contributor
Why don't you use DocEdit?
Re: Added word wrap to LineEdit [message #18758 is a reply to message #18494] Mon, 20 October 2008 08:05 Go to previous message
mirek is currently offline  mirek
Messages: 13442
Registered: November 2005
Ultimate Member
Good idea, but IMO not very good implementation Smile

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 Smile.

And non-WString variant is useless. Just convert to WString and do the same, no?

Mirek
Previous Topic: LineEdit and menu
Next Topic: Focus Event Handling in Edit Fields
Goto Forum:
  


Current Time: Fri Oct 22 20:36:10 CEST 2021

Total time taken to generate the page: 0.01149 seconds