[SOLVED] tooltip on comboboxes and tabcontrols

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

User avatar
sjcomp
Not too shy to talk
Not too shy to talk
Posts: 30
Joined: Wed Apr 27, 2005 14:59
Contact:

[SOLVED] tooltip on comboboxes and tabcontrols

Postby sjcomp » Fri Dec 05, 2008 08:21

Hello,

I have tooltips displaying properly for all elements other than comboboxes and tab control buttons. What might be the cause of it? I'm using cegui 0.5.1.

Thanks.
Last edited by sjcomp on Mon Dec 08, 2008 06:27, edited 1 time in total.

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

Postby CrazyEddie » Fri Dec 05, 2008 10:08

Hi,

I guess you're setting the tooltip text on the base container for the combobox and tabcontrol (as well you might expect to), the issue is that the system thinks the mouse is over different windows (the component parts of the combobox and tabcontrol). There is a mechanism whereby children can inherit the parent tooltip text (which is what you need), though this is disabled on all widgets by default - it should really be enabled by default (as is the case in SVN trunk IIRC - I'm not suggesting you start using that btw ;) ).

One solution would be to edit your looknfeel skin file and add a property initialiser to each WidgetLook definition to enable this setting:

Code: Select all

<Property name="InheritsTooltipText" value="True" />


Bit of a pain, though it should get you what you want.

CE.

User avatar
sjcomp
Not too shy to talk
Not too shy to talk
Posts: 30
Joined: Wed Apr 27, 2005 14:59
Contact:

Postby sjcomp » Sat Dec 06, 2008 17:13

Thanks, CE. An easy solution actually :) It works perfectly for comboboxes. But I see that I have a different issue with TabControl. I'd like to assign hints to TabControl buttons, but I have no access to them through my layout. I did assign hints to the tab panes (DefaultWindow), but it simply shows hint when I hover over the window itself. My question is: can I assign hints to tabcontrol buttons through the layout?

I can take care of it through my program and reassign hints from the tab pane to the corresponding button. But maybe there is a more elegant solution (like a few copy/paste operations)? :)

Thanks.

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

Postby CrazyEddie » Sat Dec 06, 2008 18:18

Providing you add your tab content directly as child elements of the TabControl - meaning the TabControl definition and it's content are in the same layout - it's possible to set the tooltips. Basically you use the auto-window mechanism to set the Tooltip property on the automatically created button. The key is that the AutoWindow element must appear after the Window definitions for the tab pane content.

The tab pane buttons are named as: __auto_TabPane__Buttons__auto_btn<content name>, so if your content window was named "APane", the button for it is called "__auto_TabPane__Buttons__auto_btnAPane"

So, for example:

Code: Select all

        <Window Type="TaharezLook/TabControl" Name="myTabControl" >
            <Property Name="Tooltip" Value="This is the tab control" />
            <Property Name="TabHeight" Value="{0,-1}" />
            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
            <Property Name="TabPanePosition" Value="Bottom" />
            <Property Name="UnifiedAreaRect" Value="{{0,10},{0,30},{1,-10},{1,-10}}" />

            <Window Type="DefaultWindow" Name="myTabControl/APane" >
                <Property Name="Text" Value="A Pane" />
            </Window>

            <!-- Set the tooltip for the tab button -->
            <AutoWindow NameSuffix="__auto_TabPane__Buttons__auto_btnAPane" >
                <Property Name="Tooltip" Value="This is a pain!" />
            </AutoWindow>

        </Window>


HTH

CE

User avatar
sjcomp
Not too shy to talk
Not too shy to talk
Posts: 30
Joined: Wed Apr 27, 2005 14:59
Contact:

Postby sjcomp » Sat Dec 06, 2008 22:45

Thanks, CE. It does work! It's a pity that CELayoutEditor removes them when I save the document. Is there a way to configure the editor?

Thanks a lot for very quick help!

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

Postby CrazyEddie » Sun Dec 07, 2008 10:39

Hi,

IIRC there have been other posts with regards to manually added content being removed in the editor, although those dealt with 'normal' properties that are just not supported by the editor and get removed. I've not looked at this specific case, though it's probably a CEGUI issue, since CEGUI is actually writing the XML.

So no, I do not think there's a (simple) way to get this support at the moment, unfortunately. (Unless someone else knows different, of course :) ).

CE.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 7 guests