Print Page | Close Window

Context Menu - ID_VIEW_TOOLBAR

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=4591
Printed Date: 10 November 2025 at 8:21pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Context Menu - ID_VIEW_TOOLBAR
Posted By: IRMark
Subject: Context Menu - ID_VIEW_TOOLBAR
Date 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!




Replies:
Posted By: IRMark
Date 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.




Posted By: Oleg
Date 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


Posted By: IRMark
Date 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.




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