TopLevelWindow : transparent its component from MouseEvent


#1

I implemented both ResizableWindow and DocumentWindow sometimes ago.

At this step of my code : I was able to move my windows by catching them anywhere in their bodys, even if they were full of components.

and now I cannot.

Which attributes or options have I make disappear ?


#2

I think it’ll let you drag it anywhere as long as the mouse event can reach the background. Probably you’ve changed the components inside so that they’re getting in the way of the mouse clicks now?


#3

Absolutely! Since I “componented” over the background I cannot move window.

So, It rules for me now, but I stay curious for knowing if it’s safety and easy to makle components transparent with mouse, in order to touch the background through a component (or give the illusion of it…)

But this is not an emergency.


#4

Well yes, see Component::hitTest()


#5

well, once you have tested the hit, how can you pass this as a direct mouse click on the window component ?

For example, I have an editable label upon the window titlebar.
If i double click the label, i edit.
If i click & move the label, i move the window…

which message have i to connect to hittest ?


#6

Well, no, it won’t work for that. To do something like that you’d need to make the window attach mouselisteners in cunning ways to detect drags on subcomponents. I’ve never tried doing anything like that but imagine that it could be a can of worms - you’d need to be very careful about which events you intercept.