25 #ifdef G4VIS_BUILD_OIX_DRIVER
27 #include <X11/Intrinsic.h>
30 #include <Xm/ScrollBar.h>
32 #if defined(__cplusplus) || defined(c_plusplus)
59 static void mouseScroll(Widget, XtPointer client_data, XEvent* event, Boolean*)
62 Widget sb = (Widget)client_data;
64 int slider_size_return = 0;
65 int increment_return = 0;
66 int page_increment_return = 0;
71 XmScrollBarGetValues (sb, &value_return, &slider_size_return,
72 &increment_return, &page_increment_return);
75 if ( event->xbutton.state & ShiftMask )
79 else if ( event->xbutton.state & ControlMask )
81 step = page_increment_return;
85 step = page_increment_return >> 1;
88 if ( event->xbutton.button == Button4 )
91 if ( value_return < 0 )
94 else if ( event->xbutton.button == Button5 )
97 XtVaGetValues(sb, XmNmaximum, &count, NULL);
99 if ( value_return > count - slider_size_return )
100 value_return = count - slider_size_return;
104 if ( event->xbutton.button == Button4 ||
105 event->xbutton.button == Button5 )
107 XmScrollBarSetValues (sb, value_return, slider_size_return,
108 increment_return, page_increment_return, True);
133 XtVaGetValues(XtParent(w),XmNverticalScrollBar, &wid, NULL);
136 XtAddEventHandler(w, ButtonReleaseMask, False,
137 (XtEventHandler) mouseScroll, wid);
139 XtAddEventHandler(wid, ButtonReleaseMask, False,
140 (XtEventHandler) mouseScroll, wid);
143 #if defined(__cplusplus) || defined(c_plusplus)
147 #endif // G4VIS_BUILD_OIX_DRIVER