Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Shorcut Key with splitbutton
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Shorcut Key with splitbutton

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


Joined: 27 October 2005
Status: Offline
Points: 20
Post Options Post Options   Thanks (0) Thanks(0)   Quote Cedric Quote  Post ReplyReply Direct Link To This Post Topic: Shorcut Key with splitbutton
    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
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: 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
Back to Top
Cedric View Drop Down
Newbie
Newbie


Joined: 27 October 2005
Status: Offline
Points: 20
Post Options Post Options   Thanks (0) Thanks(0)   Quote Cedric Quote  Post ReplyReply Direct Link To This Post 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 ?
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: 08 November 2005 at 8:54am

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

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Cedric View Drop Down
Newbie
Newbie


Joined: 27 October 2005
Status: Offline
Points: 20
Post Options Post Options   Thanks (0) Thanks(0)   Quote Cedric Quote  Post ReplyReply Direct Link To This Post 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 ?
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: 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
Back to Top
Cedric View Drop Down
Newbie
Newbie


Joined: 27 October 2005
Status: Offline
Points: 20
Post Options Post Options   Thanks (0) Thanks(0)   Quote Cedric Quote  Post ReplyReply Direct Link To This Post Posted: 09 November 2005 at 4:14am
Thanks it's really good idea . ( i saw my mistake when i built the program  )
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.172 seconds.