diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-07-25 16:07:02 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-07-25 16:07:02 (GMT) |
commit | fda72faf1d67dd4016bf6842a6448943bd324707 (patch) | |
tree | b548a211106c683957d4631e5229f7fb1e3625b4 /tests | |
parent | 5c07a1409bb742e9fe41e7e523146ce75d71580a (diff) | |
parent | 02adf45068f997e84707a3479e629b74b5409671 (diff) | |
download | tk-fda72faf1d67dd4016bf6842a6448943bd324707.zip tk-fda72faf1d67dd4016bf6842a6448943bd324707.tar.gz tk-fda72faf1d67dd4016bf6842a6448943bd324707.tar.bz2 |
Experiment: Handle scaling fractors for the ScrollWheel sensibly. Trying "40" as a good general scale factor (compared to "50" on X11 and "120" on Win32 and "1" on Aqua)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bind.test | 56 | ||||
-rw-r--r-- | tests/scrollbar.test | 36 |
2 files changed, 60 insertions, 32 deletions
diff --git a/tests/bind.test b/tests/bind.test index 87e8e03..ebc39b7 100644 --- a/tests/bind.test +++ b/tests/bind.test @@ -5862,6 +5862,62 @@ test bind-27.7 {button names} -setup { } -cleanup { destroy .t.f } -result {<Button-5> {button 5}} +test bind-27.8 {button names} -setup { + frame .t.f -class Test -width 150 -height 100 + pack .t.f + focus -force .t.f + update +} -body { + bind .t.f <Button-6> {lappend x "button 6"} + set x [bind .t.f] + event generate .t.f <Button-6> + event generate .t.f <ButtonRelease-6> + set x +} -cleanup { + destroy .t.f +} -result {<Button-6> {button 6}} +test bind-27.9 {button names} -setup { + frame .t.f -class Test -width 150 -height 100 + pack .t.f + focus -force .t.f + update +} -body { + bind .t.f <Button-7> {lappend x "button 7"} + set x [bind .t.f] + event generate .t.f <Button-7> + event generate .t.f <ButtonRelease-7> + set x +} -cleanup { + destroy .t.f +} -result {<Button-7> {button 7}} +test bind-27.10 {button names} -setup { + frame .t.f -class Test -width 150 -height 100 + pack .t.f + focus -force .t.f + update +} -body { + bind .t.f <Button-8> {lappend x "button 8"} + set x [bind .t.f] + event generate .t.f <Button-8> + event generate .t.f <ButtonRelease-8> + set x +} -cleanup { + destroy .t.f +} -result {<Button-8> {button 8}} +test bind-27.11 {button names} -setup { + frame .t.f -class Test -width 150 -height 100 + pack .t.f + focus -force .t.f + update +} -body { + bind .t.f <Button-9> {lappend x "button 9"} + set x [bind .t.f] + event generate .t.f <Button-9> + event generate .t.f <ButtonRelease-9> + set x +} -cleanup { + destroy .t.f +} -result {<Button-9> {button 9}} test bind-28.1 {keysym names} -body { bind .t <Expose-a> foo diff --git a/tests/scrollbar.test b/tests/scrollbar.test index 701aa26..d235656 100644 --- a/tests/scrollbar.test +++ b/tests/scrollbar.test @@ -685,7 +685,7 @@ test scrollbar-9.1 {scrollbar widget vs hidden commands} { list [winfo children .] [interp hidden] } [list {} $l] -test scrollbar-10.1.1 {<MouseWheel> event on scrollbar} -constraints {notAqua} -setup { +test scrollbar-10.1 {<MouseWheel> event on scrollbar} -setup { destroy .t .s } -body { pack [text .t -yscrollcommand {.s set}] -side left @@ -693,42 +693,14 @@ test scrollbar-10.1.1 {<MouseWheel> event on scrollbar} -constraints {notAqua} - pack [scrollbar .s -command {.t yview}] -fill y -expand 1 -side left update focus -force .s - event generate .s <MouseWheel> -delta -120 - after 200 {set eventprocessed 1} ; vwait eventprocessed - .t index @0,0 -} -cleanup { - destroy .t .s -} -result {5.0} -test scrollbar-10.1.2 {<MouseWheel> event on scrollbar} -constraints {aqua} -setup { - destroy .t .s -} -body { - pack [text .t -yscrollcommand {.s set}] -side left - for {set i 1} {$i < 100} {incr i} {.t insert end "Line $i\n"} - pack [scrollbar .s -command {.t yview}] -fill y -expand 1 -side left - update - focus -force .s - event generate .s <MouseWheel> -delta -4 + event generate .s <MouseWheel> -delta -150 after 200 {set eventprocessed 1} ; vwait eventprocessed .t index @0,0 } -cleanup { destroy .t .s } -result {5.0} -test scrollbar-10.2.1 {<MouseWheel> event on scrollbar} -constraints {notAqua} -setup { - destroy .t .s -} -body { - pack [text .t -xscrollcommand {.s set} -wrap none] -side top - for {set i 1} {$i < 100} {incr i} {.t insert end "Char $i "} - pack [scrollbar .s -command {.t xview} -orient horizontal] -fill x -expand 1 -side top - update - focus -force .s - event generate .s <Shift-MouseWheel> -delta -120 - after 200 {set eventprocessed 1} ; vwait eventprocessed - .t index @0,0 -} -cleanup { - destroy .t .s -} -result {1.4} -test scrollbar-10.2.2 {<MouseWheel> event on scrollbar} -constraints {aqua} -setup { +test scrollbar-10.2 {<MouseWheel> event on scrollbar} -setup { destroy .t .s } -body { pack [text .t -xscrollcommand {.s set} -wrap none] -side top @@ -736,7 +708,7 @@ test scrollbar-10.2.2 {<MouseWheel> event on scrollbar} -constraints {aqua} -set pack [scrollbar .s -command {.t xview} -orient horizontal] -fill x -expand 1 -side top update focus -force .s - event generate .s <Shift-MouseWheel> -delta -4 + event generate .s <Shift-MouseWheel> -delta -150 after 200 {set eventprocessed 1} ; vwait eventprocessed .t index @0,0 } -cleanup { |