datatip contextual menu to copy [x,y]

classic Classic list List threaded Threaded
4 messages Options
mottelet mottelet
Reply | Threaded
Open this post in threaded view
|

datatip contextual menu to copy [x,y]

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

S.


_______________________________________________
dev mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/dev
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

Re: datatip contextual menu to copy [x,y]

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


_______________________________________________
dev mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/dev
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

Re: datatip contextual menu to copy [x,y]

Le 13/10/2018 à 13:28, Samuel Gougeon a écrit :
.../...
  • 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).

About this last point: The issue that makes things rather puzzling is that, presently, the contextual menu mixes items related to different objects: Axes, and curves, ...
  • The default object when entering the editor is the current axes. OK (but the figure's level is not reachable).
  • After selecting a curve, the menu opened when right-clicking is the Axes contextual menu + newly activated items, instead of being dedicated only to actions on curves. Then, it's unclear on what some "general actions" like copy, delete, clear... are done: the axes, the curve, (then the datatip ?) ...
  • For datatips, imho  it would be more handy to resolve the left selecting click without having to activate the datatipManagerMode, and then display a contextual menu with actions only on the selected datatip, like copying its coordinates.

Regards
Samuel



_______________________________________________
dev mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/dev
mottelet mottelet
Reply | Threaded
Open this post in threaded view
|

Re: datatip contextual menu to copy [x,y]

Hello,

Here is a proposition, to be discussed/improved, of course (patch+demo video):

https://codereview.scilab.org/#/c/20550/

S.

Le 13/10/2018 à 13:59, Samuel Gougeon a écrit :
Le 13/10/2018 à 13:28, Samuel Gougeon a écrit :
.../...
  • 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).

About this last point: The issue that makes things rather puzzling is that, presently, the contextual menu mixes items related to different objects: Axes, and curves, ...
  • The default object when entering the editor is the current axes. OK (but the figure's level is not reachable).
  • After selecting a curve, the menu opened when right-clicking is the Axes contextual menu + newly activated items, instead of being dedicated only to actions on curves. Then, it's unclear on what some "general actions" like copy, delete, clear... are done: the axes, the curve, (then the datatip ?) ...
  • For datatips, imho  it would be more handy to resolve the left selecting click without having to activate the datatipManagerMode, and then display a contextual menu with actions only on the selected datatip, like copying its coordinates.

Regards
Samuel




_______________________________________________
dev mailing list
[hidden email]
https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/dev


-- 
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet

_______________________________________________
dev mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/dev