Print Page | Close Window

Custom Shortcut Text in Menu

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=4949
Printed Date: 06 July 2025 at 8:02am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Custom Shortcut Text in Menu
Posted By: g_j_a_i_n
Subject: Custom Shortcut Text in Menu
Date 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




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


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




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