clickLine

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

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

Re: clickLine

Post by jacque » Thu Oct 24, 2013 11:37 pm

Aha, I see. You don't need linktext for this, I'd remove all that styling. If your field is set up as a list field, all you need is the clicktext. That will return the text of the entire line, which you can then parse into words, items, whatever you need. It's a little different for non-list fields, but if those have locktext set to true you can still get "the value of the clickline" to get the text.

Use a mouseUp handler in the field, get the clicktext, and either parse it right there or else pass the value to a handler in the card or the stack.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

garyth123
Posts: 88
Joined: Sat Apr 27, 2013 11:14 am
Contact:

Re: clickLine

Post by garyth123 » Fri Oct 25, 2013 8:24 am

jacque wrote:Aha, I see. You don't need linktext for this, I'd remove all that styling. If your field is set up as a list field, all you need is the clicktext. That will return the text of the entire line, which you can then parse into words, items, whatever you need. It's a little different for non-list fields, but if those have locktext set to true you can still get "the value of the clickline" to get the text.

Use a mouseUp handler in the field, get the clicktext, and either parse it right there or else pass the value to a handler in the card or the stack.
Okay, thank you jacque.

I'm not sure about list/non list fields but I would think that my field would be good as a list field. I suppose, apart from general ignorance of doing this kind of thing in LC, I was also thinking that the link textStyle indicated to the user that the text was hyper-text and that clicking it would lead to a booking being made. Any ideas how I can accomplish this without the link textStyle? Can I just use "ordinary" text style by script--text colour blue, and underlined, say? Or does that lead to the same complication?

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

Re: clickLine

Post by jacque » Fri Oct 25, 2013 7:14 pm

To be honest, I've never worried about the distinction. List fields are so common that most people know what to do with them, but you're right there's no visual indication a line is clickable. I think most people would click anyway. Sometimes I put a label above the field, like "Click to select:" or whatever is appropriate.

To set a field as a list field, just select that option in the field's property inspector in the Basic pane. You can also choose whether the list should allow multiple line selections, with or without contiguous selections. You only want to allow one selection at a time, so just tick the listbehavior option and leave it at that.

If you really do want a visual indication, then yes, you could make the text into links, trap the linkclicked message, and parse the line. Or you could use regular text styling (color and underlined) which will not interfere; those are just cosmetic attributes. I'd go with the list field though, it's standard interface, it automatically does the correct hiliting behavior, and also returns the text of the whole line when its clicked.

A personal preference: a long list of underlined, colored text is distracting and hard to read. I don't like it.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10331
Joined: Wed May 06, 2009 2:28 pm

Re: clickLine

Post by dunbarx » Fri Oct 25, 2013 9:39 pm

Though some may think this gaudy, do you think it appropriate that each line hilite as the mouse moves over it? Some muted color, to reduce glare?

In this way the temptation to click a line is irresistible. If this idea does not offend, can you manage it?

Craig

Post Reply