[Solved]Tooltips behaviour question

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

Bertram
Quite a regular
Quite a regular
Posts: 73
Joined: Wed Oct 02, 2013 14:46

[Solved]Tooltips behaviour question

Postby Bertram » Mon Nov 24, 2014 13:54

Hey there, :)

I'm back with smaller questions this time:

We've managed to restore tooltips in the OpenDungeons project recently and I wanted to try making tooltips display next to the mouse cursor instead of under it.
I tried to follow the tutorial (and I've started updating where I found relevant in regards to the 0.8 version. :]):
http://cegui.org.uk/wiki/Tooltips

The last part doesn't seem to be willing to work for me, though (The one about How to offset the Tooltip so it doesn't render under the mouse).
We made sure to have a OD/Tooltip widget and we link it to the Core/Tooltip widget in the scheme file. Here is the code:
OpenDungeonsSkin.scheme:

Code: Select all

<GUIScheme name="OpenDungeons" version="5">
  ...
 <LookNFeel filename="OpenDungeons.looknfeel" />
 <WindowRendererSet filename="CEGUICoreWindowRendererSet" />
  ...
 <FalagardMapping lookNFeel="OD/Tooltip" renderer="Core/Tooltip" targetType="CEGUI/Tooltip" windowType="OD/Tooltip" />
  ...
</GUIScheme>


The tooltip widget is also defined in our looknfeel file:
OpenDungeons.looknfeel:

Code: Select all

    <WidgetLook name="OD/Tooltip">
        <NamedArea name="TextArea">
            <Area>
                <Dim type="LeftEdge"><ImageDim dimension="Width" name="OpenDungeonsSkin/TooltipLeftEdge" /></Dim>
                <Dim type="TopEdge"><ImageDim dimension="Height" name="OpenDungeonsSkin/TooltipTopEdge" /></Dim>
                <Dim type="RightEdge">
                    <OperatorDim op="Subtract">
                        <UnifiedDim scale="1" type="RightEdge" />
                        <ImageDim dimension="Width" name="OpenDungeonsSkin/TooltipRightEdge" />
                    </OperatorDim>
                </Dim>
                <Dim type="BottomEdge">
                    <OperatorDim op="Subtract">
                        <UnifiedDim scale="1" type="BottomEdge" />
                        <ImageDim dimension="Height" name="OpenDungeonsSkin/TooltipBottomEdge" />
                    </OperatorDim>
                </Dim>
            </Area>
        </NamedArea>
        <ImagerySection name="main">
            <FrameComponent>
                <Area>
                    <Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim>
                    <Dim type="TopEdge"><AbsoluteDim value="0" /></Dim>
                    <Dim type="Width"><UnifiedDim scale="1" type="Width" /></Dim>
                    <Dim type="Height"><UnifiedDim scale="1" type="Height" /></Dim>
                </Area>
                <Image component="TopLeftCorner" name="OpenDungeonsSkin/TooltipTopLeft" />
                <Image component="TopRightCorner" name="OpenDungeonsSkin/TooltipTopRight" />
                <Image component="BottomLeftCorner" name="OpenDungeonsSkin/TooltipBottomLeft" />
                <Image component="BottomRightCorner" name="OpenDungeonsSkin/TooltipBottomRight" />
                <Image component="LeftEdge" name="OpenDungeonsSkin/TooltipLeftEdge" />
                <Image component="RightEdge" name="OpenDungeonsSkin/TooltipRightEdge" />
                <Image component="TopEdge" name="OpenDungeonsSkin/TooltipTopEdge" />
                <Image component="BottomEdge" name="OpenDungeonsSkin/TooltipBottomEdge" />
                <Image component="Background" name="OpenDungeonsSkin/TooltipMiddle" />
            </FrameComponent>
        </ImagerySection>
        <ImagerySection name="label">
            <TextComponent>
                <Area>
                    <Dim type="LeftEdge"><ImageDim dimension="Width" name="OpenDungeonsSkin/TooltipLeftEdge" /></Dim>
                    <Dim type="TopEdge"><ImageDim dimension="Height" name="OpenDungeonsSkin/TooltipTopEdge" /></Dim>
                    <Dim type="RightEdge">
                        <OperatorDim op="Subtract"><UnifiedDim scale="1" type="RightEdge" />
                    <ImageDim dimension="Width" name="OpenDungeonsSkin/TooltipRightEdge" />
                            </OperatorDim>
                        </Dim>
                    <Dim type="BottomEdge">
                        <OperatorDim op="Subtract"><UnifiedDim scale="1" type="BottomEdge" />
                    <ImageDim dimension="Height" name="OpenDungeonsSkin/TooltipBottomEdge" />
                            </OperatorDim>
                        </Dim>
                </Area>
                <Colours bottomLeft="FF000000" bottomRight="FF000000" topLeft="FF000000" topRight="FF000000" />
                <VertFormat type="CentreAligned" />
                <HorzFormat type="CentreAligned" />
            </TextComponent>
        </ImagerySection>
        <StateImagery name="Enabled">
            <Layer>
                <Section section="main" />
                <Section section="label" />
            </Layer>
        </StateImagery>
        <StateImagery name="Disabled">
            <Layer>
                <Section section="main" />
                <Section section="label" />
            </Layer>
        </StateImagery>
    </WidgetLook>


