Print Page | Close Window

Accelerator keys in CXTPMenuBar

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=13330
Printed Date: 03 July 2024 at 3:49am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Accelerator keys in CXTPMenuBar
Posted By: BobWansink
Subject: Accelerator keys in CXTPMenuBar
Date 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++



Replies:
Posted By: Oleg
Date 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


Posted By: BobWansink
Date 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++


Posted By: Sergio
Date Posted: 08 April 2009 at 10:59am
Hi everyone.

Tested, it works.


-------------
Sergio



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