CEF3 context menu

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

CEF3 context menu

Postby deepshi03 » Mon Mar 18, 2013 4:33 am

We are using CefGlue code and building wpf application. We need to put our context menu in the browser. Is there a way to block the context menu that is already present in the browser??
deepshi03
Techie
 
Posts: 14
Joined: Sun Mar 03, 2013 10:20 pm

Re: CEF3 context menu

Postby fddima » Mon Mar 18, 2013 10:03 am

Provide CefContextMenuHandler implementation, and implement method, according docs:

Code: Select all
        /// <summary>
        /// Called before a context menu is displayed. |params| provides information
        /// about the context menu state. |model| initially contains the default
        /// context menu. The |model| can be cleared to show no context menu or
        /// modified to show a custom menu. Do not keep references to |params| or
        /// |model| outside of this callback.
        /// </summary>
        protected virtual void OnBeforeContextMenu(CefBrowser browser, CefFrame frame, CefContextMenuParams state, CefMenuModel model)
        {
        }
fddima
Master
 
Posts: 788
Joined: Tue Dec 07, 2010 6:10 am

Re: CEF3 context menu

Postby deepshi03 » Mon Mar 18, 2013 10:38 pm

OnBeforeContextMenu(mBrowser, mFrame, mState, mModel) function in CefContextMenuHandler.cs is never called. And so the method of implementing the function is not working out!!
deepshi03
Techie
 
Posts: 14
Joined: Sun Mar 03, 2013 10:20 pm

Re: CEF3 context menu

Postby fddima » Tue Mar 19, 2013 2:10 am

deepshi03 wrote:OnBeforeContextMenu(mBrowser, mFrame, mState, mModel) function in CefContextMenuHandler.cs is never called. And so the method of implementing the function is not working out!!

You must return own context menu handler from CefClient subclass (CefWebClient in samples).
fddima
Master
 
Posts: 788
Joined: Tue Dec 07, 2010 6:10 am


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 195 guests