Page 1 of 1

Clickfield help needed

Posted: Sat Aug 19, 2017 4:01 pm
by user#606
I have a number of fields on a card and some report when using clickfield and others don't.
I have looked at the properties and the tickboxes are all matching.
I cannot see a reason in dictionary.
What would you suggest.

Re: Clickfield help needed

Posted: Sat Aug 19, 2017 4:11 pm
by Klaus
What did you script and where did you put the script(s)?

Re: Clickfield help needed

Posted: Sat Aug 19, 2017 4:16 pm
by user#606
I put the script in a button on the card. There is only the 1 card so I suppose it is called the stack.
the script is simply answer clickfield

The odd thing is that some fields work, some don't and all have text in them
I am using Livecode 8.1.6

Re: Clickfield help needed

Posted: Sat Aug 19, 2017 4:36 pm
by Klaus
user#606 wrote:I put the script in a button on the card.
Then it is not in the message heriarchy and clicking any field should not produce/answer anything!?
What do you get when you put the "mouseup" handler into the card script, where it definitively should go?

Re: Clickfield help needed

Posted: Sat Aug 19, 2017 4:52 pm
by user#606
I have moved back to the App I am creation now and these are the results I get. The app wher some fields worked others didn't is much the same.
I placed the following in the Card
on mouseup
answer clickfield()
end mouseup

It needed the () to get past the error.
No report.
I deleted from card and put same in stack. Still no report.

There are several Image frames. Each frame to a text field and these are grouped into 14 groups. The 14 are in a group called block.
The image frame (empty) generates an empty message.

I also created a new field with no modifications and that does not generate a report either.

Thank you by the way.

Re: Clickfield help needed

Posted: Sat Aug 19, 2017 5:09 pm
by Klaus
Hm, works here as advertised!
Hint: Editable (unlocked) fields do NOT generate a "mouseup" message, if that helps?

Re: Clickfield help needed

Posted: Sat Aug 19, 2017 5:11 pm
by jmburnod
Hi,
Is there a "on mouseup" handler in some of your groups ?
Best regards
Jean-Marc

Re: Clickfield help needed

Posted: Sat Aug 19, 2017 5:17 pm
by user#606
I created a new stack.
placed 3 ordinary text fields on it and added this script to the card
on mouseup
answer clickfield()
end mouseup
No report from any.
I added a table field and this reports field 4 (which it is)

So, why don't the other fields work?

OK Klaus, I see your message and have locked text. Those fields now work.

Re: Clickfield help needed

Posted: Sat Aug 19, 2017 5:22 pm
by user#606
All working now. Thank you very much.

How can you detect/report an unlocked field?

Re: Clickfield help needed

Posted: Sat Aug 19, 2017 5:30 pm
by Klaus
Check the LOCKTEXT property!

Code: Select all

...
if the locktext of fld 1 = TRUE then
  answer "Field 1 is locked"
else
  answer "Field 1 is editable"
end if
...

Re: Clickfield help needed

Posted: Sat Aug 19, 2017 5:39 pm
by user#606
Thank you Klaus, I understand.
It is starting to come back to me after 3/4 years away from it.