Print Page | Close Window

CXTPControlPopup dynamic menu items

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=1738
Printed Date: 02 January 2026 at 11:59am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPControlPopup dynamic menu items
Posted By: skura
Subject: CXTPControlPopup dynamic menu items
Date Posted: 02 February 2005 at 10:58am

I am using a CXTPControlPopup (xtpControlSplitButtonPopup) in a toolbar. I would like to dynamically create the menu when the user clicks on the down arrow. How can I achieve this?




Replies:
Posted By: Ark42
Date Posted: 02 February 2005 at 11:30am

See:   void CMainFrame::OnInitCommandsPopup(CXTPPopupBar* pCommandBar)


Posted By: skura
Date Posted: 02 February 2005 at 6:22pm

Ark42,

Thanks for the help. Now I could populate the menu dynamically.

I am running into following issue. The functions defined by the following message map entries are getting only when the user clicks on the "label" associated with the SplitButtonPopup. They are not getting called if the user clicks on the "arrow".

 ON_UPDATE_COMMAND_UI(IDC_WIFIDROPBUTTON, OnPopulateList)
 ON_XTP_EXECUTE(IDC_WIFIDROPBUTTON, OnSelectListEntry)

Is this the expected behavior OR is this Toolkit bug? How can I overcome this issue?

Thanks in advance.



Posted By: Oleg
Date Posted: 03 February 2005 at 9:34am
it is designed behaviour.

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


Posted By: skura
Date Posted: 03 February 2005 at 2:41pm

Oleg,

Thanks for your response.

I ended up over loading the OnControlSelected() by defining the following message map entry.

 ON_MESSAGE(WM_XTP_CONTROLSELECTED, OnControlSelected)

Any potential problems with this approach?



Posted By: Oleg
Date Posted: 04 February 2005 at 5:13am

Better way is WM_XTP_INITCOMMANDSPOPUP.

 



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



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