Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic link text clicked (Read 770 times)
liza
Full Member
***
Offline


I Love MindFusion!

Posts: 132
Joined: Apr 25th, 2019
link text clicked
Sep 13th, 2019 at 10:20am
Print Post  
Hi,
Is there any event which is fire when a user click on link text, Actually I want to open a pop up once the text of link is double clicked. Please let me know.
  
Back to top
AIM  
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3154
Joined: Oct 19th, 2005
Re: link text clicked
Reply #1 - Sep 16th, 2019 at 9:20am
Print Post  
Hi,

There's no specific event for clicked text. If your font size is small enough to detect the click on a link, you could hit-test from linkClicked event handler -

Code
Select All
function onLinkClicked(sender, args)
{
	var link = args.getLink();
	if (link.textRenderer.rectangles && link.textRenderer.rectangles.length > 0)
	{
		var rect = link.textRenderer.rectangles[0];
		// default text style centers at rect's location
		rect.x -= rect.width / 2;
		if (rect.containsPoint(args.getMousePosition()))
		{
			alert("text clicked");
		}
	}
} 



If you are showing larger font / longer text, click on the text might not trigger as a linkClicked event when further from link's segment. In such case you will have to hit-test all links from diagram's own clicked event, and then check the text rectangle of each link.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint