Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Custom Shortcut Text in Menu
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Custom Shortcut Text in Menu

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

Joined: 27 August 2005
Status: Offline
Points: 94
Post Options Post Options   Thanks (0) Thanks(0)   Quote g_j_a_i_n Quote  Post ReplyReply Direct Link To This Post Topic: Custom Shortcut Text in Menu
    Posted: 01 September 2006 at 7:51am

Hello

I have a menu in which I want to show custom shortcut text. This shortcut text does not exist in accelerator table because the shortcut text is configurable by the user.

Example: if the user configures "Ctrl+Shift+F" for finding, then I will show "Find\tCtrl+Shift+F" in the menu. I will modify the menu item using the ModifyMenu API before calling TrackPopupMenu

The XTP framework removes the "\tCtrl+Shift+F" text because it is not found in the accelerator table.

How do I stop XTP from removing the short text that I have added to the menu.

Regards,
Gautam Jain

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: 01 September 2006 at 11:43am
Hello,
 
call
pCommandBars->GetCommandBarsOptions()->bAutoUpdateShortcuts = FALSE
 
but user will not be able to customize shortcuts...
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
g_j_a_i_n View Drop Down
Groupie
Groupie
Avatar

Joined: 27 August 2005
Status: Offline
Points: 94
Post Options Post Options   Thanks (0) Thanks(0)   Quote g_j_a_i_n Quote  Post ReplyReply Direct Link To This Post Posted: 02 September 2006 at 12:35am


Thanks.

I got another alternative.

In OnCreateControl(LPCREATECONTROLSTRUCT lpCreateControl) I write the following code


if (lpCreateControl->nID == ID_MENU_FIND)
{
    CXTPControlButton *pButton = new CXTPControlButton();
    pButton->SetShortcutText(_T("Ctrl+Shift+F"));
    lpCreateControl->pControl = pButton;
    return TRUE;
}



Regards,
Gautam Jain

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