Tab Control buttons background color

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
Reiko
Posts: 105
Joined: Sun Aug 16, 2009 7:06 am
Location: Australia

Tab Control buttons background color

Post by Reiko »

When you create a tab control with IGUIEnvironment::addTabControl, the 3rd argument is fillbackground. When it's false, the tabs you create wont have a background. But even with this set to false, the tabs at the top (ie. to switch between tabs) still draws the background in, cause CGUISkin::draw3DTabButton always draws the background, it doesnt have an argument for filling it in or not.

Is this the intended behaviour? Or should fillbackground = false on the tabcontrol also make those not filled in either?

Right now those tab buttons at the top are using the EGDC_3D_FACE and EGDC_3D_SHADOW colors for the back, but currently there is no way to disable that without changing the engine source.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

I think it is intended behaviour, because it seems to be the same way for example in the tabs in my browser. The tab-selections are independent of the page. But I've seen people complain about that already in the past.

I'm not yet sure how to improve that - setting it to the tab-background might not always be what people want. Setting it extra with another parameter would we a solution, but this is part of a way bigger problem which we currently have: Every gui-element would need override values for every skin-setting which it uses. And I'm not sure yet that adding lots of further override-functions (as was occasionally done so far and unfortunately it wasn't done in a consistent way) is the correct solution to that problem. But we also have no other solution yet and there's a big chance that we will have to change our attribute system first.

I think the easiest solution in your case would be to create an own skin. Copy CGUISkin from Irrlicht, change the name, put it into your project and override draw3DTabButton in your own skin class. This will also have the advantage that you can do a lot more interesting skins in your project.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply