Print Page | Close Window

Retreiving the CXTPControlButton on the Onclick

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=21768
Printed Date: 16 May 2024 at 4:37am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Retreiving the CXTPControlButton on the Onclick
Posted By: BadJerry
Subject: Retreiving the CXTPControlButton on the Onclick
Date Posted: 03 July 2013 at 7:54am
Hello,

I have derived  CXTPControlButton (let's call it my CXTPMyDynamicMenu) so I could have a dynamic way of filling menus after a right click... 
the same class shows 3 levels of sub menu-items.

In  CMainFrame::OnCreateControl, I create a CXTPMyDynamicMenu: that works (although my menu is shown on a view, I do not like to have to add some code in CMainFrame... but that's not important)

Is there anyway to know on the OnClick event (well it's an On_COMMAND or ON_COMMAND_RANGE) which CXTPMyDynamicMenu object has been selected? and its parent? 
Something like "GetCurrentClickedMenuButton()"...
I know I can  get the ID of the button but I do not want to have to reserve hundreds of IDS...

Thanks in advance,
Jerry



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