I tried adding the fadein animation between the <WidgetLook> tags, but it seems not to be taken in account while there is no loading warnings in the CEGUI.log file about it.
No fade in, and not offset of the tooltip noticed.

Code: Select all

        <AnimationDefinition name="FadeIn" duration="0.33" replayMode="once">
            <Affector property="Position" interpolator="UVector2" applicationMethod="relative">
                <KeyFrame position="0" value="{{0,12},{0,0}}" />
            </Affector>
        </AnimationDefinition>


Any ideas?

Also, it seems the tooltip position is updated only when I hover a widget and then quickly move next to it, making the tooltip appear on the previous mouse position. As long as the mouse is within the tooltip area, it seems its position doesn't get updated. Do you know how I could fix this? (An option to let the parent widget get the event or something like that?)

Best regards, :)

User avatar
Ident
CEGUI Team
Posts: 1892
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Tooltips behaviour question

Postby Ident » Tue Nov 25, 2014 00:11

It would be nice to know the exact version of CEGUI you use (or simply the log always helps too)

I assume you use some 0.8.X version but not sure which one. However, we havent really made any changes to Tooltips for a while. The wiki article you referenced unfortunately is quite ancient and i haven't used tooltips in a while.

Have you looked at the font demo? It uses a blend-in fading for the tooltip and it works quite flawlessly. You can also move out and back in without issues.

In case there is a bug we would need some sort of reproduction to fix it.
CrazyEddie: "I don't like GUIs"

Bertram
Quite a regular
Quite a regular
Posts: 73
Joined: Wed Oct 02, 2013 14:46

Re: Tooltips behaviour question

Postby Bertram » Wed Nov 26, 2014 13:45

Hi Ident, :)

It would be nice to know the exact version of CEGUI you use (or simply the log always helps too)

Sorry, back to basics, I made tries both on cegui 0.8.2 and 0.8.4 and it's the same behaviour.
About the log, I can give you a minimal test log asap, but I saw no errors or warnings there AFAIK. I will do anyway.

Have you looked at the font demo? It uses a blend-in fading for the tooltip and it works quite flawlessly. You can also move out and back in without issues.

If your speaking about this demo file:
https://bitbucket.org/cegui/cegui/src/5 ... ult#cl-219
Then indeed, there is an interesting way to animate it, while I'm completely sure the tooltip appears under the mouse if you don't move it fast after staying on a button:
https://bitbucket.org/cegui/cegui/src/5 ... lt#cl-2230

I'll try with a mix a the given animation definition and the one from the wiki and provide feed-back.

Thanks for the tips, as always. :)

Best regards,

User avatar
Ident
CEGUI Team
Posts: 1892
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Tooltips behaviour question

Postby Ident » Wed Nov 26, 2014 22:26

Bertram wrote:Then indeed, there is an interesting way to animate it, while I'm completely sure the tooltip appears under the mouse if you don't move it fast after staying on a button:
https://bitbucket.org/cegui/cegui/src/5 ... lt#cl-2230

