Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Ribbon menu shortcuts
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Ribbon menu shortcuts

 Post Reply Post Reply
Author
Message
JamesP View Drop Down
Groupie
Groupie
Avatar

Joined: 07 January 2009
Location: United Kingdom
Status: Offline
Points: 73
Post Options Post Options   Thanks (0) Thanks(0)   Quote JamesP Quote  Post ReplyReply Direct Link To This Post Topic: Ribbon menu shortcuts
    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.
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 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
Back to Top
JamesP View Drop Down
Groupie
Groupie
Avatar

Joined: 07 January 2009
Location: United Kingdom
Status: Offline
Points: 73
Post Options Post Options   Thanks (0) Thanks(0)   Quote JamesP Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 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
Back to Top
JamesP View Drop Down
Groupie
Groupie
Avatar

Joined: 07 January 2009
Location: United Kingdom
Status: Offline
Points: 73
Post Options Post Options   Thanks (0) Thanks(0)   Quote JamesP Quote  Post ReplyReply Direct Link To This Post 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.
 
 
 
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 15 January 2009 at 7:05am
Hello,
 
try to reproduce it with our sample. :( It works for me.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
JamesP View Drop Down
Groupie
Groupie
Avatar

Joined: 07 January 2009
Location: United Kingdom
Status: Offline
Points: 73
Post Options Post Options   Thanks (0) Thanks(0)   Quote JamesP Quote  Post ReplyReply Direct Link To This Post 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?
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.125 seconds.