Print Page | Close Window

Shorcut Key with splitbutton

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=3154
Printed Date: 04 March 2025 at 5:05pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Shorcut Key with splitbutton
Posted By: Cedric
Subject: Shorcut Key with splitbutton
Date Posted: 04 November 2005 at 4:49am
I have a commandbar with xtpcontrolsplibutton. With this splitbutton i have a list. In fact the button is designed for Undo / Redo action. Before I change the button i have an shortcut key assigne to this button but now the keyboard sequence doesn't work

How can I handle this ? when the user launch the keyboard sequence ( CTRL+Z for instance ), the action of the button start.

User can change the bind key too.

thanks, in advance



Replies:
Posted By: Oleg
Date Posted: 04 November 2005 at 9:19am

Hello,

The is no difference which style of buttom you have.

It must work if you have control id in accelerator list.



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Cedric
Date Posted: 07 November 2005 at 7:25am
I find the reason. In fact when i change the button to splitbuttonpopup i deleted Oncommand macro to replace bay ON_XTP_EXECUTE. Then i have an other question

On ON_XTP_EXECUTE function was calling by NMHDR* pNMHDR and LRESULT* pResult . The NMHDR is a standard NMHDR or NMXTPCONTROL ?


Posted By: Oleg
Date Posted: 08 November 2005 at 8:54am

Right. NMHDR  is NMXTPCONTROL . And acelerators send only WM_COMMAND.



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Cedric
Date Posted: 08 November 2005 at 11:14am
Ok thanks. In fact i do this


    CXTPControls* l_CmdList = ( ( CAPBMainFrame*)AfxGetApp( )->m_pMainWnd )->m_TbStandard->GetControls();
    CXTPControl* l_CmdUndo = l_CmdList->FindControl( xtpControlSplitButtonPopup, ID_EDIT_UNDO, TRUE, TRUE);
    l_CmdUndo->OnExecute( );


it's a good way or it's better to construct NMXTPCONTROL and sending the message through the commandbar ?


Posted By: Oleg
Date Posted: 09 November 2005 at 3:24am
You need to add check if l_CmdUndo != NULL, because user can customize this toolbar.

-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Cedric
Date Posted: 09 November 2005 at 4:14am
Thanks it's really good idea . ( i saw my mistake when i built the program  )



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