Page 1 of 1

Mouse down on a field

Posted: Mon Jul 28, 2014 5:36 pm
by francof
ciao all,

I've 10 grouped text fields, I would like to put the text of the one clicked into another field. it's possible to do without repeat the code of handler mouseDown of each field.

thanks
franco

Re: Mouse down on a field

Posted: Mon Jul 28, 2014 5:50 pm
by jmburnod
Hi Franco,
it's possible to do without repeat the code of handler mouseDown of each field
Yes :D
Put your mousedown handler in your group script
You can use also "behavior"
Best regards
Jean-Marc

Re: Mouse down on a field

Posted: Mon Jul 28, 2014 7:33 pm
by dunbarx
Hi.

Please check out the "target" function in the dictionary. It will amaze you. I am sure you can take it from there, also using Bernd"s suggestion about placing your handler in the group script.

Craig Newman

Re: Mouse down on a field

Posted: Mon Jul 28, 2014 7:52 pm
by francof
HI Jean-Marc, Craig
yes me too was thinking about to put code in the group script, the problem was what code............. answer target is the solution.

many thanks
franco

Re: Mouse down on a field

Posted: Mon Jul 28, 2014 8:35 pm
by dunbarx
Hi.

For your original question:

Code: Select all

Put the value of the target into fld "yourOtherField"
Or even better:

Code: Select all

Put target into fld "yourOtherField"
Now you must go back to the dictionary and tell us what the difference is between the function "the target" and the keyword "target" is.

Craig

Re: Mouse down on a field

Posted: Tue Jul 29, 2014 8:22 am
by francof
dunbarx wrote: ...
Now you must go back to the dictionary and tell us what the difference is between the function "the target" and the keyword "target" is.

Craig
yes I saw, I've used the keyword "target" because my need is to show the contents of the clicked field. quote from the Dictionary:
"Specifies the text contents of the field which was the target of the message currently being handled." and more:
"Use the target keyword to access the contents of the field named in the target function."

while the function "the target" "Returns the object which received the message that started execution." and could be used to make actions and events with that object.
so I've understood

franco

P.S.:
I've used "Answer" because it is an automatic window, open and close in a line of code
f

Re: Mouse down on a field

Posted: Tue Jul 29, 2014 1:33 pm
by dunbarx
Franco.

Exactly so. These are so powerful and convenient.

Craig