GADGETUP message missing if gadget is in sub layout

This forum is for general developer support questions.

GADGETUP message missing if gadget is in sub layout

Postby TSK » Sun Nov 20, 2016 1:28 am

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
TSK
Beta Tester
Beta Tester
 
Posts: 215
Joined: Mon Dec 20, 2010 2:15 pm
Location: Home land of Santa C., sauna, sisu and salmiakki

Re: GADGETUP message missing if gadget is in sub layout

Postby salass00 » Sun Nov 20, 2016 9:59 pm

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
salass00
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 460
Joined: Sat Jun 18, 2011 4:12 pm
Location: Finland

Re: GADGETUP message missing if gadget is in sub layout

Postby TSK » Mon Nov 21, 2016 12:39 am

@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
TSK
Beta Tester
Beta Tester
 
Posts: 215
Joined: Mon Dec 20, 2010 2:15 pm
Location: Home land of Santa C., sauna, sisu and salmiakki

Re: GADGETUP message missing if gadget is in sub layout

Postby broadblues » Mon Nov 21, 2016 2:45 am

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
broadblues
Beta Tester
Beta Tester
 
Posts: 416
Joined: Sat Jun 18, 2011 3:40 am
Location: Portsmouth, UK

Re: GADGETUP message missing if gadget is in sub layout

Postby salass00 » Mon Nov 21, 2016 10:44 am

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: 460
Joined: Sat Jun 18, 2011 4:12 pm
Location: Finland

Re: GADGETUP message missing if gadget is in sub layout

Postby salass00 » Mon Nov 21, 2016 11:04 am

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
salass00
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 460
Joined: Sat Jun 18, 2011 4:12 pm
Location: Finland

Re: GADGETUP message missing if gadget is in sub layout

Postby TSK » Mon Nov 21, 2016 4:36 pm

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
TSK
Beta Tester
Beta Tester
 
Posts: 215
Joined: Mon Dec 20, 2010 2:15 pm
Location: Home land of Santa C., sauna, sisu and salmiakki

Re: GADGETUP message missing if gadget is in sub layout

Postby salass00 » Mon Nov 21, 2016 5:27 pm

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
salass00
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 460
Joined: Sat Jun 18, 2011 4:12 pm
Location: Finland

Re: GADGETUP message missing if gadget is in sub layout

Postby TSK » Mon Nov 21, 2016 7:42 pm

Yes to both. HandleScroll is called. The window is window class window.
Keep the party going !
User avatar
TSK
Beta Tester
Beta Tester
 
Posts: 215
Joined: Mon Dec 20, 2010 2:15 pm
Location: Home land of Santa C., sauna, sisu and salmiakki

Re: GADGETUP message missing if gadget is in sub layout

Postby salass00 » Tue Nov 22, 2016 10:28 am

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.
User avatar
salass00
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 460
Joined: Sat Jun 18, 2011 4:12 pm
Location: Finland

Next

Return to General Developer Support

Who is online

Users browsing this forum: Google [Bot] and 1 guest