PickableParts or HitTest graphic properties

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

PickableParts or HitTest graphic properties

Rik-4
Does anyone recall whether the PickableParts or HitTest graphic properties
are implemented in Octave?

I've been working quite a bit on improving the legend functionality which
is built atop an axes object.  Unfortunately, it is possible to click on a
legend and then zoom into it which throws everything out of whack.  I would
like to disable mouse interactions with this object entirely.

--Rik

Reply | Threaded
Open this post in threaded view
|

Re: PickableParts or HitTest graphic properties

Daniel Sebald
On 12/20/2017 05:49 PM, Rik wrote:
> Does anyone recall whether the PickableParts or HitTest graphic properties
> are implemented in Octave?
>
> I've been working quite a bit on improving the legend functionality which
> is built atop an axes object.  Unfortunately, it is possible to click on a
> legend and then zoom into it which throws everything out of whack.  I would
> like to disable mouse interactions with this object entirely.

It appears that the graphics toolkit makes a difference.  We'd expect
gnuplot g.t. to be slightly different, but I assume you are talking
about OpenGL based toolkits.

It appears that FLTK is the toolkit for which mouse rotation in the
legend causes a zoom/unzoom.  I notice that one can mouse-click on the
legend and drag it around (a feature I'm sure many are happy with), but
that doesn't work for a garden-variety axes.  So, is there something
extra in C++ programming for legend?  Is it a derived class?  If so, the
legend class may be overriding the mouse behavior of the axes class in
some way already and more alterations could be made.

But there may be an easy fix for the issue you mention (hold on, it will
get complicated).  The axes (and legend) has a property called
'mousewheelzoom'.  Try the following:

octave:19> graphics_toolkit fltk
octave:20> plot(1:50)
octave:21> hl = legend("A line");
octave:22> set(hl, 'mousewheelzoom', 0);

and zooming does not happen.  I'd say for a legend set its
mousewheelzoom to 0 by default and the user will never know the
difference and probably few would ever think to alter the value.

However, here's the complicated part.  Recall a few weeks back a
discussion about the different behavior of mouse button/wheel drag/zoom
for Qt and FLTK?  Mousewheel zooming is the undesirable behavior in FLTK
legends, but in Qt g.t. legends it is dragging (and zooming).  Generate
the same plot above but with the Qt g.t.  Now press one of the Z+, Z- or
drag (i.e., NSEW arrows) buttons and click/drag in the legend.  Those
are just as bad as mousewheel zoom.

It begs the question, does a "mousewheelzoom" setting imply that mouse
wheel should be the zooming mode for plots?  FLTK g.t. zooms with wheel,
Qt g.t. zooms by clicking at the to-be-centroid point, gnuplot g.t.
zooms by selecting the two opposing corners of a box to enlarge (which
is sort of my preference; finer control).

Dan

Reply | Threaded
Open this post in threaded view
|

Re: PickableParts or HitTest graphic properties

Pantxo
In reply to this post by Rik-4
Rik-4 wrote

> Does anyone recall whether the PickableParts or HitTest graphic properties
> are implemented in Octave?
>
> I've been working quite a bit on improving the legend functionality which
> is built atop an axes object.  Unfortunately, it is possible to click on a
> legend and then zoom into it which throws everything out of whack.  I
> would
> like to disable mouse interactions with this object entirely.
>
> --Rik

I have posted a tentative implementation of "pickableparts" here:

https://savannah.gnu.org/bugs/index.php?52795

As for "hittest" it already seams to work fine in Qt toolkit.

Pantxo



--
Sent from: http://octave.1599824.n4.nabble.com/Octave-Maintainers-f1638794.html

Reply | Threaded
Open this post in threaded view
|

Re: PickableParts or HitTest graphic properties

Andreas Weber-6
In reply to this post by Daniel Sebald
Am 21.12.2017 um 06:47 schrieb Daniel J Sebald:
> It appears that FLTK is the toolkit for which mouse rotation in the
> legend causes a zoom/unzoom.  I notice that one can mouse-click on the
> legend and drag it around (a feature I'm sure many are happy with), but
> that doesn't work for a garden-variety axes.  So, is there something
> extra in C++ programming for legend?

It was me who added the possibility to drag the legend to another position.

In __init_fltk__.cc around line 1683 you'll find the exception for legends.

-- Andy