Detecting mouseup's...

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

Post Reply
Traxgeek
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Wed Jan 09, 2013 10:11 am

Detecting mouseup's...

Post by Traxgeek » Mon Sep 15, 2014 9:44 am

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
Last edited by Traxgeek on Sat Sep 27, 2014 3:55 pm, edited 1 time in total.
I'm 'getting there'... just far too slowly !
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Detecting mouseup's...

Post by jmburnod » Mon Sep 15, 2014 10:38 am

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
https://alternatic.ch

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: Detecting mouseup's...

Post by bn » Mon Sep 15, 2014 10:45 am

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

Traxgeek
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Wed Jan 09, 2013 10:11 am

Re: Detecting mouseup's...

Post by Traxgeek » Mon Sep 15, 2014 11:08 am

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.
I'm 'getting there'... just far too slowly !
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1

Post Reply