dir = &(SFdirs[SFdirPtr + n]);
+
old = dir->vOrigin;
+ if(new == -1) new = old + 1; else if(new == -2) new = old - 1; // [HGM] indicates scroll direction on mousewheel event
+ if(new < 0 || new > dir->nEntries - SFlistSize) return;
dir->vOrigin = new;
if (old == new) {
static int SFtwiddle = 0;
+void SFsetText(char *path);
+
int
SFchdir(path)
char *path;
int n;
XButtonPressedEvent *event;
{
+ int dir = 0;
+ if(event->button == Button4) dir = -2; // kludge to indicate relative motion
+ if(event->button == Button5) dir = -1;
+ if(dir) SFvSliderMovedCallback(w, n, dir); else
SFbuttonPressed = 1;
}
{
SFDir *dir;
+ if(event->button == Button4 || event->button == Button5) return; // [HGM] mouse wheel does not select
SFbuttonPressed = 0;
if (SFcurrentInvert[n] != -1) {
XtSetKeyboardFocus((Widget) data, w);
}
+void SFwheelProc(Widget w, XtPointer data, XEvent *event, Boolean *b)
+{ // [HGM] mouse-wheel callback scrolls lists
+ int dir, n = (intptr_t) data;
+ if(event->xbutton.button == Button4) dir = -2; // kludge to indicate relative motion
+ if(event->xbutton.button == Button5) dir = -1;
+ SFvSliderMovedCallback(w, n, dir);
+}
+
static void
SFcreateWidgets(toplevel, prompt, ok, cancel)
Widget toplevel;
SFhSliderMovedCallback, (XtPointer)(intptr_t) n);
XtAddCallback(selFileHScrolls[n], XtNscrollProc,
SFhAreaSelectedCallback, (XtPointer)(intptr_t) n);
+
+ XtAddEventHandler(selFileVScrolls[n], ButtonPressMask, False,
+ SFwheelProc, (XtPointer)(intptr_t) n); // [HGM] couplemouse wheel to v-scroll
}
i = 0;