Add custom context menu support to wxWebKitCtrl.

This commit is contained in:
kollivier
2016-03-01 10:56:57 -08:00
parent 306deb2b6a
commit b12644cfc9

View File

@@ -972,6 +972,19 @@ void wxWebKitCtrl::MacVisibilityChanged(){
webKitWindow->Print(true);
}
- (NSArray *)webView:(WebView *)sender contextMenuItemsForElement:(NSDictionary *)element defaultMenuItems:(NSArray *)defaultMenuItems
{
wxContextMenuEvent evtCtx(wxEVT_CONTEXT_MENU,
webKitWindow->GetId(),
wxGetMousePosition());
evtCtx.SetEventObject(webKitWindow);
if ( ! webKitWindow->HandleWindowEvent(evtCtx) ) {
return defaultMenuItems;
}
return 0;
}
@end
#endif //wxUSE_WEBKIT