I am not sure what you mean by "move fast after staying on a button"
I tried to reproduce it: I went on the button with my mouse, waited for the tooltip to come up, then I moved slowly but everytime I would point inside the tooltip's area with my cursor, the tooltip would move (as expected!) and as far as I see this is entirely independent of any mouse movement speeds. Could you elaborate what you mean by "dont move it fast"? I dont see how speed is relevant here.
Oh! I just realised what you mean by "under". You mean underneath as in top to down order not as in depth order right? I assumed you mean depth order... If you want the tooltip to always only be left OR right then you would have to make adjustments to the CEGUI core code. It would be nice to have this in the CEGUI core code. I doubt we support this so far, at least I am not aware of this. Can you confirm that I understand you correctly now? Namely, that you dont care about the mouse covering the tooltip but about the tooltip being left or right of the mouse only.

Can you also tell me where you have noticed this behaviour before? A game or application name or video would be helpful.
CrazyEddie: "I don't like GUIs"

Bertram
Quite a regular
Quite a regular
Posts: 73
Joined: Wed Oct 02, 2013 14:46

Re: Tooltips behaviour question

Postby Bertram » Thu Nov 27, 2014 14:16

Hey, :)

If you want the tooltip to always only be left OR right then you would have to make adjustments to the CEGUI core code. It would be nice to have this in the CEGUI core code. I doubt we support this so far, at least I am not aware of this. Can you confirm that I understand you correctly now? Namely, that you dont care about the mouse covering the tooltip but about the tooltip being left or right of the mouse only.


That's it. I want the tool tip to appear next to the mouse cursor, not below the cursor image, if you prefer.
Here, it would right of the cursor as done in many applications.

Can you also tell me where you have noticed this behaviour before? A game or application name or video would be helpful.

In a lot of places when you come to think about it. E.g.:
http://alvinalexander.com/blog-files/ja ... xample.jpg
http://docs.joomla.org/images/0/0d/Tool ... 090208.png

It would be nice to have this in the CEGUI core code. I doubt we support this so far, at least I am not aware of this.

Well, the tutorial maker seemed to have achieved it through the use of an offset appliance in the fade-in animation, but I'll need to try again and see whether I can make it work through that.
In any case, as you said, it would be good to add this in the API. What kind of API would you be ready to accept in the project, as I'd happily code that part, and do a PR for 0.9/1.0 if you want.

I am not sure what you mean by "move fast after staying on a button"
I tried to reproduce it: I went on the button with my mouse, waited for the tooltip to come up, then I moved slowly but everytime I would point inside the tooltip's area with my cursor, the tooltip would move (as expected!) and as far as I see this is entirely independent of any mouse movement speeds. Could you elaborate what you mean by "dont move it fast"? I dont see how speed is relevant here.

Now that you are clear about the point that the mouse tooltip appears below the mouse cursor image, let's say that if you move you cursor a little just before the tooltip appears, the tooltip will be displayed next to your cursor and will move along your mouse movements, as long as you stay within the concerned widget area.
But if you put your cursor over a widget, and wait for the tooltip to appear, it then appears below the mouse cursor and won't move as long as you don't leave the tooltip own's area, which is annoying, especially since clicking on the tooltip will make the tooltip disappear, but won't give the click to the concerned control and that's not what you want.
Thus, you often end up with annoying tooltips under your cursor everytime you want to click on a button and you have to click at least two times.
Is it better explained that way?

Best regards,

User avatar
Ident
CEGUI Team
Posts: 1892
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Tooltips behaviour question

Postby Ident » Thu Nov 27, 2014 15:00

Bertram wrote:In a lot of places when you come to think about it. E.g.:
http://alvinalexander.com/blog-files/ja ... xample.jpg

I already tried out a "lot of places". E.g.: Firefox, Visual Studio, Windows,... They all do it the way that CEGUI does it and place it below. Your screenshot also clearly shows the cursor ABOVE the tooltip, and the tooltip is below. I am very confused.


This looks like a bug to me. The tooltip is at bottom right with some offset, i wouldnt call it fully on the right because its not centered in height in relation to the cursor's y-position, it is more or less just position below-right but not just "right" of it either.

Bertram wrote:Well, the tutorial maker seemed to have achieved it through the use of an offset appliance in the fade-in animation, but I'll need to try again and see whether I can make it work through that.
In any case, as you said, it would be good to add this in the API. What kind of API would you be ready to accept in the project, as I'd happily code that part, and do a PR for 0.9/1.0 if you want.

