octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #52795] "pickableparts" unimplemented


From: Rik
Subject: [Octave-bug-tracker] [bug #52795] "pickableparts" unimplemented
Date: Tue, 23 Jan 2018 20:45:13 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

Follow-up Comment #7, bug #52795 (project octave):

@Pantxo: I checked in your 5th changeset here
(http://hg.savannah.gnu.org/hgweb/octave/rev/9d01ce02d5cb).

One small optimization I made was to look up the parent directly rather than
going through the double value which represents the graphic handle.  The
function get_parent () returns a graphics_handle which get_object can use
directly.  Otherwise, get_object() has to call lookup() first on the double
value passed to it in order to get a graphics_handle object and can then call
the internal do_get_object() function.


diff -r b5c731136924 libgui/graphics/Canvas.cc
--- a/libgui/graphics/Canvas.cc Mon Jan 22 16:46:59 2018 +0100
+++ b/libgui/graphics/Canvas.cc Tue Jan 23 17:24:17 2018 -0800
@@ -640,12 +640,10 @@ namespace QtHandles
           {
             // Objects with "hittest"->"off" pass the mouse event to their 
             // parent and so on.
-            graphics_object tmpgo
-              = gh_manager::get_object (currentObj.get ("parent").
-                                        double_value ());
+            graphics_object tmpgo;
+            tmpgo = gh_manager::get_object (currentObj.get_parent ());
             while (tmpgo && ! tmpgo.get_properties ().is_hittest ())
-              tmpgo = gh_manager::get_object (tmpgo.get ("parent")
-                                              .double_value ());
+              tmpgo = gh_manager::get_object (tmpgo.get_parent ());
 
             if (tmpgo && tmpgo.get_handle () != 0.0)
               currentObj = tmpgo;


There still might be some weirdness with respect to the HitTest property and
Figure objects.  As I understand this documentation, Figures ignore the
HitTest property when it comes to executing callback functions.


Figures do not have a PickableParts property. Figures execute button callback
functions regardless of the setting of their HitTest property.


But this is not what Octave does.  If I use your test code from comment #5


fcn = @(h,e) disp (get (h, 'type'));
fcn2 = @(h,e) disp ([get(h, 'type') '2']); 
hp1 = patch ('buttondownfcn', fcn);
hg = hggroup ('buttondownfcn', fcn);
hp2 = patch ('parent', hg, 'buttondownfcn', fcn2);
set (gca, 'buttondownfcn', fcn); 
set (gcf, 'buttondownfcn', fcn); 
## click on the patch -> "patch2"
set (hp2, 'hittest', 'off')
## click on the patch -> "hggroup"
set (hg, 'hittest', 'off')
## click on the patch -> "axes"
set (gca, 'hittest', 'off')
## click on the patch -> "figure"


then everything works as expected.  Now if I add


set (gcf, 'hittest', 'off')


then clicks on the figure itself, outside the axes object, cause "figure" to
be displayed.  But clicking on the patch object no longer causes "figure" to
be printed.

If I check the HitTest property for figures the documentation is


HitTest — Ability to become current object
'on' (default) | 'off'

Ability to become current object, specified as 'on' or 'off':

    Setting the value to 'on' allows the Figure object to become the current
object when the user clicks on the corresponding UI component. A value of 'on'
also allows the figure's CurrentObject property and the gco function to report
the Figure as the current object.

    Setting the value to 'off' sets the figure's CurrentObject property to an
empty GraphicsPlaceholder array when the user clicks on the UI component.


It appears that "HitTest" still means something for Figures, the ability to
become the CurrentObject or not, but it should have no influence on whether
callbacks are run.


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?52795>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]