diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2008-12-28 23:43:14 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2008-12-28 23:43:14 (GMT) |
commit | 54336c5070ceca45adeebef398a457aa99dd5f63 (patch) | |
tree | 6849b204934d0286023de9a56adaf14750d2cce3 /library/scrlbar.tcl | |
parent | 0a5d0843c169cfee7963b1feb685c3df23fed7c5 (diff) | |
download | tk-54336c5070ceca45adeebef398a457aa99dd5f63.zip tk-54336c5070ceca45adeebef398a457aa99dd5f63.tar.gz tk-54336c5070ceca45adeebef398a457aa99dd5f63.tar.bz2 |
Corrected mouse-wheel bindings for widgets. Now Shift-wheel always scrolls the
text widget horizontally on all platforms.
Diffstat (limited to 'library/scrlbar.tcl')
-rw-r--r-- | library/scrlbar.tcl | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/library/scrlbar.tcl b/library/scrlbar.tcl index ec14473..21eaa02 100644 --- a/library/scrlbar.tcl +++ b/library/scrlbar.tcl @@ -3,7 +3,7 @@ # This file defines the default bindings for Tk scrollbar widgets. # It also provides procedures that help in implementing the bindings. # -# RCS: @(#) $Id: scrlbar.tcl,v 1.13 2006/03/17 11:13:15 patthoyts Exp $ +# RCS: @(#) $Id: scrlbar.tcl,v 1.14 2008/12/28 23:43:14 dkf Exp $ # # Copyright (c) 1994 The Regents of the University of California. # Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -130,18 +130,34 @@ bind Scrollbar <End> { tk::ScrollToPos %W 1 } } -if {[tk windowingsystem] eq "aqua"} { - bind Scrollbar <MouseWheel> { - tk::ScrollByUnits %W v [expr {- (%D)}] - } - bind Scrollbar <Option-MouseWheel> { - tk::ScrollByUnits %W v [expr {-10 * (%D)}] +switch [tk windowingsystem] { + "aqua" { + bind Scrollbar <MouseWheel> { + tk::ScrollByUnits %W v [expr {- (%D)}] + } + bind Scrollbar <Option-MouseWheel> { + tk::ScrollByUnits %W v [expr {-10 * (%D)}] + } + bind Scrollbar <Shift-MouseWheel> { + tk::ScrollByUnits %W h [expr {- (%D)}] + } + bind Scrollbar <Shift-Option-MouseWheel> { + tk::ScrollByUnits %W h [expr {-10 * (%D)}] + } } - bind Scrollbar <Shift-MouseWheel> { - tk::ScrollByUnits %W h [expr {- (%D)}] + "win32" { + bind Scrollbar <MouseWheel> { + tk::ScrollByUnits %W v [expr {- (%D / 120) * 4}] + } + bind Scrollbar <Shift-MouseWheel> { + tk::ScrollByUnits %W h [expr {- (%D / 120) * 4}] + } } - bind Scrollbar <Shift-Option-MouseWheel> { - tk::ScrollByUnits %W h [expr {-10 * (%D)}] + "x11" { + bind Scrollbar <4> {tk::ScrollByUnits %W v -5} + bind Scrollbar <5> {tk::ScrollByUnits %W v 5} + bind Scrollbar <Shift-4> {tk::ScrollByUnits %W h -5} + bind Scrollbar <Shift-5> {tk::ScrollByUnits %W h 5} } } # tk::ScrollButtonDown -- |