Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - CMenu and custom XTP themes
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CMenu and custom XTP themes

 Post Reply Post Reply
Author
Message
klisa View Drop Down
Newbie
Newbie


Joined: 10 April 2006
Location: France
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote klisa Quote  Post ReplyReply Direct Link To This Post Topic: CMenu and custom XTP themes
    Posted: 10 April 2006 at 5:24am

[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

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.047 seconds.