[Scilab-Dev] datatip contextual menu to copy [x,y]
Samuel Gougeon
sgougeon at free.fr
Sat Oct 13 13:28:09 CEST 2018
Hello Stéphane,
Le 12/10/2018 à 23:30, Stéphane Mottelet a écrit :
> Hello all,
>
> 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.
>
> I guess this has to be done at the renderer level, since datatips are
> part of the polyline itself ?
>
> Not that easy...
>
> Thanks for help
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.datatip_display_mode="mouseclick"|"mouseover"), while the
anchor is always displayed.
About the tool to do that: to me, there are at least 2 possibilities:
* activate the datatip mode + create a contextual menu dedicated
only to datatips (that was the case in Scilab 5.4.0, before
refactoring datatips)
* 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:
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)
(By the way, in the existing menu, the difference between "Copy" and
"Copy to clipboard" looks unclear to me).
In practical, i would start
* either from the datatipmanagermode()
gateway:/org//.//scilab//.//modules//.//gui//.//datatip//.//DatatipManager//.//start/
* or from the useeditor()
one:/org//.//scilab//.//modules//.//gui//.//editor//.//EditorManager//.//start/
HTH
Samuel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/dev/attachments/20181013/80515c0c/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dolihgfkgfnefnof.png
Type: image/png
Size: 15857 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/dev/attachments/20181013/80515c0c/attachment.png>
More information about the dev
mailing list