Clicking on a line in a locked textfield

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
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10102
Joined: Fri Feb 19, 2010 10:17 am

Clicking on a line in a locked textfield

Post by richmond62 » Sat Jan 03, 2015 9:17 pm

I just set up a stack containing a scrolling list field "SLF"
and 2 other fields: "KLICKT" and "LNVAL"

The field "SLF" contains this script:

on mouseDown
put the clickLine into fld "KLICKT"
put the value of the clickLine into fld "LNVAL"
end mouseDown

According to the prefs palette for fld "SLF" the text is locked.

-----------------------------------------------------------------------

Then I set up 2 buttons; "Lock Fields" and "unLock Fields" containing these scripts respectively;

on mouseUp
set the lockLocation of fld "SLF" to true
set the lockLocation of fld "KLICKT" to true
set the lockLocation of fld "LNVAL" to true
end mouseUp

on mouseUp
set the lockLocation of fld "SLF" to false
set the lockLocation of fld "KLICKT" to false
set the lockLocation of fld "LNVAL" to false
end mouseUp

The script in fld "SLF" did what is was meant to do regardless of whether the fields
were locked or not.

--------------------------------------------------------------------

My stack is here: https://www.dropbox.com/sh/ja47l87gg87s ... C5ORa?dl=0

File "locked.livecode.zip"

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Clicking on a line in a locked textfield

Post by Klaus » Sat Jan 03, 2015 9:57 pm

Hi Richmond,

sure you didn't want to set the LOCKTEXT of your fields to true/false? 8)


Best

Klaus

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

Re: Clicking on a line in a locked textfield

Post by richmond62 » Sun Jan 04, 2015 9:51 am

Klaus . . . possibly.

New version here: https://www.dropbox.com/sh/ja47l87gg87s ... C5ORa?dl=0

2 buttons: "LockText" and "unLockText"; they don't seem to make ANY difference
whatsoever to the 'clickability' of the textLines.

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: Clicking on a line in a locked textfield

Post by Dixie » Sun Jan 04, 2015 10:18 am

Richmond...
2 buttons: "LockText" and "unLockText"; they don't seem to make ANY difference
whatsoever to the 'clickability' of the textLines.
They won't make any difference since you are using a 'list' field !.. That is what a 'list' field is for... You will only see a difference if you use a 'text Entry field', it will then only return the clickline and its value if 'locktext' is set to true...

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

Re: Clicking on a line in a locked textfield

Post by richmond62 » Sun Jan 04, 2015 5:51 pm

Aha.

So, why was Dr Hawkins "going all funny" about clickability of fields?

Maybe ALL he had to do was change the type of field he was using??????????????

Post Reply