ContextMenu |
Post Reply |
Author | |
Pixbyte
Groupie Joined: 11 April 2007 Status: Offline Points: 17 |
Post Options
Thanks(0)
Posted: 06 February 2011 at 8:01am |
Hello,
how to make context menu the same style as commandbars? Is it possible to "clone" a commandbar Menu to a context menu? Ocrana
|
|
Pixbyte
Groupie Joined: 11 April 2007 Status: Offline Points: 17 |
Post Options
Thanks(0)
|
Ok, I found it out. For all who are looking for the same:
CMenu menu; menu.LoadMenu(IDR_MENQUEUE); CMenu* pPopup = menu.GetSubMenu(0); CXTPCommandBars* pCommandBars = GetCommandBars(); UINT nCmd = static_cast<UINT>(CXTPCommandBars::TrackPopupMenu(pPopup,TPM_RIGHTBUTTON | TPM_LEFTALIGN, dwStyle == xtpButtonDropDownRight ? rect.right : rect.left, dwStyle == xtpButtonDropDownRight ? rect.top : rect.bottom, this, NULL, 0, pCommandBars)); Cause it is a CommandBar, the Flag: TPM_RETURNCMD will not work. You have to use the common "OnCommand" function like with the other Menu. If the Image Manager contain a image for the submenu IDs, you will have icons in the submenu, too. |
|
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 |