Print Page | Close Window

Ribbon menu shortcuts

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=13170
Printed Date: 20 July 2025 at 1:12am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Ribbon menu shortcuts
Posted By: JamesP
Subject: Ribbon menu shortcuts
Date Posted: 14 January 2009 at 5:58am

We're using a ribbon control with popup menus, but no tabs. We've found that the shortcuts (the underlines) and the accelerator table are missing from all the items.

I'm adding SubMenu items using the code:
 
CXTPControlPopup* pControlOptions;
pControlOptions = (CXTPControlPopup*)m_pRibbonBar->GetControls()->Add(xtpControlPopup, -1);
pControlOptions->SetCommandBar(menu.GetSubMenu(0));
pControlOptions->SetCaption(_T("&File"));
 
I've tried adding the code:
m_pRibbonBar->GetCommandBars()->GetShortcutManager()->SetAccelerators(IDR_MAINFRAME);
 
but this does not work.
 
Does anyone have any suggestions? The shortcuts (I did not notice the accelerators) definitely worked before I moved over to version 12.1.1 of the toolkit.



Replies:
Posted By: Oleg
Date Posted: 15 January 2009 at 3:54am
Hi,
You can't press Alt+F to show File or you just don't see underline ?


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


Posted By: JamesP
Date Posted: 15 January 2009 at 4:17am
When I press the Alt key all the underlines appear, and pressing Alt + F brings up the file menu.
 
The accelerators (such as Ctrl + S for Save) also work but do not appear in the menus, for the users information.


Posted By: Oleg
Date Posted: 15 January 2009 at 4:28am
Hi,
 
pCommandBars->GetShortcutManager()->SetAccelerators(IDR_MAINFRAME); have add them
check if you have Ctrl+S in accelerator table for IDR_MAINFRAME
also try comment LoadCommandBars once - maybe you load empty trable from registry.


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


Posted By: JamesP
Date Posted: 15 January 2009 at 5:02am
Thanks for your quick response Oleg.
 
I already call LoadCommandBars after I've created my Ribbon with its menu items, and toolbars.
 
I tried putting the call:
 
m_pRibbonBar->GetCommandBars()->GetShortcutManager()->SetAccelerators(IDR_MAINFRAME);
 
after the call to LoadCommandars but that didn't help. Also I ensured the registry was clean, in case it was picking anything up from there.
 
 
 


Posted By: Oleg
Date Posted: 15 January 2009 at 7:05am
Hello,
 
try to reproduce it with our sample. :( It works for me.


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


Posted By: JamesP
Date Posted: 15 January 2009 at 8:43am
Which sample? You don't have any samples that use Ribbons with menus. You do add an Options button on the right and when I add an ampersand before the O, an underline does not show.
 
If you have a ribbon sample with menus that has shortcuts and accelerators working could you send it to me?



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