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

Context menu on gallery item

 Post Reply Post Reply
Author
Message
ssejud View Drop Down
Newbie
Newbie


Joined: 09 March 2012
Location: Poland
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote ssejud Quote  Post ReplyReply Direct Link To This Post Topic: Context menu on gallery item
    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?
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.