Browse Source

dtfile: Add scroll wheel support

This patch was manually added via a diff supplied from a user on the
CDE mailing list: Michele Ghisolfo <ghisolfo.m@gmail.com>
Jon Trulson 4 years ago
parent
commit
1972d3e378
1 changed files with 9 additions and 2 deletions
  1. 9 2
      cde/programs/dtfile/IconWindow.c

+ 9 - 2
cde/programs/dtfile/IconWindow.c

@@ -300,7 +300,6 @@ FileWindowInputCallback(
    Modifiers modif;
    int offset;
    Boolean found;
-
    /* Do nothing if a Button 2 drag is already ramping up */
    if (B2DragPossible)
       return;
@@ -835,7 +834,15 @@ FileWindowInputCallback(
       }
       else
       {
-         event = (XButtonPressedEvent *)new_event;
+         event = (XButtonPressedEvent *)new_event;		/* %%% */
+         if(event->button == Button4 || event->button == Button5) {
+                String p = event->button == Button4 ? "up" : "down";
+                String q = event->button == Button4 ? "IncrementUpOrLeft" : "IncrementDownOrRight";
+                  if( VerticalScrollbarIsVisible(
+                              file_mgr_rec->vertical_scroll_bar,
+                              file_mgr_rec->scroll_window))
+                      XtCallActionProc( file_mgr_rec->vertical_scroll_bar, q, new_event, &p, 1 );
+         } 
          if(event->button != Button1)
             return;
       }