diff options
author | rjohnson <rjohnson@noemail.net> | 1998-04-01 09:51:45 (GMT) |
---|---|---|
committer | rjohnson <rjohnson@noemail.net> | 1998-04-01 09:51:45 (GMT) |
commit | 9c5b7f2b7e472536ed2e7c915ead05e2aa264182 (patch) | |
tree | 8fb30cb152c4dc191be47fa043d2e6f5ea38c7ba /tests/canvWind.test | |
parent | 1d0efcbe267f2c0eb73869862522fb20fb2d63ca (diff) | |
download | tk-9c5b7f2b7e472536ed2e7c915ead05e2aa264182.zip tk-9c5b7f2b7e472536ed2e7c915ead05e2aa264182.tar.gz tk-9c5b7f2b7e472536ed2e7c915ead05e2aa264182.tar.bz2 |
Initial revision
FossilOrigin-Name: 2bf55ca9aa942b581137b9f474da5ad9c1480de4
Diffstat (limited to 'tests/canvWind.test')
-rw-r--r-- | tests/canvWind.test | 133 |
1 files changed, 133 insertions, 0 deletions
diff --git a/tests/canvWind.test b/tests/canvWind.test new file mode 100644 index 0000000..d8c6835 --- /dev/null +++ b/tests/canvWind.test @@ -0,0 +1,133 @@ +# This file is a Tcl script to test out the procedures in tkCanvWind.c, +# which implement canvas "window" items. It is organized in the standard +# fashion for Tcl tests. +# +# Copyright (c) 1997 Sun Microsystems, Inc. +# +# See the file "license.terms" for information on usage and redistribution +# of this file, and for a DISCLAIMER OF ALL WARRANTIES. +# +# SCCS: @(#) canvWind.test 1.2 97/11/06 13:49:14 + +if {"[info procs test]" != "test"} { + source defs +} + +foreach i [winfo children .] { + destroy $i +} +wm geometry . {} +raise . + +test canvWind-1.1 {DisplayWinItem, windows off-screen vertically} { + catch {destroy .t} + toplevel .t + canvas .t.c -scrollregion {0 0 1000 800} -width 250 -height 200 -bd 2 \ + -relief sunken -xscrollincrement 1 -yscrollincrement 1 \ + -highlightthickness 1 + pack .t.c -fill both -expand 1 -padx 20 -pady 20 + wm geometry .t +0+0 + set f .t.f + frame $f -width 80 -height 50 -bg red + .t.c create window 300 400 -window $f -anchor nw + .t.c xview moveto .3 + .t.c yview moveto .50 + update + set x [list [list [winfo ismapped $f] [winfo y $f]]] + .t.c yview scroll 52 units + update + lappend x [list [winfo ismapped $f] [winfo y $f]] + .t.c yview scroll 1 units + update + lappend x [list [winfo ismapped $f] [winfo y $f]] + .t.c yview scroll -255 units + update + lappend x [list [winfo ismapped $f] [winfo y $f]] + .t.c yview scroll -1 units + update + lappend x [list [winfo ismapped $f] [winfo y $f]] +} {{1 23} {1 -29} {0 -29} {1 225} {0 225}} +test canvWind-1.2 {DisplayWinItem, windows off-screen vertically} { + catch {destroy .t} + toplevel .t + canvas .t.c -scrollregion {0 0 1000 800} -width 250 -height 200 -bd 2 \ + -relief sunken -xscrollincrement 1 -yscrollincrement 1 \ + -highlightthickness 1 + pack .t.c -fill both -expand 1 -padx 20 -pady 20 + wm geometry .t +0+0 + set f .t.c.f + frame $f -width 80 -height 50 -bg red + .t.c create window 300 400 -window $f -anchor nw + .t.c xview moveto .3 + .t.c yview moveto .50 + update + set x [list [list [winfo ismapped $f] [winfo y $f]]] + .t.c yview scroll 52 units + update + lappend x [list [winfo ismapped $f] [winfo y $f]] + .t.c yview scroll 1 units + update + lappend x [list [winfo ismapped $f] [winfo y $f]] + .t.c yview scroll -255 units + update + lappend x [list [winfo ismapped $f] [winfo y $f]] + .t.c yview scroll -1 units + update + lappend x [list [winfo ismapped $f] [winfo y $f]] +} {{1 3} {1 -49} {0 -49} {1 205} {0 205}} +test canvWind-1.3 {DisplayWinItem, windows off-screen horizontally} { + catch {destroy .t} + toplevel .t + canvas .t.c -scrollregion {0 0 1000 800} -width 250 -height 200 -bd 2 \ + -relief sunken -xscrollincrement 1 -yscrollincrement 1 \ + -highlightthickness 1 + pack .t.c -fill both -expand 1 -padx 20 -pady 20 + wm geometry .t +0+0 + set f .t.f + frame $f -width 80 -height 50 -bg red + .t.c create window 300 400 -window $f -anchor nw + .t.c xview moveto .3 + .t.c yview moveto .50 + update + set x [list [list [winfo ismapped $f] [winfo x $f]]] + .t.c xview scroll 82 units + update + lappend x [list [winfo ismapped $f] [winfo x $f]] + .t.c xview scroll 1 units + update + lappend x [list [winfo ismapped $f] [winfo x $f]] + .t.c xview scroll -335 units + update + lappend x [list [winfo ismapped $f] [winfo x $f]] + .t.c xview scroll -1 units + update + lappend x [list [winfo ismapped $f] [winfo x $f]] +} {{1 23} {1 -59} {0 -59} {1 275} {0 275}} +test canvWind-1.4 {DisplayWinItem, windows off-screen horizontally} { + catch {destroy .t} + toplevel .t + canvas .t.c -scrollregion {0 0 1000 800} -width 250 -height 200 -bd 2 \ + -relief sunken -xscrollincrement 1 -yscrollincrement 1 \ + -highlightthickness 1 + pack .t.c -fill both -expand 1 -padx 20 -pady 20 + wm geometry .t +0+0 + set f .t.c.f + frame $f -width 80 -height 50 -bg red + .t.c create window 300 400 -window $f -anchor nw + .t.c xview moveto .3 + .t.c yview moveto .50 + update + set x [list [list [winfo ismapped $f] [winfo x $f]]] + .t.c xview scroll 82 units + update + lappend x [list [winfo ismapped $f] [winfo x $f]] + .t.c xview scroll 1 units + update + lappend x [list [winfo ismapped $f] [winfo x $f]] + .t.c xview scroll -335 units + update + lappend x [list [winfo ismapped $f] [winfo x $f]] + .t.c xview scroll -1 units + update + lappend x [list [winfo ismapped $f] [winfo x $f]] +} {{1 3} {1 -79} {0 -79} {1 255} {0 255}} |