bugGNU Octave - Bugs: bug #56028, windowscrollwheelfcn property of a...

 
 

bug #56028: windowscrollwheelfcn property of a figure

Submitted by:  Guillaume <gyom>
Submitted on:  Fri 29 Mar 2019 11:48:26 AM UTC  
 
Category:  Plotting with OpenGL Severity:  1 - Wish
Priority:  3 - Low Item Group:  Feature Request
Status:  Fixed Assigned to:  None
Originator Name:  Guillaume Open/Closed:  Closed
Release:  dev Operating System:  GNU/Linux

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

( Jump to the original submission)

Wed 29 May 2019 12:10:28 AM UTC, comment #10:

I added a third field to the event structure which has fieldname "EventName" and value "WindowScrollWheel".  It was trivial and Matlab includes this field.  I checked everything in here (https://hg.savannah.gnu.org/hgweb/octave/rev/d2d2f66e1cdc).

Marking as fixed and closing report.

Rik <rik5>
Project Administrator
Tue 28 May 2019 03:17:54 PM UTC, comment #9:

I could compile this time, thanks! The example in comment #0 now works as well as the real life situation from which this report originates.

Guillaume <gyom>
Tue 28 May 2019 02:45:29 PM UTC, comment #8:

Sorry, the attached patch should fix the issue.

(file #46992)

Pantxo Diribarne <pantxo>
Project Member
Tue 28 May 2019 02:37:24 PM UTC, comment #7:

Oops, I wasn't expecting whitespace to be screwed up inside verbatim tags..  I also attached the change.

(file #46991)

John W. Eaton <jwe>
Project Administrator
Tue 28 May 2019 02:35:14 PM UTC, comment #6:

It works for me with the following additional change:

diff --git a/libgui/graphics/Canvas.cc b/libgui/graphics/Canvas.cc
--- a/libgui/graphics/Canvas.cc
+++ b/libgui/graphics/Canvas.cc
@@ -1005,13 +1005,15 @@ namespace QtHandles

             if (redrawFigure)
               redraw (false);
-          }
-
-        if (! fig.get ("windowscrollwheelfcn").isempty ())
-          {
-            octave_scalar_map eventData = Utils::makeScrollEventStruct (event);
-            gh_manager::post_callback (m_handle, "windowscrollwheelfcn",
-                                       eventData);
+
+            if (! figObj.get ("windowscrollwheelfcn").isempty ())
+              {
+                octave_scalar_map eventData
+                  = Utils::makeScrollEventStruct (event);
+
+                gh_manager::post_callback (m_handle, "windowscrollwheelfcn",
+                                           eventData);
+              }
           }
       }
   }

John W. Eaton <jwe>
Project Administrator
Tue 28 May 2019 01:08:47 PM UTC, comment #5:

Thanks for working on this. I tried the updated patch but compilation failed:

../libgui/graphics/Canvas.cc: In member function ‘void QtHandles::Canvas::canvasWheelEvent(QWheelEvent*)’:
../libgui/graphics/Canvas.cc:1010:15: error: ‘fig’ was not declared in this scope
         if (! fig.get ("windowscrollwheelfcn").isempty ())

Guillaume <gyom>
Tue 28 May 2019 10:26:49 AM UTC, comment #4:

I attached an updated patch with the NEWS files updated and the callback only triggered when not empty.

(file #46987)

Pantxo Diribarne <pantxo>
Project Member
Tue 28 May 2019 08:32:44 AM UTC, comment #3:

I attached a basic implementation but the event data may not be accurate:

  • VerticalScrollCount: our graphics event handling is not enough sophisticated and we have no way to determine (citing ML doc) "the sum of all scroll wheel clicks that occurred since the last time the callback executed". So this will return number of wheel steps since the last Qt event queue was flushed.
  • VerticalScrollAmount: I was unable to determine how to get this information from Qt, so this will always be 3.

(file #46984)

Pantxo Diribarne <pantxo>
Project Member
Mon 27 May 2019 11:11:12 PM UTC, comment #2:

@Pantxo: Do you know if implementing this would be easy or hard?  Seems like there is a Qt class for this called QWheelEvent (https://doc.qt.io/qt-5/qwheelevent.html).  I guess we would need to hook it up somewhere in Canvas.cc.

Rik <rik5>
Project Administrator
Mon 01 Apr 2019 12:10:12 AM UTC, comment #1:

Right, looks like this is present only to complete the list of properties that can be set. Definitely documented in the user manual as unused in Octave right now (see https://octave.org/doc/interpreter/Figure-Properties.html#XREFfigurewindowscrollwheelfcn).

Mike Miller <mtmiller>
Project Administrator
Fri 29 Mar 2019 11:48:26 AM UTC, original submission:

The "windowscrollwheelfcn" callback is not triggered when using the scroll wheel within a figure:

set (figure (), "WindowScrollWheelFcn", "disp ('wheel')");

Guillaume <gyom>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #46992:  scroll_wheel_fcn4.patch added by pantxo (5KiB - text/x-patch)
file #46991:  diffs.txt added by jwe (912B - text/plain)
file #46987:  scroll_wheel_fcn2.patch added by pantxo (4KiB - text/x-patch)
file #46984:  scroll_wheel_fcn.patch added by pantxo (3KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by pantxo (Updated the item)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by rik5
  • -email is unavailable- added by gyom (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 11 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-05-29 rik5 StatusPatch Submitted => Fixed
        Open/ClosedOpen => Closed
    2019-05-28 pantxo Attached File- => Added scroll_wheel_fcn4.patch, #46992
    2019-05-28 jwe Attached File- => Added diffs.txt, #46991
    2019-05-28 pantxo Attached File- => Added scroll_wheel_fcn2.patch, #46987
    2019-05-28 pantxo Attached File- => Added scroll_wheel_fcn.patch, #46984
        StatusNone => Patch Submitted
    2019-05-27 rik5 Carbon-Copy- => Added pantxo
    2019-04-01 mtmiller CategoryPlotting => Plotting with OpenGL
        Severity3 - Normal => 1 - Wish
        Priority5 - Normal => 3 - Low

    Back to the top


    Powered by Savane 3.4