Bug 178044 - Trees and Tables with owner draw don't show rollover effect (tooltip)
Summary: Trees and Tables with owner draw don't show rollover effect (tooltip)
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal with 1 vote (vote)
Target Milestone: 3.4 M4   Edit
Assignee: Steve Northover CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 174675 204976 (view as bug list)
Depends on:
Blocks: 177339 188333 191673 210809
  Show dependency tree
 
Reported: 2007-03-19 09:04 EDT by Markus Keller CLA
Modified: 2008-04-18 08:19 EDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2007-03-19 09:04:31 EDT
I20070313-1051

Trees and Tables with a PaintItem listener installed do not show tooltips when hovering over clipped items. To reproduce, run the ControlExample, install the PaintItem listener and expand the Tree / resize a Table header.
Comment 1 Benjamin Pasero CLA 2007-03-19 09:41:32 EDT
Duplicate/Related to Bug 174675
Comment 2 Markus Keller CLA 2007-06-11 07:00:30 EDT
We should decide early in 3.4 whether this feature will be supplied by SWT (e.g. by using the EraseItem and PaintItem callbacks with different background colors to draw in the tooltip), or whether JFace has to offer support for it.
Comment 3 Steve Northover CLA 2007-06-11 09:44:16 EDT
Given that tree hover help doesn't happen on every platform, then JFace should not support it.
Comment 4 Markus Keller CLA 2007-07-17 05:38:44 EDT
This will likely need new API, and it would be good to have the SWT implementation ready before the new JFace support for owner draw label providers is released (bug 188333).
Comment 5 Steve Northover CLA 2007-07-17 09:59:48 EDT
>Given that tree hover help doesn't happen on every platform, then JFace should
>not support it.
Comment 6 Randy Hudson CLA 2007-07-17 10:15:28 EDT
Steve, JFace isn't supporting a fix to the lost rollover on win32. They're just creating an extensible owner-draw framework (your favorite word), so that multiple plug-ins/sources can contribute to the painting of a common Tree. So the only concern from that point of view is that the native behavior on win32 degrades with owner draw.

Couldn't the same API be used for this fix? Listeners receives a paint callback with a GC and some dimensions. It just happens that the GC is on a popup shell instead of the actual tree.
Comment 7 Randy Hudson CLA 2007-07-17 10:24:50 EDT
my bad, in comment 2 MK hints at jface fixing the bug if SWT wouldn't.
Comment 8 Markus Keller CLA 2007-07-17 10:34:43 EDT
(In reply to comment #5)
Yes, but JFace will add API that clients have to implement to get owner draw
support.

If you want to make the hover help tooltips look exactly the same as native
tooltips for non-owner-draw trees/tables, then you need to know what part of an
owner-drawn label should be considered as "text" (should go into the tooltip)
and what part should be considered as "image" (not in tooltip).

This may not look like additional API in SWT due to bug 81334, but will
probably influence the new JFace API. I just wanted to make affected parties aware of this potential dependency.
Comment 9 Steve Northover CLA 2007-07-18 15:39:25 EDT
On Vista, the image is part of the tool tip.
Comment 10 Steve Northover CLA 2007-07-18 15:40:57 EDT
I'm hoping to fix this the same way that Randy suggested, however, there may be unforseen problems with this approach.
Comment 11 Markus Keller CLA 2007-07-19 08:45:23 EDT
(In reply to comment #9)
> On Vista, the image is part of the tool tip.

An even better and easier approach than faking native-looking tooltips on XP and Vista would be to support the Vista-style tooltips on all platforms for owner-drawn items. After all, the items are not really native any more, so why should their hover help be?

This would be helpful on all platforms and would probably not need new API just for WinXP emulation.
Comment 12 Randy Hudson CLA 2007-07-19 10:16:30 EDT
> An even better and easier approach than faking native-looking tooltips on XP
> and Vista would be to support the Vista-style tooltips on all platforms for
> owner-drawn items. After all, the items are not really native any more, so why
> should their hover help be?

Not to agree or disagree, but can we agree on the terminology? "Tooltips" to me mean displaying *additional* information that is:
 - normally not visible
 - appears after the hover event/threshold
 - positioned outside of the thing it is describing
To avoid confusion, can we use "Rollover" to mean:
 - the display of clipped/truncated (but at other times plainly visible) information
 - something immediately displayed (on mouse over)
 - and in the same location as the "shortened form"

Since jface recently implemented tooltip "emulation" for individual items or even "cells", both of these terms are valid when describing a treeitem. It also reminds you of the subtle details that make this hard, and maybe only solvable by the SWT team. If a popup shell is used, it basically has to be a ghost so that moves, clicks, hovers, etc. are routed to the underlying tree.

We tried making rollovers work in the GEF palette a while back, and a simple, cross-platform approach wasn't found. Mouse capture was risky and only reliable (for SWT clients) on win32. Since the palette is a black box, a compromise was OK there.

See Veronika's comments in bug 19430.
Comment 13 Markus Keller CLA 2007-07-24 04:27:06 EDT
> If a popup shell is used, it basically has to be a ghost so
> that moves, clicks, hovers, etc. are routed to the underlying tree.
> 
> [..] Mouse capture was risky [..]

I don't think full capture is necessary. It would be enough to listen for MouseDown events, dispose the rollover tooltip, and Display#post(..) the MouseDown event again. I hacked this into the QuickAccess dialog and it worked fine.
Comment 14 Martin Aeschlimann CLA 2007-10-02 12:13:54 EDT
*** Bug 204976 has been marked as a duplicate of this bug. ***
Comment 15 Markus Keller CLA 2007-11-02 14:02:47 EDT
Could this problem please be tackled for 3.4? This is a major usability/productivity impediment for all owner-drawn widgets.
Comment 16 Thomas Schindl CLA 2007-11-15 10:41:59 EST
(In reply to comment #13)
> > If a popup shell is used, it basically has to be a ghost so
> > that moves, clicks, hovers, etc. are routed to the underlying tree.
> > 
> > [..] Mouse capture was risky [..]
> 
> I don't think full capture is necessary. It would be enough to listen for
> MouseDown events, dispose the rollover tooltip, and Display#post(..) the
> MouseDown event again. I hacked this into the QuickAccess dialog and it worked
> fine.
> 

JFace Tooltips will provide this feature as I can resolve bug #195137. On OS-X there's a problem with hiding a Shell if you study the code. I didn't had time to file an issue against SWT.
Comment 17 Steve Northover CLA 2007-11-15 10:50:18 EST
Ok, but when this bug gets fixed, we will need to be on the look out for 2 tooltips.  Also, JFace tooltips have the wrong look on Vista (not sure right now how to get you the right one).
Comment 18 Steve Northover CLA 2007-11-26 16:32:13 EST
Fixed > 20071126
Comment 19 Markus Keller CLA 2007-11-28 06:22:09 EST
Thanks a lot for fixing this, Steve!

I filed bugs 211194 thru 211197 for a few follow-up issues.
Comment 20 Steve Northover CLA 2007-11-28 11:45:23 EST
I expected there to be a few problems.  Thanks for entering the bugs.
Comment 21 Markus Keller CLA 2008-04-18 08:19:36 EDT
*** Bug 174675 has been marked as a duplicate of this bug. ***