summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
Diffstat (limited to 'library')
-rw-r--r--library/demos/cscroll.tcl8
-rw-r--r--library/listbox.tcl8
-rw-r--r--library/scrlbar.tcl8
-rw-r--r--library/text.tcl8
-rw-r--r--library/ttk/utils.tcl35
5 files changed, 26 insertions, 41 deletions
diff --git a/library/demos/cscroll.tcl b/library/demos/cscroll.tcl
index 24d5f89..c709668 100644
--- a/library/demos/cscroll.tcl
+++ b/library/demos/cscroll.tcl
@@ -59,16 +59,16 @@ $c bind all <1> "scrollButton $c"
bind $c <2> "$c scan mark %x %y"
bind $c <B2-Motion> "$c scan dragto %x %y"
bind $c <MouseWheel> {
- %W yview scroll [expr {-(%D / 40)}] units
+ %W yview scroll [expr {-((%D+60) / 120)}] units
}
bind $c <Option-MouseWheel> {
- %W yview scroll [expr {-(%D / 4)}] units
+ %W yview scroll [expr {-((%D+6) / 12)}] units
}
bind $c <Shift-MouseWheel> {
- %W xview scroll [expr {-(%D / 40)}] units
+ %W xview scroll [expr {-((%D+60) / 120)}] units
}
bind $c <Shift-Option-MouseWheel> {
- %W xview scroll [expr {-(%D / 4)}] units
+ %W xview scroll [expr {-((%D+6) / 12)}] units
}
proc scrollEnter canvas {
diff --git a/library/listbox.tcl b/library/listbox.tcl
index fd10fe4..ffd7def 100644
--- a/library/listbox.tcl
+++ b/library/listbox.tcl
@@ -177,16 +177,16 @@ bind Listbox <B2-Motion> {
}
bind Listbox <MouseWheel> {
- %W yview scroll [expr {-(%D / 40)}] units
+ %W yview scroll [expr {-((%D+60) / 120)}] units
}
bind Listbox <Option-MouseWheel> {
- %W yview scroll [expr {-(%D / 4)}] units
+ %W yview scroll [expr {-((%D+6) / 12)}] units
}
bind Listbox <Shift-MouseWheel> {
- %W xview scroll [expr {-(%D / 40)}] units
+ %W xview scroll [expr {-((%D+60) / 120)}] units
}
bind Listbox <Shift-Option-MouseWheel> {
- %W xview scroll [expr {-(%D / 4)}] units
+ %W xview scroll [expr {-((%D+6) / 12)}] units
}
diff --git a/library/scrlbar.tcl b/library/scrlbar.tcl
index 93ded56..dae11ae 100644
--- a/library/scrlbar.tcl
+++ b/library/scrlbar.tcl
@@ -130,16 +130,16 @@ bind Scrollbar <<LineEnd>> {
}
bind Scrollbar <MouseWheel> {
- tk::ScrollByUnits %W v [expr {-(%D / 40)}]
+ tk::ScrollByUnits %W v [expr {-((%D+60) / 120)}]
}
bind Scrollbar <Option-MouseWheel> {
- tk::ScrollByUnits %W v [expr {-(%D / 4)}]
+ tk::ScrollByUnits %W v [expr {-((%D+6) / 12)}]
}
bind Scrollbar <Shift-MouseWheel> {
- tk::ScrollByUnits %W h [expr {-(%D / 40)}]
+ tk::ScrollByUnits %W h [expr {-((%D+60) / 120)}]
}
bind Scrollbar <Shift-Option-MouseWheel> {
- tk::ScrollByUnits %W h [expr {-(%D / 4)}]
+ tk::ScrollByUnits %W h [expr {-((%D+6) / 12)}]
}
# tk::ScrollButtonDown --
diff --git a/library/text.tcl b/library/text.tcl
index 9d635de..72da6ff 100644
--- a/library/text.tcl
+++ b/library/text.tcl
@@ -428,16 +428,16 @@ bind Text <B2-Motion> {
set ::tk::Priv(prevPos) {}
bind Text <MouseWheel> {
- %W yview scroll [expr {-(%D)}] pixels
+ %W yview scroll [expr {-((%D+1)/3)}] pixels
}
bind Text <Option-MouseWheel> {
- %W yview scroll [expr {-10 * (%D)}] pixels
+ %W yview scroll [expr {-4 * (%D)}] pixels
}
bind Text <Shift-MouseWheel> {
- %W xview scroll [expr {-(%D)}] pixels
+ %W xview scroll [expr {-((%D+1)/3)}] pixels
}
bind Text <Shift-Option-MouseWheel> {
- %W xview scroll [expr {-10 * (%D)}] pixels
+ %W xview scroll [expr {-4 * (%D)}] pixels
}
# ::tk::TextClosestGap --
diff --git a/library/ttk/utils.tcl b/library/ttk/utils.tcl
index 140e061..ad36927 100644
--- a/library/ttk/utils.tcl
+++ b/library/ttk/utils.tcl
@@ -285,7 +285,8 @@ proc ttk::copyBindings {from to} {
#
proc ttk::bindMouseWheel {bindtag callback} {
- bind $bindtag <MouseWheel> [append callback { [expr {-(%D/40)}]}]
+ bind $bindtag <MouseWheel> [append callback { [expr {-((%D+60)/120)}]}]
+ bind $bindtag <Option-MouseWheel> [append callback { [expr {-((%D+6)/12)}]}]
}
## Mousewheel bindings for standard scrollable widgets.
@@ -296,29 +297,13 @@ proc ttk::bindMouseWheel {bindtag callback} {
# standard scrollbar protocol.
#
-switch -- [tk windowingsystem] {
- x11 {
- bind TtkScrollable <ButtonPress-4> { %W yview scroll -5 units }
- bind TtkScrollable <ButtonPress-5> { %W yview scroll 5 units }
- bind TtkScrollable <Shift-ButtonPress-4> { %W xview scroll -5 units }
- bind TtkScrollable <Shift-ButtonPress-5> { %W xview scroll 5 units }
- }
- win32 {
- bind TtkScrollable <MouseWheel> \
- { %W yview scroll [expr {-(%D/120)}] units }
- bind TtkScrollable <Shift-MouseWheel> \
- { %W xview scroll [expr {-(%D/120)}] units }
- }
- aqua {
- bind TtkScrollable <MouseWheel> \
- { %W yview scroll [expr {-(%D)}] units }
- bind TtkScrollable <Shift-MouseWheel> \
- { %W xview scroll [expr {-(%D)}] units }
- bind TtkScrollable <Option-MouseWheel> \
- { %W yview scroll [expr {-10*(%D)}] units }
- bind TtkScrollable <Shift-Option-MouseWheel> \
- { %W xview scroll [expr {-10*(%D)}] units }
- }
-}
+bind TtkScrollable <MouseWheel> \
+{ %W yview scroll [expr {-((%D+60)/120)}] units }
+bind TtkScrollable <Option-MouseWheel> \
+{ %W yview scroll [expr {-((%D+6)/12)}] units }
+bind TtkScrollable <Shift-MouseWheel> \
+{ %W xview scroll [expr {-((%D+60)/120)}] units }
+bind TtkScrollable <Shift-Option-MouseWheel> \
+{ %W xview scroll [expr {-((%D+6)/12)}] units }
#*EOF*