Print Page | Close Window

Context menu on gallery item

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=19559
Printed Date: 19 June 2025 at 1:25am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Context menu on gallery item
Posted By: ssejud
Subject: Context menu on gallery item
Date Posted: 09 March 2012 at 5:37am
I need to show context menu when clicked on gallery item. I overrided method OnRButtonUp and show context menu then, but, when user clicks on menu item which is outside gallery popup area, gallery disappears, and i want to prevent that. 

my code:

BOOL MyGallery::OnRButtonUp(CPoint point)
{
   CMenu menu;
   menu.CreatePopupMenu();

   // Here I add some menu items.

   CPoint      cursor;
   GetCursorPos(&cursor);

   UINT returnValue = (UINT)menu.TrackPopupMenu( TPM_RETURNCMD|TPM_LEFTBUTTON|TPM_NONOTIFY, cursor.x, cursor.y, AfxGetMainWnd() );

   // Here I process menu choice.

   return TRUE;
}

How to prevent closing gallery when clicked outside it while context menu is shown?



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