When testing the gradientEditor in LC 8 DP 5 I noticed that when you release the mouse off the card of the property inspector the mouseMove handler is still working, i.e. the last selected index moves along when returning to the gradientEditor with the mouse being up. This stops when you click on the gradientEditor.
I had a look at the code and the onMouseUp handler does not fire in gradientEditor when the mouse is released outside the bounds of the card the widget is on.
The question is if that behavior of the onMouseUp message the way it is supposed to be?
Or another way around should there be a onMouseRelease message?
(I found a workaround for this problem but it is awkward)
Kind regards
Bernd
Is there a way to catch mouseRelease in LCB?
-
- Livecode Staff Member
- Posts: 192
- Joined: Thu Apr 18, 2013 2:48 pm
Re: Is there a way to catch mouseRelease in LCB?
There isn't - but perhaps OnMouseCancel will work for this purpose?
-
- VIP Livecode Opensource Backer
- Posts: 4027
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: Is there a way to catch mouseRelease in LCB?
Hi Ali,
Thank your very much
Kind regards
Bernd
That works perfectly, OnMouseCancel triggers when releasing the mouse outside of the bounds of the card the widget is on.There isn't - but perhaps OnMouseCancel will work for this purpose?
Thank your very much
Kind regards
Bernd
-
- VIP Livecode Opensource Backer
- Posts: 4027
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: Is there a way to catch mouseRelease in LCB?
here is the pull-request for gradientrampeditor with OnMouseCancel.
https://github.com/livecode/livecode/pull/2930
Kind regards
Bernd
https://github.com/livecode/livecode/pull/2930
Kind regards
Bernd
Re: Is there a way to catch mouseRelease in LCB?
Hi Bernd - I'll have to check there isn't a bug here. My original intent was that you should get mouseup regardless of where the mouse is released, mousecancel being reserved for situations where a change in UI context means the mouseup isn't for the target widget. E.g. Popping up a context menu on mouseDown - as soon as the popup has occurred the widget won't get a mouseup (which is now for the popup to process) but mousecancel instead. In the case of releasing outside the window, a mouseUp should still occur as he widget has grabbed mouse input.
-
- VIP Livecode Opensource Backer
- Posts: 4027
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: Is there a way to catch mouseRelease in LCB?
Hi Mark,
thank you for explaining.
BTW in gradientrampeditor is a OnKeyPressed handler. I have not gotten it to trigger at all. But that might be because I don't know how it is supposed to work. If it is supposed to work while the widget "is active" (has focus?) then it did not trigger when pressing a key. This is of course all new to me and I use the provided widgets to learn about LCB.
Another thing I would like to add. I think LC 8 looks very promising. I like the way it uses widgets for the UI. It is a lot cleaner and confined than before. Once all the little quirks of this huge rework of even the IDE are worked out I see that LC IDE will be a lot easier to maintain and expand/adapt.
In a broader sense since this applies to all of LC then I start to see where you are heading and I think it is huge.
Thank you for all the work you and the LC team has put into this. It is well worth the wait for it mature. And also worth getting used to the LCB-language
Kind regards
Bernd
thank you for explaining.
if that works my pull request is superfluous.In the case of releasing outside the window, a mouseUp should still occur as he widget has grabbed mouse input.
that is what I gathered from the dictionary so I did not even try it.mousecancel being reserved for situations where a change in UI context means the mouseup isn't for the target widget. E.g. Popping up a context menu on mouseDown - as soon as the popup has occurred the widget won't get a mouseup (which is now for the popup to process) but mousecancel instead
BTW in gradientrampeditor is a OnKeyPressed handler. I have not gotten it to trigger at all. But that might be because I don't know how it is supposed to work. If it is supposed to work while the widget "is active" (has focus?) then it did not trigger when pressing a key. This is of course all new to me and I use the provided widgets to learn about LCB.
Another thing I would like to add. I think LC 8 looks very promising. I like the way it uses widgets for the UI. It is a lot cleaner and confined than before. Once all the little quirks of this huge rework of even the IDE are worked out I see that LC IDE will be a lot easier to maintain and expand/adapt.
In a broader sense since this applies to all of LC then I start to see where you are heading and I think it is huge.
Thank you for all the work you and the LC team has put into this. It is well worth the wait for it mature. And also worth getting used to the LCB-language
Kind regards
Bernd