I want to create my own visual theme based on one of the existing visual managers. How can I do this?
Generally, there is no common way to customize the Visual Theme; we suggest taking a look at the Visual Manager source code and our examples. To create your own visual theme:
- Create your class derived from any existing visual manager classes (e.g., CBCGPVisualManager2016). Don’t forget to add DECLARE_DYNCREATE / IMPLEMENT_DYNCREATE!
- Override any required drawing methods (in CBCGPVisualManagerVS2012 or later managers you can override SetupColors method and specify your own colors set). Overriding ModifyGlobalColors methods allows to customize all “global” colors such as bar background/foreground colors.
- Associate your class with existing theme in your application class constructor:
Existing code:
AddVisualTheme(theme, id, bActive);
New code:
AddVisualTheme(theme, id, bActive, RUNTIME_CLASS(CMyVisualManager));
or
Existing code:
SetVisualTheme(theme);
New code:
SetVisualTheme(theme, RUNTIME_CLASS(CMyVisualManager));
lease take a look at our BCGPEdgeDemo example: The CVisualManager class demonstrates how to customize the Office 2021 White appearance by changing specific colors. There are some other demos with custom visual themes:
- BCGPMSMoneyDemo
- BCGPMediaPlayer
- BCGPShopDemo
Disclaimer: We don't provide any assistance in creating custom visual managers, and we're not responsible for the result (how the custom theme looks).