Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Accelerator keys in CXTPMenuBar
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Accelerator keys in CXTPMenuBar

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

Joined: 24 January 2008
Status: Offline
Points: 59
Post Options Post Options   Thanks (0) Thanks(0)   Quote BobWansink Quote  Post ReplyReply Direct Link To This Post Topic: Accelerator keys in CXTPMenuBar
    Posted: 04 February 2009 at 10:22am
Hi all,

I'm using the commandbars in my CXTPFrameWnd derived window. Since I want to create the menubar myself, I won't be loading the menu from a resource (the CXTPCommandBar::LoadMenuBar() function), but from a CMenu * using CXTPCommandBar::LoadMenu().

Normally, my dialogs used CWnd::SetMenu() to create the menu, and adding an option with a String like: "New\tCtrl + N" would make a menu item with "New" as option name (aligned left) and "Ctrl + N" as it's shortcut key (aligned right). The LoadMenu function doesn't do this. Options with a tab in them are stripped of everything after the tab, so my users don't see the shortcut keys, only the option names.

LoadMenuBar does show the Shortcuts. I assume you're using the accelleratorkeys for this(?). Is it possible to get the shortcuts in menu's using the LoadMenu function?


Thanks a million!


Bob
     Product: Xtreme ToolkitPro (MFC) version 13.0.0
     Platform: Windows (32bit) - XP - Vista
     Language: Visual C++
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: 04 February 2009 at 1:49pm
Hi,
 
Call pCommandBars->GetCommandBarsOptions()->bAutoUpdateShortcuts = FALSE;
 
but your users won't be able customize keys.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
BobWansink View Drop Down
Groupie
Groupie
Avatar

Joined: 24 January 2008
Status: Offline
Points: 59
Post Options Post Options   Thanks (0) Thanks(0)   Quote BobWansink Quote  Post ReplyReply Direct Link To This Post Posted: 04 February 2009 at 3:10pm
Hi oleg.
 
Thanks! I wouldn't have found that in a million years... I'll try it out first thing tomorrow.
 
Bob
     Product: Xtreme ToolkitPro (MFC) version 13.0.0
     Platform: Windows (32bit) - XP - Vista
     Language: Visual C++
Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 216
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Posted: 08 April 2009 at 10:59am
Hi everyone.

Tested, it works.
Sergio
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.172 seconds.