Line Wrapping - No Spaces

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
robl
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 62
Joined: Wed Dec 22, 2010 9:50 pm

Line Wrapping - No Spaces

Post by robl » Fri Jan 03, 2014 9:40 pm

I know this is somewhat of a basic question, but I not encountered this previously in LiveCode.

I have a project with a label that displays web URLs within a form style datagrid. Some URLs may be extremely long, so I am trying to have the text wrapped into multiple-lines as necessary. It seems that LiveCode's "wrap / don't wrap" property only works when the text to be wrapped contains white space. Unfortunately, with URLs there are no spaces. I may have something similar to "https://server123456.california.usa.som ... 9&rate=400"

How can this be wrapped when displayed in the datagrid form? Does anyone have any suggestions on how to best implement this?

Thanks.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Line Wrapping - No Spaces

Post by FourthWorld » Fri Jan 03, 2014 9:51 pm

A URL that long likely has little communicative value to the user. You might consider using an anchor tag in HtmlText, e.g.:

Code: Select all

<a href="https://server123456.california.usa.somecomplexdomainname.com/services/api/blah/something/index.php?request=new&type=inventory&sku=12345678901234&special=abc1234567890&start=1&end=99999&rate=400">Some Shorter, more readable label</a>
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

robl
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 62
Joined: Wed Dec 22, 2010 9:50 pm

Re: Line Wrapping - No Spaces

Post by robl » Fri Jan 03, 2014 10:03 pm

FourthWorld wrote:A URL that long likely has little communicative value to the user. You might consider using an anchor tag in HtmlText, e.g.:

Code: Select all

<a href="https://server123456.california.usa.somecomplexdomainname.com/services/api/blah/something/index.php?request=new&type=inventory&sku=12345678901234&special=abc1234567890&start=1&end=99999&rate=400">Some Shorter, more readable label</a>
Thanks, Richard. I agree with you for most applications. However, for this specific project, the full URL must be displayed. The application is displaying URLs from a database where a system administrator needs to review the full URL as part of an auditing process. The app flags records based certain conditions, captures the full URL, and then waits for a human to review the record.

At this point I am thinking I may need to manually insert a CR every so many characters before displaying it.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Line Wrapping - No Spaces

Post by FourthWorld » Fri Jan 03, 2014 11:00 pm

The manual insertion could work, or you could have a horizontal scroll bar present whenever the formattedwidth of the field exceeds the width.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply