<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hello Stéphane,<br>
<br>
Le 12/10/2018 à 23:30, Stéphane Mottelet a écrit :<br>
</div>
<blockquote cite="mid:44c14d0e-3eb9-d6da-2c7b-59d862ce7b7f@utc.fr"
type="cite">Hello all,
<br>
<br>
After navigating into the numerous files used for the datatip
stuff, which are in at least two different modules (graphic_object
and gui), I still didn't found the right place to define a
MouseListener that could allow popping a menu when right-clicking
on the datatip text, giving the possibility to copy the
coordinates.
<br>
<br>
I guess this has to be done at the renderer level, since datatips
are part of the polyline itself ?
<br>
<br>
Not that easy...
<br>
<br>
Thanks for help</blockquote>
<br>
About the area to click to get the coordinates: imho, it would be
better to click on the datatip anchor rather than on the label.
Indeed, the label may be hidden (in polyline.<span class="term">datatip_display_mode="mouseclick"|"mouseover"),
while the anchor is always displayed.<br>
About the tool to do that: to me, there are at least 2
possibilities: <br>
</span>
<ul>
<li><span class="term"> activate the datatip mode + create a
contextual menu dedicated only to datatips (that was the case
in Scilab 5.4.0, before refactoring datatips)</span></li>
<li><span class="term">Out of the datatip mode (which requires a
first click to activate it), in the general interactive editor
: left-clicking on an anchor selects the whole curve instead
of only the datatip. Then right-clicking opens the contextual
menu, with actions for the axes or the curve:</span><br>
<span class="term"></span><span class="term"><img
src="cid:part1.AC9C906D.31939ED5@free.fr" alt=""
height="362" width="286"><br>
It would be interesting to resolve the clicked object: if the
click position is around an anchor, then in the contextual
menu the "copy to clipboard" action could be about the only
datatip (its coordinates)<br>
(By the way, in the existing menu, the difference between
"Copy" and "Copy to clipboard" looks unclear to me).</span></li>
</ul>
<p>In practical, i would start</p>
<ul>
<li>either from the datatipmanagermode() gateway:<span
style="color:rgb(0,0,0);"> <i>org</i></span><i>.</i><i>scilab</i><i>.</i><i>modules</i><i>.</i><i>gui</i><i>.</i><i>datatip</i><i>.</i><i>DatatipManager</i><i>.</i><i>start</i></li>
<li>or from the useeditor() one:<span style="color:rgb(0,0,0);"> <i>org</i></span><i>.</i><i>scilab</i><i>.</i><i>modules</i><i>.</i><i>gui</i><i>.</i><i>editor</i><i>.</i><i>EditorManager</i><i>.</i><i>start</i></li>
</ul>
HTH<br>
Samuel<br>
<br>
</body>
</html>