Preferrably modify v0-8 but only if you dont break the abi (more info on the bitbucket page of CEGUI). If you think you need to change the function signature of any existing function then you MUST to do the changes in default branch. Default will be 1.0. Default branch can be taken from our repository (bitbucket). Adding things doesn't break the ABI in general unless you add variables to existing classes etc., like i said you will find more info on this in the bitbucket site of cegui.


I am not sure what you mean by "move fast after staying on a button"
I tried to reproduce it: I went on the button with my mouse, waited for the tooltip to come up, then I moved slowly but everytime I would point inside the tooltip's area with my cursor, the tooltip would move (as expected!) and as far as I see this is entirely independent of any mouse movement speeds. Could you elaborate what you mean by "dont move it fast"? I dont see how speed is relevant here.

Now that you are clear about the point that the mouse tooltip appears below the mouse cursor image, let's say that if you move you cursor a little just before the tooltip appears, the tooltip will be displayed next to your cursor and will move along your mouse movements, as long as you stay within the concerned widget area.
But if you put your cursor over a widget, and wait for the tooltip to appear, it then appears below the mouse cursor and won't move as long as you don't leave the tooltip own's area, which is annoying, especially since clicking on the tooltip will make the tooltip disappear, but won't give the click to the concerned control and that's not what you want.
Thus, you often end up with annoying tooltips under your cursor everytime you want to click on a button and you have to click at least two times.
Is it better explained that way?[/quote]
Are we talking about current CEGUi functionality? If so:
1. If i move the mouse in the SampleBrowser, the tooltip does NOT appear.
2. If it starts appearing (with blend-in animation) I can move my mouse and the tooltip does not move any further, which seems to contradict what you said: "will move along your mouse movements"
I tried this in the SampleBrowser in the Font demo. It also seems impossible to ever point at the tooltip so i also can't follow your second complaint regarding the tooltip catching any inputs or the possibility to click on it.

Mind making a video or screenshot of this?
CrazyEddie: "I don't like GUIs"

Nyast
Just popping in
Just popping in
Posts: 12
Joined: Mon Sep 15, 2014 17:37

Re: Tooltips behaviour question

Postby Nyast » Fri Dec 19, 2014 21:13

If I remember well I encountered the same problem, and after spending hours searching on this forum, I saw the issue being discussed a lot of time ago. It was related to the mouse cursor. When using CEGUI's mouse cursor, the tooltip correctly takes the offset into account. But when you disable CEGUI's mouse cursor to use the default OS's one, the offset is zero, and the tooltip behavior becomes wrong. Hope that helps.

User avatar
Ident
CEGUI Team
Posts: 1892
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Tooltips behaviour question

Postby Ident » Fri Dec 19, 2014 23:12

Nyast wrote:If I remember well I encountered the same problem, and after spending hours searching on this forum, I saw the issue being discussed a lot of time ago. It was related to the mouse cursor. When using CEGUI's mouse cursor, the tooltip correctly takes the offset into account. But when you disable CEGUI's mouse cursor to use the default OS's one, the offset is zero, and the tooltip behavior becomes wrong. Hope that helps.

Aha! That is very valuable information. I will file a bug for this so we will look into it before 1.0. I can't check it right now but maybe the OP will get back to it (?) :?

Mantis ticket: http://cegui.org.uk/mantis/view.php?id=1058
CrazyEddie: "I don't like GUIs"

Bertram
Quite a regular
Quite a regular
Posts: 73
Joined: Wed Oct 02, 2013 14:46

Re: Tooltips behaviour question

Postby Bertram » Mon Dec 29, 2014 20:28

Hi there, :)

And a happy new year to the whole team. :)

Sorry I didn't answer earlier, life has been quite a ride this month. Thanks for the info Nyast and for the issue opened Ident. :)
If you have any pointers on where to start in the code and what to look at, I can take a look at it.
I simply hope this won't become some per OS nightmare patch. :lol:

Cheers,

User avatar
Ident
CEGUI Team
Posts: 1892
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Tooltips behaviour question

Postby Ident » Mon Dec 29, 2014 20:51

Could you first confirm or falsify that this is just an issue with no mouse cursor image set as Nyast described it?
CrazyEddie: "I don't like GUIs"

Bertram
Quite a regular
Quite a regular
Posts: 73
Joined: Wed Oct 02, 2013 14:46

Re: Tooltips behaviour question

Postby Bertram » Tue Dec 30, 2014 10:47

