v0.6.2 Tooltips and MousePassThrough

If you found a bug in our library or on our website, please report it in this section. In this forum you can also make concrete suggestions or feature requests.

Moderators: CEGUI MVP, CEGUI Team

Jamarr
CEGUI MVP
CEGUI MVP
Posts: 812
Joined: Tue Jun 03, 2008 23:59
Location: USA

v0.6.2 Tooltips and MousePassThrough

Postby Jamarr » Thu Oct 15, 2009 22:31

This is in v0.6.2, as I do not have v0.7 yet I cannot test this there.

If you have a button with a tooltip, and the tooltip appears under the cursor, when you click the event is consumed by the tooltip and not the button. So the button doesnt fire and your window loses focus. Note that the tooltip must appear directly under the cursor, if the tooltip is offset from the cursor (because you are near the edge of the screen) this doesn't happen. To fix this, you can set MousePassThroughEnabled to true on the tooltip window; I believe this should be the default setting for a tooltip window.
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: v0.6.2 Tooltips and MousePassThrough

Postby CrazyEddie » Fri Oct 16, 2009 12:10

Hi,

I can see how this could be an issue. The thing about having pass-through enabled is that the tool-tip is not then informed about the mouse entering it; this notification is normally used to reposition the tool-tip window. Obviously you can set the state manually, or edit the looknfeel to set it as the default (I assume you already did this for yourself, though? :)). I guess a compromise would be to detect clicks on the tooltip window and dismiss it when the user clicks it?

CE.

Jamarr
CEGUI MVP
CEGUI MVP
Posts: 812
Joined: Tue Jun 03, 2008 23:59
Location: USA

Re: v0.6.2 Tooltips and MousePassThrough

Postby Jamarr » Fri Oct 16, 2009 17:29

Right, I forgot about the repositioning.

Discarding click events wouldn't really help, because your still throwing away input when the user was obviously trying to click something - so in this respect there is no difference than if the tooltip consumes it. Imho, tooltips should be treated as transparent entities, and so the click should go through to the underlying window.

I think there are a couple of options. First, the tooltip window could appear offset from the cursor instead of the top-left corner being directly under it. Second, you could just forward click events from the tooltip to the target window. I'm not sure which is better...
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: v0.6.2 Tooltips and MousePassThrough

Postby CrazyEddie » Sat Oct 17, 2009 08:43

I'll fix the positioning anyway, since that's a very easy fix and I think would be better if offset from the image edge instead of the mouse 'hot-spot'.

I may add an option for forwarding the events ;)

CE.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: v0.6.2 Tooltips and MousePassThrough

Postby CrazyEddie » Sun Oct 18, 2009 18:33

I looked at the positioning of the tooltip and it already takes account of the mouse image size - so really, unless space is extremely limited, the tooltip should only ever rarely appear directly beneath the cursor. Indeed, when I fixed bugs and implemented suggestions previously regarding this, I had to disable the repositioning code entirely in order to test! So this makes me wonder how you guys are doing this in the first place :D

With reference to what I said about mouse clicks, I did not mean to discard them, rather I meant that if the mouse is within the tooltip and you click the mouse button, the tooltip would go away exposing whatever is beneath.

Having thought about the 'forwarding' a little, this is not so straight forward; the logic of many widgets will check where the mouse is and decide what to do based on that - this means that when the mouse down / up events are forwarded the behaviour will rarely be correct since - under the conditions described earlier in the thread - the mouse is 'in' the ToolTip window. So for example, a PushButton would not fire the Clicked event under this arrangement, and similarly, things like checkboxes and radio buttons would not change state.

This leaves us with the original point of MousePassThough - which is user-configurable anyway via the looknfeel, although - as already discussed - doing this will cause the tip repositioning code to not do anything ;)

CE.

Jamarr
CEGUI MVP
CEGUI MVP
Posts: 812
Joined: Tue Jun 03, 2008 23:59
Location: USA

Re: v0.6.2 Tooltips and MousePassThrough

Postby Jamarr » Mon Oct 19, 2009 20:08

CrazyEddie wrote:I looked at the positioning of the tooltip and it already takes account of the mouse image size - so really, unless space is extremely limited, the tooltip should only ever rarely appear directly beneath the cursor. Indeed, when I fixed bugs and implemented suggestions previously regarding this, I had to disable the repositioning code entirely in order to test! So this makes me wonder how you guys are doing this in the first place :D


But it only uses the mouse-image size if you are using a CEGUI mouse-cursor, otherwise it uses 0x0 for the size. This leads to the top-left corner of the tooltip being set to the position of the mouse :D
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: v0.6.2 Tooltips and MousePassThrough

Postby CrazyEddie » Tue Oct 20, 2009 08:46

Yeah, I can see how this could be an issue. The reason being, of course, is that CEGUI only knows about it's own mouse cursor. What you could do is set a dummy image of the appropriate size, then the behaviour would be correct (yes, that's a hack :P)

CE.


Return to “Bug Reports, Suggestions, Feature Requests”

Who is online

Users browsing this forum: No registered users and 10 guests