Soft-wrap text string in field?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
thatkeith
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 346
Joined: Mon Mar 01, 2010 7:13 pm
Location: London, UK
Contact:

Soft-wrap text string in field?

Post by thatkeith » Mon Jun 28, 2021 2:31 pm

I'd like to use a field for someone to enter a URL. The design means the text field can't be really wide – and a URL could easily be rather long. The problem is that it will pretty much always be a solid run of characters with no spaces, so there's no word-delimited way for the text to wrap neatly into multiple lines. The result is a clunky cropped view. I could give the field a horizontal scroll bar but that's only marginally less clunky.

Is there any possible way to have the text wrap 'blindly' when it reaches the field width? Or to have it wrap at a defined char, such as / or some other logical character?

k
Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist

SparkOut
Posts: 2852
Joined: Sun Sep 23, 2007 4:58 pm

Re: Soft-wrap text string in field?

Post by SparkOut » Mon Jun 28, 2021 3:00 pm

There have been several requests for this on the past, and the answer is still "you have to roll your own if you need this". It is not a standard feature on any operating system.
There are some links in this thread with info and stacks to try. (Read the thread through to the end.)
viewtopic.php?f=6&t=10810

thatkeith
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 346
Joined: Mon Mar 01, 2010 7:13 pm
Location: London, UK
Contact:

Re: Soft-wrap text string in field?

Post by thatkeith » Mon Jun 28, 2021 3:19 pm

BBEdit will soft-wrap text if that option is turned on in a document. It will prefer breaking using non-alphanumeric chars (/, punctuation, etc.) but if faced with an unbroken string of letters it will calmly wrap as necessary. If soft-wrap is turned on.

I regard BBEdit as pretty much a standard in serious text handling. (Never, EVER Word, of course!) This behaviour in BBEdit is exactly what I'd like to be able to optionally switch on for a given field in LiveCode.
Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist

SparkOut
Posts: 2852
Joined: Sun Sep 23, 2007 4:58 pm

Re: Soft-wrap text string in field?

Post by SparkOut » Mon Jun 28, 2021 9:23 pm

The answer, I am afraid, is still "roll your own" if you need this in LiveCode. Try out the stacks in that thread and see what works for you.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”