Page 3 of 3

Re: handling of mouse messages in widgets

Posted: Wed Aug 19, 2015 7:20 pm
by trevordevore
@LCMark - How do you see the dragStart/Move/End messages being handled? Currently widgets do not pass those messages automatically and it seems that they should as drag should be handled in LC Script most of the time.

Re: handling of mouse messages in widgets

Posted: Sat Aug 29, 2015 3:12 am
by pthirkell
OK well as Martin said, some of this discussion is above my pay grade! I have however been playing around in earnest with widgets since DP 3 was released, and have a couple of observations to make.

Firstly, it is probably obvious to the experienced among you, but I've just discovered that widgets support behaviors. This is very exciting and a big deal, because I will be able to replace buttons (which I drag around as nodes in a visual network on screen) with better configured widgets that will allow much more functionality (and visual appeal) for each node object.

This raises again however the question of what mouse messages widgets should (or shouldn't) receive. There was quite a discussion earlier in this thread on the point that buttons for example serve a very specific purpose - i.e. click on the button and it triggers an instruction or whatever. However I use buttons for quite a different purpose ... as objects that can be dragged around, made bigger and smaller, connected together with arrows, displaying different images selected by the user etc ... not at all the 'normal' purpose of a button. Initially I used graphic objects, but the advantage of buttons is that they can display an icon and show text, and so all of my "nodes" are in fact buttons. I plan with LC 8 to replace these buttons with widgets ... but I really hope that the commands routinely used to manage and move around my 'buttons' (mousedown, mouseup, mousemove, dragstart, dragenter, dragdrop etc) will still work by default with widgets.

What prompts me to write now is Trevor's comment that the 'mousemove' message doesn't seem to work with widgets. Is this a bug or an intended behaviour? There is a workaround ... (on mousestilldown; set the loc of me to the mouseloc; end mousestilldown) ... but it isn't nearly as smooth as mousemove - and also means that a number of my scripts will need to be rewritten as I replace my 'buttons' with widgets.

Of course I may be a bit weird in the way that I use buttons and will understand if there are more elegant solutions for how widgets should generally handle mouse messages. Nonetheless I thought that it might be helpful to report on how I use buttons in practice - in support of the comments by one or two others that you really can't predict how developers will use widgets in practice.

Re: handling of mouse messages in widgets

Posted: Wed Mar 01, 2017 2:55 am
by jameshale
So has anything come of this discussion?
It seems to have covered most bases and come to a near consensus as to the direction Mark was outlining but this was almost two years ago.
I have added a link to this discussion to http://quality.livecode.com/show_bug.cgi?id=17424 as this bug seemed closest to relevance.

Re: handling of mouse messages in widgets

Posted: Sun Jul 08, 2018 1:24 am
by xsymetrix
This seems to potentially deal with the problem I have in the native slider where I put the value into a field using "onvaluechanged" but if I include code to go to another card and display the number of students based on the slider value, the jump to the card occurs before the user has moved the slider to the desired location.

Having something within the widget that deals separately with the mousedown/mouseup (or ignores it) would definitely be helpful in the case of a slider being dragged to a location and the finger (mouse) released from the slider thumb.