Page 1 of 1

Detecting mouseup's...

Posted: Mon Sep 15, 2014 9:44 am
by Traxgeek
Hi,

I'm stumped again...

For simplicity; I have 2 text input fields on a card and I'm trying to make, the background colour of field 1 change when field 2 is selected.
Seems simple...

I add two scripts to my fields

Code: Select all

on mouseup
   answer "MouseUp"  --This would normally be my field colour-change code
end mouseup
and

Code: Select all

on mousedown
   answer "MouseDown"  --This would normally be my field colour-change code
end mousedown
When I click in either of the fields neither message gets fired...

Well... that's only partially true... When I 'normal' click / 'left' click - nothing happens...
but when I 'menu' click / 'right' click - my messages appear.

Is this correct behaviour ? and, if so, how does one 'catch' traversal from one field to another following a 'normal'/ 'left' click (excepting focusin/out, open/closefield etc).

Secondly (it is related - honest !) Traversal - is TraversalOn only available through script or am I missing an option someplace in the Property Inspector

Re: Detecting mouseup's...

Posted: Mon Sep 15, 2014 10:38 am
by jmburnod
Hi,
I think openfield, closefied and exitField (What else ?) will be useful.
Something like that

Code: Select all

on openfield
   set the backgroundcolor of the target to yellow 
end openfield

on closefield
   set the backgroundcolor of the target to white 
end closefield

on exitField
     set the backgroundcolor of the target to white 
end exitField
Best regards
Jean-Marc

Re: Detecting mouseup's...

Posted: Mon Sep 15, 2014 10:45 am
by bn
Hi,

a field that is editable does not get left-click mouse events, only right click. That is normal

in the properties inspector for the field look for focusable. The tooltip will show "traversalOn".

There is an option in the preferences for "General" right at the top. If you check "Name of LiveCode Property" then traversalOn will be displayed in properties inspector and focusable in the tooltips.

Kind regards
Bernd

Re: Detecting mouseup's...

Posted: Mon Sep 15, 2014 11:08 am
by Traxgeek
Hi both,
jmburnod wrote:I think openfield, closefied and exitField
: Yeah got those. Just having difficulty removing focus from a text input box but the 'focus on nothing' helped too. Thanks J-M.
bn wrote:a field that is editable does not get left-click mouse events, only right click. That is normal
Aahhh ! OK. Hadn't appreciated that.

Again, 'Traversal' - thanks Bernd.