From 6162cfbddcf8e3a169053a09e42e89f5d7b56b28 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 26 Jul 2019 09:57:24 +0000 Subject: Fix MouseWheel bindings for listbox and scrollbar: This fixes test-failures on Win32. Still to be tested on MacOS and X11 --- generic/tkInt.h | 2 +- library/listbox.tcl | 8 ++++---- library/scrlbar.tcl | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/generic/tkInt.h b/generic/tkInt.h index a3aa36f..07591d1 100644 --- a/generic/tkInt.h +++ b/generic/tkInt.h @@ -981,7 +981,7 @@ typedef struct TkpClipMask { # define Button6Mask (1<<13) #endif #ifndef Button7Mask -# define Button7Mask (1<<13) +# define Button7Mask (1<<14) #endif #ifndef Button8Mask # define Button8Mask (AnyModifier<<4) diff --git a/library/listbox.tcl b/library/listbox.tcl index ffd7def..769fe25 100644 --- a/library/listbox.tcl +++ b/library/listbox.tcl @@ -177,16 +177,16 @@ bind Listbox { } bind Listbox { - %W yview scroll [expr {-((%D+60) / 120)}] units + %W yview scroll [expr {-((%D+15) / 30)}] units } bind Listbox { - %W yview scroll [expr {-((%D+6) / 12)}] units + %W yview scroll [expr {-((%D+1) / 3)}] units } bind Listbox { - %W xview scroll [expr {-((%D+60) / 120)}] units + %W xview scroll [expr {-((%D+15) / 30)}] units } bind Listbox { - %W xview scroll [expr {-((%D+6) / 12)}] units + %W xview scroll [expr {-((%D+1) / 3)}] units } diff --git a/library/scrlbar.tcl b/library/scrlbar.tcl index dae11ae..a20f1a0 100644 --- a/library/scrlbar.tcl +++ b/library/scrlbar.tcl @@ -130,16 +130,16 @@ bind Scrollbar <> { } bind Scrollbar { - tk::ScrollByUnits %W v [expr {-((%D+60) / 120)}] + tk::ScrollByUnits %W v [expr {-((%D+15) / 30)}] } bind Scrollbar { - tk::ScrollByUnits %W v [expr {-((%D+6) / 12)}] + tk::ScrollByUnits %W v [expr {-((%D+1) / 3)}] } bind Scrollbar { - tk::ScrollByUnits %W h [expr {-((%D+60) / 120)}] + tk::ScrollByUnits %W h [expr {-((%D+15) / 30)}] } bind Scrollbar { - tk::ScrollByUnits %W h [expr {-((%D+6) / 12)}] + tk::ScrollByUnits %W h [expr {-((%D+1) / 3)}] } # tk::ScrollButtonDown -- -- cgit v0.12