Request for character wrap (not word wrap) in fields

Something you want to see in a LiveCode product? Want a new forum set up for a specific topic? Talk about it here.

Moderator: Klaus

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

Re: Request for character wrap (not word wrap) in fields

Post by FourthWorld » Mon Jun 28, 2021 3:55 pm

URLs are most commonly used in one-line browser fields, which don't wrap.

I'm all for an option to soft-wrap long non-natural-language strings. But I also recognize it as an edge case, so I wouldn't imagine that if the team also agreed it would move to the top of the work queue any time soon.

So as a practical matter, we'd still need to find a workaround.

What are you building, and how can we help?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7389
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Request for character wrap (not word wrap) in fields

Post by jacque » Mon Jun 28, 2021 5:46 pm

Usually I just set the textalign to right so users can see the important part, sometimes with a horizontal scrollbar.

But if you really do want a wrap you could use measuretext to see if the formattedwidth is more than the field width and replace slashes with cr & slash at appropriate places. LC is fast enough that you could probably do that on textChanged.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

thatkeith
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 383
Joined: Mon Mar 01, 2010 7:13 pm
Contact:

Re: Request for character wrap (not word wrap) in fields

Post by thatkeith » Mon Jun 28, 2021 7:09 pm

FourthWorld wrote:
Mon Jun 28, 2021 3:55 pm
What are you building
It's a QR code maker, with form sets for a variety of different code uses from the common web links to vCards, wifi access codes, and so on. I'll do a total rethink of the interface (GAAAHHH!!!) to allow for stupidly wide URL fields. I know URLs are normally shown in single-line fields, but I'm not looking to make a browser. In this kind of use it makes a lot of sense to let the user see the whole thing; in their position I certainly would want to be able to eyeball the whole string in one go.

It's not a common requirement but it's not an outlandish one either. :(
Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist

thatkeith
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 383
Joined: Mon Mar 01, 2010 7:13 pm
Contact:

Re: Request for character wrap (not word wrap) in fields

Post by thatkeith » Mon Jun 28, 2021 7:11 pm

jacque wrote:
Mon Jun 28, 2021 5:46 pm
Usually I just set the textalign to right so users can see the important part, sometimes with a horizontal scrollbar.

But if you really do want a wrap you could use measuretext to see if the formattedwidth is more than the field width and replace slashes with cr & slash at appropriate places. LC is fast enough that you could probably do that on textChanged.
Yes, I'm sure it is. But then I'd find myself in quicksand: a user would reasonably expect to be able to edit the URL freely. :o
Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist

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

Re: Request for character wrap (not word wrap) in fields

Post by FourthWorld » Mon Jun 28, 2021 9:45 pm

People type URLs?

Even long ones?

With their thumbs?

Rather than paste?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

thatkeith
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 383
Joined: Mon Mar 01, 2010 7:13 pm
Contact:

Re: Request for character wrap (not word wrap) in fields

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

Haha – well, you're welcome to use your thumbs but regular keyboards are faster with a few fingers... ;)

Seriously though, this is something that would be used on desktop computer platforms, and I know some of my intended users would feel more comfortable being able to see the whole URL whether they typed it or pasted it in. It's a user confidence thing. Ideally, I'd simply be able to accommodate that. Except I can't, which is both not the end of the world and simultaneously a shame.
Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist

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

Re: Request for character wrap (not word wrap) in fields

Post by FourthWorld » Tue Jun 29, 2021 12:08 am

Now you have my curiosity: just how long are these URLs that can't fit in the width of a modern desktop display?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

thatkeith
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 383
Joined: Mon Mar 01, 2010 7:13 pm
Contact:

Re: Request for character wrap (not word wrap) in fields

Post by thatkeith » Tue Jun 29, 2021 8:02 am

Heh. I don't want to make a full-screen UI, it's a focused utility that should be reasonably compact. Remember in macOS it's quite normal at times to have multiple app windows layered and visible at once. Anyway, how about

Code: Select all

https://designfor-me.com/project-types/extensions/how-much-does-a-house-extension-cost-in-london-south-east/
or

Code: Select all

https://www.researchgate.net/publication/11366400_Novel_effect_of_CP55940_a_CB1CB2_cannabinoid_receptor_agonist_on_intracellular_free_Ca2_levels_in_bladder_cancer_cells
😁

The thing is, LiveCode is a kind of toolbox for the imagination. As such it should be as flexible as logically possible. 😕
Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist

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

Re: Request for character wrap (not word wrap) in fields

Post by FourthWorld » Tue Jun 29, 2021 9:41 am

People type those? From where? A phone conversation?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

thatkeith
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 383
Joined: Mon Mar 01, 2010 7:13 pm
Contact:

Re: Request for character wrap (not word wrap) in fields

Post by thatkeith » Tue Jun 29, 2021 9:51 am

Those would likely be copy-pasted. But imagine a (common) scenario where there are a number of different URLs that are very similar and a list of different QR codes to be generated. (This actually isn't hypothetical; it's something my wife and her work team do reasonably regularly.) It would give a user some peace of mind if they could just glance at the address and see the whole thing in one go just before saving the code, confirming where they are in their list. Sure, there are other ways they can check but this would certainly be the simplest and least disruptive to the flow.

QR codes are weird for many reasons, and one big one is they're not remotely human-readable. That can introduce a measure of uncertainty, so I'm thinking through ways to try and mitigate that. To me this is UX design. I know we always have to design within the constraints of the tools we use, but this limitation does feel more like PX (programmer experience) design instead.

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

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

Re: Request for character wrap (not word wrap) in fields

Post by FourthWorld » Tue Jun 29, 2021 11:34 am

thatkeith wrote:
Tue Jun 29, 2021 9:51 am
It would give a user some peace of mind if they could just glance at the address and see the whole thing in one go just before saving the code, confirming where they are in their list.
Ah, yes, reading long URLs I can understand.

Have you considered putting a horizontal scrollbar on that list?

Soft-wrapped text is challenging in lists because it introduces a visual ambiguity, making it less obvious which lines are complete URLs and which are wrapped fragments.
I know we always have to design within the constraints of the tools we use, but this limitation does feel more like PX (programmer experience) design instead.
All software tooling sucks. None of it reads my mind. ;)

