Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Web browser control and context menu
Message
From
28/05/2007 17:52:31
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
28/05/2007 16:37:06
Mike Sue-Ping
Cambridge, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01228919
Message ID:
01228927
Views:
20
This message has been marked as a message which has helped to the initial question of the thread.
>Does anyone know if it is possible to implement a custom VFP context/shortcut menu on the web browser control hosted in a VFP form?

Any DHTML element to which you want to attach your own contextmenu needs to have a redirection into your JavaScript code, like this
onContextMenu="rclick(event);"
where rclick(e) is your piece of JavaScript:
function rclick(e)
{
	var targ
	if (!e) 
		var e = window.event;
	if (e.target) 
		targ = e.target
	else if (e.srcElement) 
		targ = e.srcElement;
	e.returnValue=false;
	oFrm=document.forms[0];
	oFrm.action="YourProtocolHere:"+targ.name;
	oFrm.submit();
	return false;
}
Then you catch your protocol in oBrowser.BeforeNavigate2, make sure cancel=.t. so it doesn't try to navigate anywhere. You may also add code to catch some coordinates (browser's event object has a few properties which may help, but you'll need to recalculate the position) so to know where to show your VFP popup.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform