Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Popup menu on a toolbar in a Modal Dialog
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Popup menu on a toolbar in a Modal Dialog

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


Joined: 08 May 2008
Location: Canada
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote mfproudman Quote  Post ReplyReply Direct Link To This Post Topic: Popup menu on a toolbar in a Modal Dialog
    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
Back to Top
mfproudman View Drop Down
Newbie
Newbie


Joined: 08 May 2008
Location: Canada
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote mfproudman Quote  Post ReplyReply Direct Link To This Post 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
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.145 seconds.