Professional UI Solutions
Site Map   /  Register


Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Ribbon bar and menus/toolbars together? Collapse All
Subject Author Date
Robert Webb Aug 28, 2008 - 8:23 PM

Is it possible to have a ribbon bar, a menu, and toolbars together in one app?  We may offer a choice of one or the other, but at least for now in our in-house version we’d like to have both to help with development.

The problem I’m having is in the ordering of commands.  Ribbon bar must be created first, before menu/toolbars/control bars.  But it seems that CExtCustomizeSite::EnableCustomization() must be called after menus and control bars are created and before the ribbon bar is created, leading to a paradox.

If CExtCustomizeSite::EnableCustomization() is called before control bars are created, CExtCustomizeSite::CustomizeStateSerialize() hits an ASSERT because the number of control bars already created (currently 0) doesn’t match the number read from the registry.

If CExtCustomizeSite::EnableCustomization() is called after the ribbon bar is created, then CExtToolControlBar::OnCustomizeRegisterBar() asserts because it gets called twice for the ribbon bar.  Once during the ribbon bar creation, and again via CExtCustomizeSite::EnableCustomization().  After clicking through all the asserts it does actually pop up and work though.

Can CExtCustomizeSite::EnableCustomization() even be used effectively in a ribbon bar project?



Technical Support Dec 23, 2008 - 9:15 AM

We are sorry for delay with this reply. We received your project and sent its fixed version back to you by email.

Technical Support Sep 1, 2008 - 10:56 AM

Thank you for the interesting question. The ribbon bar control works as a standalone customizable set of toolbars and menus. The CExtRibbonBar class is based on both CExtMenuControlBar and CExtCustomizeSite classes. Although its is possible to create two UI types inside one main frame window at the same time, ribbon UI and toolbar/menu bar UI (customizable or not), it is easier to create and initialize only a ribbon bar or only toolbars and the menu bar at one time. These two UI types will have absolutely independent state data. The customize site created and initialized for toolbars and menus will not intersect with the internal customize site of ribbon bar. Their states should be serialized into different registry locations or different files.

It’s also possible to create both UI types at the same time. But ribbon bar’s functionality conflicts with that of the menu bar. For example, the ALT key pressing (VK_MENU) should be used both for keyboard navigation in the menu bar and key tip-based navigation in the ribbon bar. If the ribbon bar and menu bar are created at the same time, you should keep visible only one of them and perform message pre-translation only into one of them. Of course, the ribbon bar should be created before other control bars are. This will allow it to occupy the outer part of the main frame window which is closest to the caption.

We can take a look at your source code and clarify what’s wrong. But generally, your main frame window initialization should be similar to any Prof-UIS sample application with customizable toolbars and menus where creation of the ribbon bar control is inserted at beginning of the CMainFrame::OnCreate() method.

Robert Webb Dec 18, 2008 - 7:02 PM

Hi again,

This is going back a while, but I still need a way forward.  I have sent you an email with a test project attached, showing the assertion that occurs when customizable tool bars and ribbon bars are used together, plus the fact that the tool bars can’t be properly customized at all.

I had thought that the conflict was between ribbon and menu, but it now seems that the problem still exists when no menu is created, so the conflict is really between customizable tool bars and the ribbon bar.  Surely ribbon bar and customizable tool bars should be expected to be used together?