Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Controls
  New Posts New Posts RSS Feed - Kryboard shortcut as caption in Menu
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Kryboard shortcut as caption in Menu

 Post Reply Post Reply
Author
Message
rattana View Drop Down
Newbie
Newbie


Joined: 17 November 2009
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote rattana Quote  Post ReplyReply Direct Link To This Post Topic: Kryboard shortcut as caption in Menu
    Posted: 17 November 2009 at 1:27am

Hello

I am trying to implement a pop up menu using CXTPcontrolpopUp and adding cxptcontrol to it . I need to append the keyboard shortcut associated with the cxtpcontrol.
the caption I gave is as below:-
"&New...\tCtrl+N"
SetCaption function of cxtpcontrol breaks the caption from "\t" and puts the caption as "New..." and the shortcut part is set as shortcuttextauto.
Is there any way I can get the caption of menu item as "&New...\tCtrl+N"
 
Thanks so much in advance
 
Back to Top
Smucker View Drop Down
Senior Member
Senior Member
Avatar

Joined: 02 February 2008
Status: Offline
Points: 156
Post Options Post Options   Thanks (0) Thanks(0)   Quote Smucker Quote  Post ReplyReply Direct Link To This Post Posted: 17 November 2009 at 3:21pm
You should let Codejock build the shortcut strings from the defined accelerators. This way is much easier than hard-coding them and handles customized keyboard shortcuts, which hard coding will not.

First, be sure to set this option in the CXTPCommandBars that hosts the popup:

GetCommandBarsOptions()->bShowContextMenuAccelerators

For using an regular accelerator resource (not designer shortcuts), you need to call:

GetCommandBars()->GetShortcutManager()->SetAccelerators(ACCELERATOR_RESOURCE_ID);

from the main frame's OnCreate(). Be sure to call it before loading the layout's user customizations.

Product: Xtreme Toolkit Pro version 13.2 (Unicode, static build)

Platform: Windows 200x/XP/Vista/Win7 (32/64 bit)

Language: Visual C++ 9.0 (Studio 2008)

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.141 seconds.