[Environment: Windows XP SP2, Visual Studio 2003, XTP 9800.]
Hi,
I need a help/hint regarding the usage of custom XTP themes.
Here's is the scenario:
- There is a simple custom paint theme in which paint and pane managers are derived from CXTPPaintManager and CXTPDockingPanePaintManager classes, respectively. - The main application window is a CXTPFrameWnd-derived window; - The main application menu is a regular MFC CMenu and not a CXTPMenuBar (this is important).
When the custom theme is applied like this (below is the main frame window's code)
CXTPPaintManager* customTheme = ...; CXTPPaintManager::SetCustomTheme(customTheme); CXTPDockingPanePaintManager* customPaneTheme = ...; GetDockingPaneManager()->SetCustomTheme(customPaneTheme);
the custom theme affects only toolbars/command bars that are created using GetCommandBars()->Add() and CXTPToolBar::LoadToolbar() methods. The main application menu (CMenu) remains drawn in whatever is the current XTP standard theme.
Now, if the main application menu becomes a command bar (that is, if it's created like this):
CXTPMenuBar* menuBar = GetCommandBars()->SetMenu(_T("Menu Bar"), IDR_MAINFRAME);
then the custom theme affects it.
Unfortunately, the main application menu absolutely has to stay a CMenu because of the existing code (a lots of it) that enumerates/adds/modifies/removes *CMenu* items.
Switching to CXTPMenuBar simply isn't an option because it would require all that code to be changed to work with CXTPCommandBars and CXTPControls instead.
The question:
Is there a way to keep CMenu as the main application menu (in other words, not to load it as a command bar) and still to have it drawn using the custom theme painting?
Thanks, Vladimir
|