Print Page | Close Window

Combobox context menu on toolbar

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=17844
Printed Date: 28 November 2024 at 9:47pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Combobox context menu on toolbar
Posted By: Chet Desmond
Subject: Combobox context menu on toolbar
Date Posted: 08 February 2011 at 9:44am
I have a CXTPControlComboBox-derived control on a toolbar. Right-clicking on the control brings up the toolbar's standard context menu (i.e. the menu with the names of the toolbars and the Customise... option). For my control I'd like to show my own context menu instead, a little like the edit control brings up a Cut,Copy,Paste menu.

I suspect this is simple to achieve, but right now I can't figure it out. What steps do I need to take to have my control respond to the correct messages?



Replies:
Posted By: Oleg
Date Posted: 09 February 2011 at 1:51am
Hi,

You can override

void CXTPCommandBars::ContextMenu(CXTPToolBar* pToolBar, CPoint point)

or catch WM_XTP_TOOLBARCONTEXTMENU in CMainFrame and update CXTPPopupBar* pPopup (lParam).

See this method in sources.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Chet Desmond
Date Posted: 09 February 2011 at 6:57am
Thanks Oleg Smile. I've just stumbled across InitCommandBars which looks promising.

I don't suppose there are any plans for some material aimed at novices (a book, for example) is there? It's like looking for a needle in haystack sometimes with the help files.



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