Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - LoadCommandBars problem if Ribbon and Menu present
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

LoadCommandBars problem if Ribbon and Menu present

 Post Reply Post Reply
Author
Message
robin_l View Drop Down
Senior Member
Senior Member


Joined: 15 October 2006
Status: Offline
Points: 117
Post Options Post Options   Thanks (0) Thanks(0)   Quote robin_l Quote  Post ReplyReply Direct Link To This Post Topic: LoadCommandBars problem if Ribbon and Menu present
    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: uploads/20070204_102933_Bug_in_LoadComm.zip
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
robin_l View Drop Down
Senior Member
Senior Member


Joined: 15 October 2006
Status: Offline
Points: 117
Post Options Post Options   Thanks (0) Thanks(0)   Quote robin_l Quote  Post ReplyReply Direct Link To This Post Posted: 05 February 2007 at 3:16am
Excellent! That works a treat.
 
Many thanks.
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.033 seconds.