HOWTO: Increase number of used colors in TabCtrl |
Post Reply |
Author | |
mgampi
Senior Member Joined: 14 July 2003 Status: Offline Points: 1201 |
Post Options
Thanks(0)
Posted: 08 March 2018 at 10:10am |
Hi;
How can I increase the number of colors used in colored tab controls when using OneNoteColors? Now the color is repeated after 8 tabs (see screenshot). If this is not possible with OneNoteColors, how can I get colored tabs in another way? TIA |
|
Martin Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022 |
|
olebed
Admin Group Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
Post Options
Thanks(0)
|
Hello Martin,
These colors defined in static method CXTPTabPaintManager::GetOneNoteColor(XTPTabOneNoteColor). You can increase number of colors by adding new constants in enum XTPTabOneNoteColor.
Leave color xtpTabColorMagenta as last to prevent changes in CXTPTabClientWnd::CWorkspace::GetItemColor() and CXTPTabManager::GetItemColor() As other way you can change these two methods to return custom colors. Also as the easyest way you can set custom color right to CXTPTabManagerItem::m_clrItem. (CXTPTabManagerItem::SetColor(COLORREF)) If that value will be from 0x1000000 to 0x1000007 then it means predefined colors from xtpTabColorBlue to xtpTabColorMagenta. Other values will be used directly as colors. See Samples\ToolkitPro\MDITabWindow\ChildWnd.cpp CChildWnd::OnGetTabColor() Regards, Oleksandr Lebed |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |