[Solved! Thanks Guys] Tabcontrol/TabButton

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

Erebus
Just popping in
Just popping in
Posts: 6
Joined: Wed Feb 13, 2008 08:58
Location: United States
Contact:

[Solved! Thanks Guys] Tabcontrol/TabButton

Postby Erebus » Wed Feb 13, 2008 09:12

Hi, And Thanks For Taking The Time To Read...

I'm working on a project, an instant messenger / chatbox deal in the program I working on. I have created the box, and I have a TabControl, and some default windows which get added to the TabControl through ->addTab. In the .layout file, I specify the Property Text, with the value that appears as the caption of that tab button. Now, when a message arrives, I want to notify the user on which tab they need to pay attention to. I'd like to do this by perhaps blinking the tab control, or by changing it's text color.

Right now, I have it alert the user that a message has arrived by using setText to alter the text of the Tabbutton to contain a trailing *, but this is both ungraceful, and tacky. If there is a better, more elegant solution, (or a completely different concept of how to do this) it would be much appreciated.

Thank you for your time, and I look forward to your response,
Erebus.
Last edited by Erebus on Thu Feb 14, 2008 14:27, edited 1 time in total.

Erebus
Just popping in
Just popping in
Posts: 6
Joined: Wed Feb 13, 2008 08:58
Location: United States
Contact:

Postby Erebus » Thu Feb 14, 2008 09:06

bump.

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

Postby CrazyEddie » Thu Feb 14, 2008 09:49

Hi,

I think this is not an easy solution.

You need to get access to the automatically created buttons for the 'tabs' and set colour properties on them directly.

They are named like this:

<WindowName>__auto_TabPane__Buttons__auto_btn<PageName>

So, if your TabControl window was named for example "ChatBox/Conversations" and the tab you wanted to change the text colour of is named "CrazyEddie" then the name of the button is "Chatbox/Conversations__auto_TabPane__Buttons__auto_btnCrazyEddie"

You obtain a pointer to this window with using the WindowManager::getWindow member function.

Once you have the window pointer, you can set the colour like this:

Code: Select all

...
// set colour to green
wnd->setProperty( "NormalTextColour", "FF00FF00" );
...


CE.

Erebus
Just popping in
Just popping in
Posts: 6
Joined: Wed Feb 13, 2008 08:58
Location: United States
Contact:

Postby Erebus » Thu Feb 14, 2008 14:09

CrazyEddie,

Worked Like A Charm!!! Thanks For All Your Help! I'm Not Sure Where/How To Mark As Solved, But... Solved.

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

Postby Rackle » Thu Feb 14, 2008 14:18

With any phpBB message boards you do that by editing the first post and changing the subject.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 11 guests