Page 4 of 5

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

Posted: Mon Jun 28, 2021 3:55 pm
by FourthWorld
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?

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

Posted: Mon Jun 28, 2021 5:46 pm
by jacque
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.

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

Posted: Mon Jun 28, 2021 7:09 pm
by thatkeith
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. :(

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

Posted: Mon Jun 28, 2021 7:11 pm
by thatkeith
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

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

Posted: Mon Jun 28, 2021 9:45 pm
by FourthWorld
People type URLs?

Even long ones?

With their thumbs?

Rather than paste?

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

Posted: Mon Jun 28, 2021 10:31 pm
by thatkeith
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.

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

Posted: Tue Jun 29, 2021 12:08 am
by FourthWorld
Now you have my curiosity: just how long are these URLs that can't fit in the width of a modern desktop display?

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

Posted: Tue Jun 29, 2021 8:02 am
by thatkeith
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. 😕

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

Posted: Tue Jun 29, 2021 9:41 am
by FourthWorld
People type those? From where? A phone conversation?

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

Posted: Tue Jun 29, 2021 9:51 am
by thatkeith
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.

:(

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

Posted: Tue Jun 29, 2021 11:34 am
by FourthWorld
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.

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

Posted: Tue Jun 29, 2021 3:21 pm
by thatkeith
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

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

Posted: Tue Jun 29, 2021 4:01 pm
by jacque
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.

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

Posted: Wed Jun 30, 2021 11:07 am
by thatkeith
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.

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

Posted: Wed Jun 30, 2021 4:44 pm
by richmond62
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 17056 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.