Ident wrote:Could you first confirm or falsify that this is just an issue with no mouse cursor image set as Nyast described it?

Yeah, I must say that was part of the plan.

I confirm what Nyast said is correct. When i add this in our GUI loading code, the tooltips have got a correct offset:

Code: Select all

CEGUI::GUIContext& context = CEGUI::System::getSingleton().getDefaultGUIContext();
context.getMouseCursor().setDefaultImage("OpenDungeonsOldSkin/CheckboxMark");
context.getMouseCursor().setVisible(true);


(The image chosen is rather random but this is working.) I can unfortunately not upload pictures here but the offset is applied and the tooltip is placed bottom right per default.

Best regards,

User avatar
Ident
CEGUI Team
Posts: 1892
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Tooltips behaviour question

Postby Ident » Tue Dec 30, 2014 11:32

Attachments are activated from now on, we will keep them activated as long as they are used respectfully.

Also a happy new year to you, too!

Regarding the bug, thanks for your feedback, this makes it pretty clear where the issue comes from.
Attachments
fireworks2.jpg
CrazyEddie: "I don't like GUIs"

Bertram
Quite a regular
Quite a regular
Posts: 73
Joined: Wed Oct 02, 2013 14:46

Re: Tooltips behaviour question

Postby Bertram » Tue Dec 30, 2014 11:53

Hey :)

Don't worry, I don't plan uploading posters. ;)
Here is the tooltip example with a (non-fitting) mouse cursor of 12x12 px:
tooltip_ok.png
tooltip_ok.png (34.42 KiB) Viewed 1379 times


Note that I tried using a 1x1 px icon to workaround the "bug", and the former behaviour happens...
This means the cursor size is taken in account to setup the tooltip position and I suppose CEGUI has got a hard time detecting the OS cursor image size?

Best regards,

User avatar
Ident
CEGUI Team
Posts: 1892
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Tooltips behaviour question

Postby Ident » Tue Dec 30, 2014 11:58

Bertram wrote:Hey :)

Don't worry, I don't plan uploading posters. ;)
Here is the tooltip example with a (non-fitting) mouse cursor of 12x12 px:
tooltip_ok.png

So the cursor we see here is not a CEGUI cursor but coming from outside-CEGUI rendering or the OS?

Bertram wrote:Note that I tried using a 1x1 px icon to workaround the "bug", and the former behaviour happens...
This means the cursor size is taken in account to setup the tooltip position and I suppose CEGUI has got a hard time detecting the OS cursor image size?

Best regards,

I don't think detecting OS cursor sizes is feasible. However, it should be possible to make an addition so that you can use the cursor without image but still specify a size for it. IT would then be up to the user to specify the cursor size according to the queried size of the OS cursor. This should be no problem.

I got two questions though: Why do you use your OS cursor and not a CEGUI cursor?
And did you try to use a fully transparent cursor with the OS cursor's size? This could be a workaround in case the fix will not be added to v0-8 because it might break the ABI/API
CrazyEddie: "I don't like GUIs"

Bertram
Quite a regular
Quite a regular
Posts: 73
Joined: Wed Oct 02, 2013 14:46

Re: Tooltips behaviour question

Postby Bertram » Tue Dec 30, 2014 12:16

So the cursor we see here is not a CEGUI cursor but coming from outside-CEGUI rendering or the OS?

In the picture, the little blue square at the edge of the arrow is the CEGUI cursor image.
The mouse arrow itself is the OS cursor, but I could have hidden it, it doesn't make any difference.

I don't think detecting OS cursor sizes is feasible. However, it should be possible to make an addition so that you can use the cursor without image but still specify a size for it. IT would then be up to the user to specify the cursor size according to the queried size of the OS cursor. This should be no problem.

Cool :)

I got two questions though: Why do you use your OS cursor and not a CEGUI cursor?

Because basically, the ultimate goal is to use a mesh displayed over the GUI. There won't be any 2D image cursor at all in the end once we've figured out how to do it.

And did you try to use a fully transparent cursor with the OS cursor's size? This could be a workaround in case the fix will not be added to v0-8 because it might break the ABI/API

Yeah, I just did that, in fact. ;)
https://github.com/Bertram25/OpenDungeo ... 80c25edbb9

Best regards,


Return to “Help”

Who is online

Users browsing this forum: No registered users and 2 guests