Request for character wrap (not word wrap) in fields
Moderator: Klaus
-
- 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
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?
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
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Request for character wrap (not word wrap) in fields
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.
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
HyperActive Software | http://www.hyperactivesw.com
Re: Request for character wrap (not word wrap) in fields
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
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
Re: Request for character wrap (not word wrap) in fields
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.jacque wrote: ↑Mon Jun 28, 2021 5:46 pmUsually 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.

Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
-
- 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
People type URLs?
Even long ones?
With their thumbs?
Rather than paste?
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
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Request for character wrap (not word wrap) in fields
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.

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
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
-
- 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
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
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Request for character wrap (not word wrap) in fields
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 or

The thing is, LiveCode is a kind of toolbox for the imagination. As such it should be as flexible as logically possible.
Code: Select all
https://designfor-me.com/project-types/extensions/how-much-does-a-house-extension-cost-in-london-south-east/
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
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
-
- 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
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
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Request for character wrap (not word wrap) in fields
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.

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
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
-
- 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
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.
All software tooling sucks. None of it reads my mind.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.

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
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Request for character wrap (not word wrap) in fields
Yes, and that's certainly better than requiring the user to arrow key or equivalent their way around the string.FourthWorld wrote: ↑Tue Jun 29, 2021 11:34 amHave you considered putting a horizontal scrollbar on that list?

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.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.
LOL! Not a debate-clinching argument but very, very trueAll software tooling sucks. None of it reads my mind.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.![]()

k
Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
Re: Request for character wrap (not word wrap) in fields
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
HyperActive Software | http://www.hyperactivesw.com
Re: Request for character wrap (not word wrap) in fields
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
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
-
- Livecode Opensource Backer
- Posts: 10078
- Joined: Fri Feb 19, 2010 10:17 am
Re: Request for character wrap (not word wrap) in fields
Marty McFly
So: to LiveCode:
- -
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.
Probably wraps because it is delimited by stops/periods . . . .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!
Not any more, more like Schlagmetal these days.gold.standard.MSWord
So: to LiveCode:
- -
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.