Print Page | Close Window

ContextMenu

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=17839
Printed Date: 02 December 2024 at 11:42pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: ContextMenu
Posted By: Pixbyte
Subject: ContextMenu
Date 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



Replies:
Posted By: Pixbyte
Date Posted: 07 February 2011 at 3:43am
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.




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