Commit d3688b4c authored by Jeffrey Lee's avatar Jeffrey Lee Committed by ROOL

txtar: Support extended scroll requests

Use extended scroll requests to handle mouse wheel scrolling, to avoid
the "thumbing" code getting confused and thinking the user is dragging
the scrollbar (the "thumbing" mode of scrolling isn't desirable for the
mouse wheel, because it largely ignores the requested scroll distance)

This change allows Edit & SrcEdit (and anything else using txtar) to
handle the scroll wheel better, now that the WindowScroll module is
controlling things.

Version 6.06. Tagged as 'RISC_OSLib-6_06'
parent f41e4118
......@@ -9,12 +9,12 @@
GBLS Module_ApplicationDate
GBLS Module_HelpVersion
GBLS Module_ComponentName
Module_MajorVersion SETS "6.05"
Module_Version SETA 605
Module_MajorVersion SETS "6.06"
Module_Version SETA 606
Module_MinorVersion SETS ""
Module_Date SETS "09 May 2020"
Module_ApplicationDate SETS "09-May-20"
Module_ComponentName SETS "RISC_OSLib"
Module_FullVersion SETS "6.05"
Module_HelpVersion SETS "6.05 (09 May 2020)"
Module_FullVersion SETS "6.06"
Module_HelpVersion SETS "6.06 (09 May 2020)"
END
/* (6.05)
/* (6.06)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 6.05
#define Module_MajorVersion_CMHG 6.06
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 09 May 2020
#define Module_MajorVersion "6.05"
#define Module_Version 605
#define Module_MajorVersion "6.06"
#define Module_Version 606
#define Module_MinorVersion ""
#define Module_Date "09 May 2020"
......@@ -16,6 +16,6 @@
#define Module_ComponentName "RISC_OSLib"
#define Module_FullVersion "6.05"
#define Module_HelpVersion "6.05 (09 May 2020)"
#define Module_LibraryVersionInfo "6:5"
#define Module_FullVersion "6.06"
#define Module_HelpVersion "6.06 (09 May 2020)"
#define Module_LibraryVersionInfo "6:6"
......@@ -1944,6 +1944,18 @@ static void txtar__textwimpevent(wimp_eventstr *e, void *handle)
} else if (e->data.scroll.x == -1) {/* small amount left */
e->data.o.x -= 16 * wimpt_dx();
txtar__doopenevent(t, &e->data.o);
} else if (((e->data.scroll.x | e->data.scroll.y) & 3) == 0) {
/* Extended scroll request */
if (e->data.scroll.x) {
/* Horizontal component */
e->data.o.x += 16 * wimpt_dx() * e->data.scroll.x;
txtar__doopenevent(t, &e->data.o);
}
if (e->data.scroll.y) {
/* Vertical component - scroll directly, no thumbing! */
int ofs = e->data.scroll.y + (e->data.scroll.y>>2); /* 5 lines per tick to match old USBDriver behaviour */
txt1_domovevertical(t, -ofs, TRUE);
}
} else {
tracef1("scroll event %i ignored.\n", e->data.scroll.y);
};
......@@ -2463,6 +2475,7 @@ BOOL txtar_initwindow(txt t, char *title)
d->info.title.indirecttext.validstring = (char*) -1;
d->info.title.indirecttext.bufflen = TITLEBUFMAX;
d->info.colours[wimp_WCWKAREABACK] = 255; /* do no filling of background */
d->info.colours[wimp_WCRESERVED] |= 2; /* Extended scroll requests, please */
tracef0("creating window\n");
tracef1("window desc is at %i\n", (int) s->d);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment