Private gadget under a Virtual: no GM_HANDLEINPUT and wrong clipping coords.
I'm trying to put a "private gadget" done with MakeClass() and a dispatcher, in a vertical layout under a "Virtual scroller".
- My gadget code may not be 100% compliant, but i'm looking forward for that. -
I draw things with OM_RENDER, and receive mouse clicks with GM_HANDLEINPUT.
For testing purpose, the vertical layout has 3 elements: 2 buttons and an instance of my private gadget.
I have 2 problems so far, I didn't have when I was using my private gadget outside Virtual:
1. When the main window is big enough for the Virtual to not have scrollers, my gadget receive GM_HANDLEINPUT events. If I resize the window smaller, at some point the Virtual scrollers show up, my gadget is still drawn, but no GM_HANDLEINPUT at all are sent to my gadget. tracing things, it doesnt even reach GM_HITTEST (which return always GMR_GADGETHIT in all cases). Yet, the 2 buttons in the same layout of my gadgets are reacting to clicks !
Is there something I'm missing to tell my gadget should receive clicks also in that case ? a GA_XXX property ? some rectangle to initiate in GM_layout to tell I should be mouse tested ?
2. I draw ellipsis inside my gadget, and this must be clipped with the rectangle of my gadget or it draws upon the neighbours. outside virtual this used to work with:
ClearRegion(gdata->_clipRegion);
OrRectRegion(gdata->_clipRegion, &gdata->_framerec);
oldClipRegion = InstallClipRegion( rp->Layer, gdata->_clipRegion);
(draw)
InstallClipRegion( rp->Layer,oldClipRegion);
... but inside a virtual, there is a "shift" of the clipping rectangle, that seems to be the position of the virtual itself. That said, drawing rectangle is correct and correspond exactly to gdata->_framerec.
Some idea fro the way I should manage my "additional rectangle clipping" ?
gadget code at:
https://github.com/krabobmkd/aukadicty/tree/krb/devc/aukboopsi/TrackGad…
main window and integration in layout, line 394:
https://github.com/krabobmkd/aukadicty/blob/krb/devc/aukboopsi/aukboops…
I'm actually testing some layout to do some clone of audacity, and the gadget should display audio track at some point .
Edit: Because I need infinite scrolling and scroll view management more close to "list" management, I stopped using Virtual, that can be adapted to a regular layout gadget but not my current project... Yet I didn't understand why my private gadget wouldnt have its legitimate GM_HANDLEINPUT in that case, so I let this post as it is; But I should have done a branch on the github, because the links up there are not using Virtual anymore.