Page 1 of 2

GADGETUP message missing if gadget is in sub layout

Posted: Sun Nov 20, 2016 12:28 am
by TSK
I've been developing some BOOPSI gadget classes. If I let Intuition to take care of the mouse wheel then an application will get a GADGETUP message but only if the gadget is in a root layout group. If the gadget is in any child/sub group then the GADGETUP message won't appear at all. Is that a bug in Intuition or Layout class or is there any way to make that GMR_VERIFY/GADGETUP to go through all layout levels ? Reaction Slider can handle it somehow.

Re: GADGETUP message missing if gadget is in sub layout

Posted: Sun Nov 20, 2016 8:59 pm
by salass00
If there was a bug like you describe then it would be affecting almost all of the ReAction programs in existence since nesting layout gadgets is not uncommon.

For gadgets that are inside a layout (root or nested) the IDCMP_GADGETDOWN / IDCMP_GADGETUP messages are in any case completely useless since they always point to the root layout. This is why layout.gadget uses IDCMP_IDCMPUPDATE messages to provide this information (see LAYOUT_RelVerify and LAYOUT_Immediate tags). If you use window.class and WM_HANDLEINPUT then it automatically takes care of these details for you and returns them as WMHI_GADGETDOWN and WMHI_GADGETUP events respectively.

Re: GADGETUP message missing if gadget is in sub layout

Posted: Sun Nov 20, 2016 11:39 pm
by TSK
@salass00

So how do I implement it in my class to get this working ? Like I said WMHI_GADGETUP never arrives.

Re: GADGETUP message missing if gadget is in sub layout

Posted: Mon Nov 21, 2016 1:45 am
by broadblues
From conversations on this subject held in email I should point out that the significant piece of information missing from this request for help is that it applies to GM_HANDLESCROLL not GM_HANDLEINPUT

Maybe if Tuomas posts some example code that isn't working that might also aid in detecting the problem.

Re: GADGETUP message missing if gadget is in sub layout

Posted: Mon Nov 21, 2016 9:44 am
by salass00
TSK wrote: So how do I implement it in my class to get this working ? Like I said WMHI_GADGETUP never arrives.
You implement GM_HITTEST, GM_GOACTIVE, GM_HANDLEINPUT and GM_GOINACTIVE as usual. The IDCMP_IDCMPUPDATE notification is done by layout.gadget in its input handler. Your gadget gadget should also have GACT_RELVERIFY set (GA_RelVerify) to produce gadget up events.

Re: GADGETUP message missing if gadget is in sub layout

Posted: Mon Nov 21, 2016 10:04 am
by salass00
broadblues wrote:From conversations on this subject held in email I should point out that the significant piece of information missing from this request for help is that it applies to GM_HANDLESCROLL not GM_HANDLEINPUT
The GM_HANDLESCROLL method isn't documented in any of the autodocs but it looks like the requirements to produce a gadget up event are the same. GACT_RELVERIFY has to be set on the gadget and the method should return with GMR_VERIFY set.

Re: GADGETUP message missing if gadget is in sub layout

Posted: Mon Nov 21, 2016 3:36 pm
by TSK
GACT_RELVERIFY
I think you mean GA_RelVerify.
GMR_VERIFY
The both are done, of course.
it applies to GM_HANDLESCROLL
Yes, I mentioned mouse wheel in the first post.

Re: GADGETUP message missing if gadget is in sub layout

Posted: Mon Nov 21, 2016 4:27 pm
by salass00
TSK wrote:
GACT_RELVERIFY
I think you mean GA_RelVerify.
Setting GA_RelVerify to TRUE sets the GACT_RELVERIFY flag in the gadget->Activation field, setting GA_RelVerify to FALSE clears it.
it applies to GM_HANDLESCROLL
Yes, I mentioned mouse wheel in the first post.
Have you added some debug code to ensure that your GM_HANDLESCROLL method actually gets called?

Also make sure that IDCMP_GADGETUP messages are enabled on the window.

Re: GADGETUP message missing if gadget is in sub layout

Posted: Mon Nov 21, 2016 6:42 pm
by TSK
Yes to both. HandleScroll is called. The window is window class window.

Re: GADGETUP message missing if gadget is in sub layout

Posted: Tue Nov 22, 2016 9:28 am
by salass00
Try setting LAYOUT_DeferLayout to TRUE on the root layout.

If it helps then I think I know what the problem is and how to fix it.