GADGETUP message missing if gadget is in sub layout

This forum is for general developer support questions.
User avatar
TSK
Beta Tester
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

Post 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.
Keep the party going !
User avatar
salass00
AmigaOS Core Developer
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

Post 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.
User avatar
TSK
Beta Tester
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

Post by TSK »

@salass00

So how do I implement it in my class to get this working ? Like I said WMHI_GADGETUP never arrives.
Keep the party going !
User avatar
broadblues
AmigaOS Core Developer
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

Post 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.
User avatar
salass00
AmigaOS Core Developer
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

Post 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.
User avatar
salass00
AmigaOS Core Developer
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

Post 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.
User avatar
TSK
Beta Tester
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

Post 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.
Keep the party going !
User avatar
salass00
AmigaOS Core Developer
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

Post 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.
User avatar
TSK
Beta Tester
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

Post by TSK »

Yes to both. HandleScroll is called. The window is window class window.
Keep the party going !
User avatar
salass00
AmigaOS Core Developer
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

Post 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.
Post Reply