COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :

Go Back   Cockos Incorporated Forums > Other Software Discussion > WDL users forum

Reply
 
Thread Tools Display Modes
Old 04-06-2017, 03:58 AM   #1
Nowhk
Human being with feelings
 
Join Date: Mar 2016
Posts: 234
Default OnMouseOver not fired for overlapping elements?

Hi all,

hope all are good boys & girls
Well, I've encountered a trouble with IPlug.

I have two IControl:
- IControlA
- IControlB

Both of them override OnMouseOver event:

Code:
void OnMouseOver(int x, int y, IMouseMod *pMod);
IControlB is placed over IControlA, which intersect part of it. Somethings like this:



The problem is: when I over with mouse the IControlB (the green one), IPlug is not triggering the OnMouseOver of IControlA, even if I'm over also of it.

So for some "overs" of IControlA I can't trigger its OnMouseOver event (which I need).
I've looked into IGraphicsWin, but I don't understand how this mouse event is triggered by Windows. Is it normal? How can I fix it?

I hope the question is clear
Thanks!
Nowhk is offline   Reply With Quote
Old 04-06-2017, 10:07 AM   #2
earlevel
Human being with feelings
 
Join Date: Dec 2015
Posts: 327
Default

Quote:
Originally Posted by Nowhk View Post
The problem is: when I over with mouse the IControlB (the green one), IPlug is not triggering the OnMouseOver of IControlA, even if I'm over also of it.
By design, the top-most (last added) control that the mouse location falls within is returned (see GetMouseControlIdx).

I don't know what you're trying to do, but one solution might be to have a invisible (no drawing) control on top, and have it manage the control beneath, or simply make a composite control.
earlevel is offline   Reply With Quote
Old 04-07-2017, 01:01 AM   #3
Nowhk
Human being with feelings
 
Join Date: Mar 2016
Posts: 234
Default

Quote:
Originally Posted by earlevel View Post
By design, the top-most (last added) control that the mouse location falls within is returned (see GetMouseControlIdx).

I don't know what you're trying to do, but one solution might be to have a invisible (no drawing) control on top, and have it manage the control beneath, or simply make a composite control.
Oh nice, I see where the last control is retuned. Thank you for point it out.
Well, yes... I'l do a sort of "composite" control, where some IControl are stacked "later" from the parent IControl, getting a higher "z-index" (so, over the rest of the nested controls). Thank you mate!
Nowhk is offline   Reply With Quote
Old 04-07-2017, 07:50 AM   #4
Nowhk
Human being with feelings
 
Join Date: Mar 2016
Posts: 234
Default

Another question: what if I need to "track" every over/drag for the whole plugin?
Let say I want to drag somethings to Control A and drop it to Control B (which are in different and far parts of the plug): I could place (as you suggested) an "invisible (no drawing)" IControl over the whole plugin interface...

... but at that point I cannot use knobs and stuff (since there a panel over the beneath elements).

I don't think I can set to it a "pointer-events: none;" as for CSS
Nowhk is offline   Reply With Quote
Old 04-07-2017, 10:12 AM   #5
earlevel
Human being with feelings
 
Join Date: Dec 2015
Posts: 327
Default

Quote:
Originally Posted by Nowhk View Post
Another question: what if I need to "track" every over/drag for the whole plugin?
Let say I want to drag somethings to Control A and drop it to Control B (which are in different and far parts of the plug): I could place (as you suggested) an "invisible (no drawing)" IControl over the whole plugin interface...

... but at that point I cannot use knobs and stuff (since there a panel over the beneath elements).
Well, you don't have to place another control over the top—there are other ways—but if you do, you could certainly track what's underneath yourself (send mouse events to what's underneath). And that's the bottom line—you either need to essential redesign IPlug, or go through the control list yourself and track things.

It's not a design flaw in IPlug, it's just the design—and works for 99.9% of what people want to do. I recall that the old TDM SDK had a more general system of sub/super-views that passed the messages through the hierarchy. It was overkill for plugins (a single, relatively small window) that made sense about 0.1% of the time, and was a needless PITA the other 99.9% of the time.
earlevel is offline   Reply With Quote
Old 04-08-2017, 02:49 AM   #6
Youlean
Human being with feelings
 
Youlean's Avatar
 
Join Date: May 2015
Location: Serbia
Posts: 652
Default

You can use GetMouseOver(), GetMouseX(), GetMouseY() from IGraphics.h You can use this to get values.
Code:
bool IsDirty()
{
int o = mGraphics->GetMouseOver();
int x = mGraphics->GetMouseX();
int y = mGraphics->GetMouseY();
return mDirty;
}
Youlean is offline   Reply With Quote
Old 04-11-2017, 07:57 AM   #7
Nowhk
Human being with feelings
 
Join Date: Mar 2016
Posts: 234
Default

I think I've found the best way. I just call from the "topper" layer the parent one, using a "public-in-the-middle" function, which call the private OnMouseOver.

Thank you both
Nowhk is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 03:47 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.