Print Page | Close Window

ContextMenu

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=2361
Printed Date: 10 November 2025 at 5:34am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: ContextMenu
Posted By: Jose Vicente
Subject: ContextMenu
Date Posted: 10 June 2005 at 4:55am
Hello.

I want to display contextual menus with Office 2003, so I want to use codejock for it.
But I don't know which classes I have to use.

I have looked to the CXTPPopupBar but this class requires in order to be used to have a menu bar, which is something I don't have in my ActiveX.

Someone can help me ??
Best Regards.



Replies:
Posted By: Jose Vicente
Date Posted: 10 June 2005 at 5:26am
I have tried this but a unhandled exception is fired.
I guess that the exception is fired because I don't have command bars.

CXTPCommandBars::TrackPopupMenu( Menu.GetSubMenu(0), TPM_LEFTALIGN | TPM_RIGHTBUTTON, point.x, point.y, AfxGetMainWnd () );




Posted By: bevpet
Date Posted: 10 June 2005 at 5:06pm

Hi

try this:

CMenu* pPopup, menu;

VERIFY(menu.LoadMenu(IDR_YOUR_MENU_ID_HERE));

pPopup = menu.GetSubMenu(0);

CXTPCommandBars::TrackPopupMenu(pPopup, 0, point.x, point.y, this);



Posted By: Oleg
Date Posted: 11 June 2005 at 8:56am

If you don't use CommandBars, You must init PaintManager:

CXTPPaintManager::SetTheme(xtpThemeOfficeXP);



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


Posted By: Jose Vicente
Date Posted: 13 June 2005 at 12:34am
Thanks to both. Now it works perfect.



Posted By: jigarmehtamscit
Date Posted: 16 March 2006 at 2:58pm

Hi,

So, what do you mean ? Actually i could not get you properly.. I have a dialog based application and have a CMenu object ready with me which i am showing into popup using following code..

 if (!menu.TrackPopupMenu (TPM_LEFTALIGN | TPM_LEFTBUTTON | TPM_RIGHTBUTTON, ScreenPoint.x, ScreenPoint.y, m_pwmdMenuTrack, NULL))
 {
  // delete the window now!!
  DestroyTrackWnd();
 }

So, what will I need to do if I want to show 2003 style CJ popup menu ? Please help me..

 

Originally posted by oleg oleg wrote:

If you don't use CommandBars, You must init PaintManager:

CXTPPaintManager::SetTheme(xtpThemeOfficeXP);



-------------
Regards,
Jigar Mehta


Posted By: Oleg
Date Posted: 17 March 2006 at 7:37am

Hello,

you must show it with

CXTPCommandBars::TrackPopupMenu(&menu, TPM_LEFTALIGN | TPM_LEFTBUTTON | TPM_RIGHTBUTTON, ScreenPoint.x, ScreenPoint.y, this);



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



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