Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Context Menu - ID_VIEW_TOOLBAR
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Context Menu - ID_VIEW_TOOLBAR

 Post Reply Post Reply
Author
Message
IRMark View Drop Down
Groupie
Groupie
Avatar

Joined: 13 July 2006
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote IRMark Quote  Post ReplyReply Direct Link To This Post Topic: Context Menu - ID_VIEW_TOOLBAR
    Posted: 13 July 2006 at 12:48pm

Hi,

I'm using CodeJocks Xtreeme ToolkitPro and I'm trying to add a right-click context menu that is a recreation of my applications View menu (which I get by calling GetSubMenu() from a CMenu that has loaded IDR_MAINFRAME).

Everything works fine except for the Toolbars popup which is showing up as blank, does anyone know how to get this to work?

I was able to show a Toolbars popup using the CXTPControlToolbars::CreateToolbarMenu() function but that creates a separate CXTPPopupBar* and I want this to be a popup from the main context menu.  So is it possible to attach CXTPPopupBars to a CMenu?

Thanks in advance!

Back to Top
IRMark View Drop Down
Groupie
Groupie
Avatar

Joined: 13 July 2006
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote IRMark Quote  Post ReplyReply Direct Link To This Post Posted: 17 July 2006 at 9:54am
I hate to bump this but does anyone have any ideas on this?  Is it possible to take the values from a CXTPPopupBar and add them to a CMenu?

What about any ideas on context menus displaying ID_VIEW_TOOLBAR normally?

Thanks in advance,

mark.


Back to Top
Oleg View Drop Down
Senior Member
Senior Member


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: 17 July 2006 at 12:48pm
Hello,  not sure what code you tried...
 
 
In CustomThemes sample I modified:
 
void CCustomThemesView::ShowContextMenu(CPoint point)
{
 ClientToScreen(&point);
 CMenu mnu;
 mnu.LoadMenu(IDR_MAINFRAME); 
 ((CXTPMDIFrameWnd*)AfxGetMainWnd())->GetCommandBars()->
  TrackPopupMenuEx(mnu.GetSubMenu(2), TPM_RIGHTBUTTON, point.x, point.y);
}
 
and see View menu with toolbars as expected.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
IRMark View Drop Down
Groupie
Groupie
Avatar

Joined: 13 July 2006
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote IRMark Quote  Post ReplyReply Direct Link To This Post Posted: 17 July 2006 at 4:22pm

Hi Oleg,

Thanks for the information I have been able to get it working.  The problem appears to be with the CXTPCommandBars::TrackPopupMenu() function.  If I used that to show the menu the ID_VIEW_TOOLBAR would not show up properly.  However if I used CXTPCommandBars::TrackPopupMenuEx() then everything works properly!

I'm not sure if this is a bug in the implementation of CXTPCommandBars::TrackPopupMenu() or an extra feature in CXTPCommandBars::TrackPopupMenuEx() but I'm really glad that I got it working!

mark.

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.047 seconds.