GADGETUP message missing if gadget is in sub layout
- TSK
- Beta Tester
- Posts: 225
- Joined: Mon Dec 20, 2010 1:15 pm
- Location: Home land of Santa C., sauna, sisu and salmiakki
GADGETUP message missing if gadget is in sub layout
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.
Keep the party going !
- salass00
- AmigaOS Core Developer
- Posts: 530
- Joined: Sat Jun 18, 2011 3:12 pm
- Location: Finland
- Contact:
Re: GADGETUP message missing if gadget is in sub layout
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.
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.
- TSK
- Beta Tester
- Posts: 225
- Joined: Mon Dec 20, 2010 1:15 pm
- Location: Home land of Santa C., sauna, sisu and salmiakki
Re: GADGETUP message missing if gadget is in sub layout
@salass00
So how do I implement it in my class to get this working ? Like I said WMHI_GADGETUP never arrives.
So how do I implement it in my class to get this working ? Like I said WMHI_GADGETUP never arrives.
Keep the party going !
- broadblues
- AmigaOS Core Developer
- Posts: 600
- Joined: Sat Jun 18, 2011 2:40 am
- Location: Portsmouth, UK
- Contact:
Re: GADGETUP message missing if gadget is in sub layout
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.
Maybe if Tuomas posts some example code that isn't working that might also aid in detecting the problem.
- salass00
- AmigaOS Core Developer
- Posts: 530
- Joined: Sat Jun 18, 2011 3:12 pm
- Location: Finland
- Contact:
Re: GADGETUP message missing if gadget is in sub layout
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.TSK wrote: So how do I implement it in my class to get this working ? Like I said WMHI_GADGETUP never arrives.
- salass00
- AmigaOS Core Developer
- Posts: 530
- Joined: Sat Jun 18, 2011 3:12 pm
- Location: Finland
- Contact:
Re: GADGETUP message missing if gadget is in sub layout
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.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
- TSK
- Beta Tester
- Posts: 225
- Joined: Mon Dec 20, 2010 1:15 pm
- Location: Home land of Santa C., sauna, sisu and salmiakki
Re: GADGETUP message missing if gadget is in sub layout
I think you mean GA_RelVerify.GACT_RELVERIFY
The both are done, of course.GMR_VERIFY
Yes, I mentioned mouse wheel in the first post.it applies to GM_HANDLESCROLL
Keep the party going !
- salass00
- AmigaOS Core Developer
- Posts: 530
- Joined: Sat Jun 18, 2011 3:12 pm
- Location: Finland
- Contact:
Re: GADGETUP message missing if gadget is in sub layout
Setting GA_RelVerify to TRUE sets the GACT_RELVERIFY flag in the gadget->Activation field, setting GA_RelVerify to FALSE clears it.TSK wrote:I think you mean GA_RelVerify.GACT_RELVERIFY
Have you added some debug code to ensure that your GM_HANDLESCROLL method actually gets called?Yes, I mentioned mouse wheel in the first post.it applies to GM_HANDLESCROLL
Also make sure that IDCMP_GADGETUP messages are enabled on the window.
- TSK
- Beta Tester
- Posts: 225
- Joined: Mon Dec 20, 2010 1:15 pm
- Location: Home land of Santa C., sauna, sisu and salmiakki
Re: GADGETUP message missing if gadget is in sub layout
Yes to both. HandleScroll is called. The window is window class window.
Keep the party going !
- salass00
- AmigaOS Core Developer
- Posts: 530
- Joined: Sat Jun 18, 2011 3:12 pm
- Location: Finland
- Contact:
Re: GADGETUP message missing if gadget is in sub layout
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.
If it helps then I think I know what the problem is and how to fix it.