Consider doing your app in C++. Sure, freedom for this edge case, but piles of extra work for everything else.

At least LC gives you at least four layers to roll your own with (LC Script, LC Builder, externals API, engine source), so yes, edge cases mean custom code, but very little, and the rest of your app is all in script rather than lower level languages.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

thatkeith
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 383
Joined: Mon Mar 01, 2010 7:13 pm
Contact:

Re: Request for character wrap (not word wrap) in fields

Post by thatkeith » Tue Jun 29, 2021 3:21 pm

FourthWorld wrote:
Tue Jun 29, 2021 11:34 am
Have you considered putting a horizontal scrollbar on that list?
Yes, and that's certainly better than requiring the user to arrow key or equivalent their way around the string. :)
Soft-wrapped text is challenging in lists because it introduces a visual ambiguity, making it less obvious which lines are complete URLs and which are wrapped fragments.
True. It's not something I'd do a lot, just as I mostly don't enable soft-wrap in BBEdit. But if I considered the options and decided this was the best of the bunch... I wish I could then do it. Oh well.


I know we always have to design within the constraints of the tools we use, but this limitation does feel more like PX (programmer experience) design instead.
All software tooling sucks. None of it reads my mind. ;)
LOL! Not a debate-clinching argument but very, very true :lol:

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

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7389
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Request for character wrap (not word wrap) in fields

Post by jacque » Tue Jun 29, 2021 4:01 pm

How about a tooltip that shows the wrapped text on mouseEnter? You'd still need to parse it into lines for display, but the original URL would still be available in the field.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

thatkeith
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 383
Joined: Mon Mar 01, 2010 7:13 pm
Contact:

Re: Request for character wrap (not word wrap) in fields

Post by thatkeith » Wed Jun 30, 2021 11:07 am

jacque wrote:
Tue Jun 29, 2021 4:01 pm
How about a tooltip that shows the wrapped text on mouseEnter?
Good idea! I ended up completely redesigning the interface to accommodate a wide field for URLs, but that's a nice lateral-thinking alternative.
Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10076
Joined: Fri Feb 19, 2010 10:17 am

Re: Request for character wrap (not word wrap) in fields

Post by richmond62 » Wed Jun 30, 2021 4:44 pm

Marty McFly
at.this.screen.where.i.have.typed.in.a.long.sentence.continuously.without.word.breaks.yet.it.wraps.beautifully.as.soon.as.it.reaches.the.edge.of.the.window.which.is.the.way.all.word.processors.including.gold.standard.MSWord.work!
Probably wraps because it is delimited by stops/periods . . . .
gold.standard.MSWord
Not any more, more like Schlagmetal these days.

So: to LiveCode:
-
SShot 2021-06-30 at 18.33.55.png
SShot 2021-06-30 at 18.33.55.png (15.3 KiB) Viewed 2950 times
-
Nope it does NOT wrap at stops/periods.

BUT if one replaces "." with spaces the field wordWraps.

I wonder what it does 'here':

at this screen where i have typed in a long sentence continuously without word breaks yet it wraps beautifully as soon as it reaches the edge of the window which is the way all word processors including gold standard MSWord work!

Oh, Aye, just a wordWrap.

Post Reply