Popup menu on a toolbar in a Modal Dialog |
Post Reply |
Author | |
mfproudman
Newbie Joined: 08 May 2008 Location: Canada Status: Offline Points: 8 |
Post Options
Thanks(0)
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
|
|
mfproudman
Newbie Joined: 08 May 2008 Location: Canada Status: Offline Points: 8 |
Post Options
Thanks(0)
|
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
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |