Choose Language Hide Translation Bar
Highlighted
vince_faller
Super User

Mouse box inside graph box

Is there a way to put a mouse box inside a graph box? Specifically around stuff like rect(). I'm making shapes that I want to give tool tips and click functionality.
Vince Faller - Predictum
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Craige_Hales
Staff (Retired)

Re: Mouse box inside graph box

No, graphs do not use any display box children that might get attached to them. You can put the mousebox around the graph. You'll get to write similar JSL to support the clicks in the mousebox or using the MouseTrap mechanism Jim pointed out. In either case you get a coordinate and have to decide what item was clicked. There is a point-in-polygon function if you have shapes that are not round or square.

Craige

View solution in original post

2 REPLIES 2
Highlighted
txnelson
Super User

Re: Mouse box inside graph box

Are either of these examples from the Scripting Index, what you are looking for?

Names Default To Here( 1 );
New Window( "Example",
	exx = 20,
	exy = 50;
	Graph Box(
		Frame Size( 200, 200 ),
		Mousetrap(
			exx = x;
			exy = y;
		);
		Circle(
			{0, 0},
			Sqrt( exx * exx + exy * exy )
		);
	);
);
Names Default To Here( 1 );
New Window( "Example",
	exx = 20,
	exy = 50;
	Graph Box(
		Frame Size( 200, 200 ),
		Mousetrap(
			exx = x;
			exy = y;
		);
		Circle(
			{0, 0},
			Sqrt( exx * exx + exy * exy )
		);
	);
);
Jim
Highlighted
Craige_Hales
Staff (Retired)

Re: Mouse box inside graph box

No, graphs do not use any display box children that might get attached to them. You can put the mousebox around the graph. You'll get to write similar JSL to support the clicks in the mousebox or using the MouseTrap mechanism Jim pointed out. In either case you get a coordinate and have to decide what item was clicked. There is a point-in-polygon function if you have shapes that are not round or square.

Craige

View solution in original post

Article Labels

    There are no labels assigned to this post.