Print Page | Close Window

LoadCommandBars problem if Ribbon and Menu present

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=6313
Printed Date: 12 November 2025 at 5:10am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: LoadCommandBars problem if Ribbon and Menu present
Posted By: robin_l
Subject: LoadCommandBars problem if Ribbon and Menu present
Date Posted: 04 February 2007 at 10:35am
I'm incorporating a ribbon into an existing app, so want to give users the option of having the "old" look (menus plus toolbars) or the "new" one (ribbon). For this reason, I want to load menus, toolbars AND a ribbon and let users turn off whatever they don't want to see. Although this largely works, there is a redraw problem when both ribbon and menu are present together, which appears after SaveCommandBars/LoadCommandBars restores the screen layout. This effect is present in versions 10.4.0 and 10.4.2.
 
To show this I've taken the RibbonMDISample, added a menu bar:
CXTPMenuBar* pMenuBar = pCommandBars->SetMenu(_T("Menu Bar"), IDR_MAINFRAME);

plus an OnClose handler to save the command bar state

void CMainFrame::OnClose()
{
    SaveCommandBars(_T("CommandBars"));
    CXTPMDIFrameWnd::OnClose();
}
The first time the program runs, the expected appearance is found:
 
 
However, after re-running the program, at which point LoadCommandBars attempts to restore the appearance, what we get is the following, where the menu bar is positioned at the very top of the window:
 
 
Any chance of correcting this? The sample project showing the bug is here: https://forum.codejock.com/uploads/20070204_102933_Bug_in_LoadComm.zip - uploads/20070204_102933_Bug_in_LoadComm.zip



Replies:
Posted By: Oleg
Date Posted: 05 February 2007 at 1:37am

Hi,

try to set another id for menu bar:
pMenuBar->SetBarID(2);


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: robin_l
Date Posted: 05 February 2007 at 3:16am
Excellent! That works a treat.
 
Many thanks.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net