Disable interactions on Eto Control object

Hi!

I’m using PixelLayout in a form in order to layer some eto controls on top of each other, pretty much all of my controls are drawables for custom designs.
Is there a way to disable all interactions for the top control so that I can get OnMouseHover etc on the one under it?
Right now the top control blocks the interactions below. I only wan’t the top control to be displayed, otherwise ignored.

Is there an attribute I’m missing for disabling this?
Or do I have to do fancier stuff, like making the top one trigger the events on the bottom one manually?

Hey @flarback,

Sorry, no there is no (current) way to have a control overtop another without it taking the mouse events.

Cheers,
Curtis.

I see, I’ll have to find another workaround.

Thanks for the response @curtisw!

Bummer, I was hoping there was a method to disable a control but still have it visually show up.

@curtisw how do you suggest to add text on top of a drawable?

Do we do this in the drawable itself via the DrawText method?

Maybe I’m way off, but first thing comes to my mind is to have the upper control handle mouse events by calling a function in the lower control.

1 Like

This makes sense for certain applications.

But sometimes the upper control may be smaller with a larger control under it.

What happens in that case is the mouse will detect the larger control beyond until it intersects the bounds of the smaller control on top and you’ll get a sort of “flickering/fighting” between which control is getting the focus/attention.

image

@michaelvollrath,

Ah, I had assumed that the upper control filled the bounds of the lower and perfectly covered it. Is it possible to force the upper to fill the lower? (At least the height?) If not, another potential solution that comes to mind is to have both the lower and upper controls respond to mouse events the same way. For example, the event handler in each control could both ultimately call the same function in the containing form.

To be clear, I’ve only made simple eto forms using standard controls. My few test attempts at making drawable ones have failed miserably.

1 Like

The most efficient/flexible way would be to use e.Graphics.DrawText() during the paint event. You can also add child control(s) which appear overtop the drawable, and if they don’t handle any mouse events (e.g. Label) then the Drawable should be able to handle those events.

Hope this helps.

1 Like

Not that I’m anything but amateur but I’m thinking about releasing some basic examples of drawables I’ve cobbled together from help from users on my own posts or others and sharing those as bite size examples samples to help others.

I’ve been struggling to wrap my head around Eto but it’s starting to click now and I’m able to create most of what I’m thinking of.

Thank @curtisw, this is exactly the direction I ended up going in and actually makes the most sense to do it this way anyway unless specifically wanting different interaction events for different parts of the control of course.

Thanks for your insights!

1 Like