|Having a Shell follow a target Control around [message #1753714]
||Thu, 09 February 2017 09:15
| Andreas Sewe
Registered: June 2013
I am trying to implement a Shell (think: extended tooltip) that follows another Control around even if the "target" is resized or moved. Using a ControlListener for this works fine if the target is resized, but doesn't always work when it is moved around: When the target's parent moves, the target itself doesn't move relative to the parent, but it clearly moves from the user's perspective. Hence the tooltip should move as well.
So far, I have found to "solutions" to this problem, none of which is great.
The first solution requires not only a ton of listeners but also triggers on many moves that don't affect the target because an intermediate Control has a layout that insulates the target from the move's effects.
- Register ControlListeners to all ancestors of the target control.
- Use a PaintListener instead of a ControlListener.
The second solution also triggers too often, as paints may be caused by something other than a move or resize.
Is there a better solution?
Powered by FUDForum
. Page generated in 0.01465 seconds