#include <X11/Intrinsic.h>
#include <X11/Xlib.h>
#include <Xm/Xm.h>
#include <Xm/ScrollBar.h>
Go to the source code of this file.
static void mouseScroll |
( |
Widget |
, |
|
|
XtPointer |
client_data, |
|
|
XEvent * |
event |
|
) |
| |
|
static |
Definition at line 57 of file wheelmouse.cc.
59 Widget sb = (Widget)client_data;
61 int slider_size_return = 0;
62 int increment_return = 0;
63 int page_increment_return = 0;
68 XmScrollBarGetValues (sb, &value_return, &slider_size_return,
69 &increment_return, &page_increment_return);
72 if ( event->xbutton.state & ShiftMask )
76 else if ( event->xbutton.state & ControlMask )
78 step = page_increment_return;
82 step = page_increment_return >> 1;
85 if ( event->xbutton.button == Button4 )
88 if ( value_return < 0 )
91 else if ( event->xbutton.button == Button5 )
94 XtVaGetValues(sb, XmNmaximum, &count, NULL);
96 if ( value_return > count - slider_size_return )
97 value_return = count - slider_size_return;
101 if ( event->xbutton.button == Button4 ||
102 event->xbutton.button == Button5 )
104 XmScrollBarSetValues (sb, value_return, slider_size_return,
105 increment_return, page_increment_return, True);
void xmAddMouseEventHandler |
( |
Widget |
w | ) |
|
Definition at line 125 of file wheelmouse.cc.
130 XtVaGetValues(XtParent(w),XmNverticalScrollBar, &wid, NULL);
133 XtAddEventHandler(w, ButtonReleaseMask, False,
136 XtAddEventHandler(wid, ButtonReleaseMask, False,
static void mouseScroll(Widget, XtPointer client_data, XEvent *event)