Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
ContextMenu supports ownerdraw?
ContextMenu supports ownerdraw?
In OSR mode, how to ownerdraw the contextmenu? I want to use my own UI style of menu, not the default. I know the tpopupmenu control in delphi supports ownerdraw mode. Does contextmenu support?
Last edited by tad.chen on Mon Feb 01, 2021 10:23 am, edited 1 time in total.
- salvadordf
- Posts: 4578
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: ContextMenu supports ownerdraw?
These are the context menu events in CEF :
https://magpcss.org/ceforum/apidocs3/projects/(default)/CefContextMenuHandler.html
You can call model.clear inside the TChromium.OnBeforeContextMenu event to disable the context menu.
Then you can show your own custom menu.
https://magpcss.org/ceforum/apidocs3/projects/(default)/CefContextMenuHandler.html
You can call model.clear inside the TChromium.OnBeforeContextMenu event to disable the context menu.
Then you can show your own custom menu.
Re: ContextMenu supports ownerdraw?
Thank you! But how to send command to web page if user select such as 'cut' or 'select all' item in my ownerdraw menu?
- salvadordf
- Posts: 4578
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: ContextMenu supports ownerdraw?
I can only suggest that you try these procedures :
- TChromiumCore.ClipboardCopy;
- TChromiumCore.ClipboardPaste;
- TChromiumCore.ClipboardCut;
- TChromiumCore.ClipboardUndo;
- TChromiumCore.ClipboardRedo;
- TChromiumCore.ClipboardDel;
- TChromiumCore.SelectAll;
Re: ContextMenu supports ownerdraw?
It works now. Thank you! 
