Custom tooltip
Posted: Thu Jun 26, 2008 17:17
Hi,
i'm starting using CEGUI and i'm reproducing some features i've implemented in a different GUI system. I'm trying to create a tooltip made of two text lines, a title and a description. The title has a type bigger font, the other a small one.
I'd like to ask how i can subclass the existing tooltip. I'm thinking of passing the 2 strings with setTooltipText with a new line between the two texts. After the custom tooltip class parse the text and assign the content to the two text elements of the tooltip and display it.
Is it a viable way? To subclass do i need just to create a class in my project derived from CEGUITooltip, use createWindow to create an instance of it and use setTooltip to pass its pointer to each of my controls?
In the new class the setText done in the original Tooltip type will be overriden with a call to setText of 2 elements inside my custom Window. I'd like to understand if it's possible to create a .layout of this window and load it. I'm a little confused about the TextComponent tag inside the looknfeel files, it seems like i can have just one textcomponent inside each widget.. so a layout is preferred, isn't it?
i'm starting using CEGUI and i'm reproducing some features i've implemented in a different GUI system. I'm trying to create a tooltip made of two text lines, a title and a description. The title has a type bigger font, the other a small one.
I'd like to ask how i can subclass the existing tooltip. I'm thinking of passing the 2 strings with setTooltipText with a new line between the two texts. After the custom tooltip class parse the text and assign the content to the two text elements of the tooltip and display it.
Is it a viable way? To subclass do i need just to create a class in my project derived from CEGUITooltip, use createWindow to create an instance of it and use setTooltip to pass its pointer to each of my controls?
In the new class the setText done in the original Tooltip type will be overriden with a call to setText of 2 elements inside my custom Window. I'd like to understand if it's possible to create a .layout of this window and load it. I'm a little confused about the TextComponent tag inside the looknfeel files, it seems like i can have just one textcomponent inside each widget.. so a layout is preferred, isn't it?