Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Combobox context menu on toolbar
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Combobox context menu on toolbar

 Post Reply Post Reply
Author
Message
Chet Desmond View Drop Down
Groupie
Groupie


Joined: 27 August 2010
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote Chet Desmond Quote  Post ReplyReply Direct Link To This Post Topic: Combobox context menu on toolbar
    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?
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Chet Desmond View Drop Down
Groupie
Groupie


Joined: 27 August 2010
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote Chet Desmond Quote  Post ReplyReply Direct Link To This Post 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.
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.234 seconds.