Print Page | Close Window

Popup menu on a toolbar in a Modal Dialog

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=20663
Printed Date: 06 October 2024 at 10:44am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Popup menu on a toolbar in a Modal Dialog
Posted By: mfproudman
Subject: Popup menu on a toolbar in a Modal Dialog
Date Posted: 03 March 2013 at 12:42pm
I am trying to constuct a dynamic menu on a CXTPControlPopup with flags set to xtpButtonSplitDropDown on a toolbar in a Modal Dialog.
 
I put ON_XTP_INITCOMMANDSPOPUP in my dialog message map, but the handler is not being called.  The CXTPControlPopup is constructed and is enabled, but I don't get into my handler on pressing the arrow.
 
I have exactly the same thing working (well) in a ribbon bar (ie in CMainFrame).  I am guessing that something about the modal dialog is different.  What do I need to do to get this working in a dialog?
 
Thanks for any help,
 
Mark
 


-------------
Mark Proudman



Replies:
Posted By: mfproudman
Date Posted: 03 March 2013 at 3:42pm
I have discovered that attaching an empty menu to the popup when it is created in OnCreateControl() does the trick:
 
CXTPControlPopup * popup = new CXTPControlPopup();
... other setup
...
CMenu menu;
menu.CreateMenu();
popup->SetCommandBar(&menu);
 
Not sure why this makes things work, or if this is the approved solution.  Any input appreciated; I always like to know why things work,
 
Mark


-------------
Mark Proudman



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