Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - How to implement shortcut menus
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to implement shortcut menus

 Post Reply Post Reply
Author
Message
Number8 View Drop Down
Groupie
Groupie


Joined: 29 July 2008
Location: United States
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote Number8 Quote  Post ReplyReply Direct Link To This Post Topic: How to implement shortcut menus
    Posted: 12 August 2008 at 1:57pm
Hello,

Our application has several different kinds of child windows -- a graph, a spreadsheet, a text editor, etc.
Can we use some kind of CommandBar to implement a shortcut menu for each window?  How do we activate the menu (presumably from the WM_RBUTTONDOWN handler for the window)?

Thanks for any advice or pointers to articles/samples/tutorials...

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: 13 August 2008 at 1:20am
Hello,
 
Most our samples show context menus. Please check them.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
MadRiver View Drop Down
Groupie
Groupie


Joined: 21 August 2008
Location: United States
Status: Offline
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote MadRiver Quote  Post ReplyReply Direct Link To This Post Posted: 21 August 2008 at 1:45pm
It looks like all the samples create the popup menu/commandbar at the time it is needed.

Two questions:
-- What happens when this is done multiple times?  Are duplicate items ignored?

-- I would like to create my context menus at startup, then display them in the specific event handler.  It's not clear how to find/retrieve the correct commandbar/popup object.
For example, if I do something like this:
    ICommandBarPtr  pPopup = 0;
    pPopup = g_spCommandBars->Add("MapperPopup", xtpBarPopup);
    pControls = pPopup->GetControls();
    // add controls...

If all that happens in the event handler for the right mouse click, this
    pPopup->ShowPopup();
works as expected.

Thanks for any pointers...
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: 22 August 2008 at 1:02am
Hello,
 
Add("MapperPopup", xtpBarPopup) don't really add it to commandBars collection but just create it and return pointer. so it will be destroyed when your pPopup  will be destroyed.
 
Better add it to ContextMenus collection.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
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.172 seconds.