OSDN Git Service

touched all tk files to ease next import
[pf3gnuchains/pf3gnuchains4x.git] / tk / tests / canvText.test
index b9d2afe..884a842 100644 (file)
@@ -3,14 +3,13 @@
 # fashion for Tcl tests.
 #
 # Copyright (c) 1996-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.
+# Copyright (c) 1998-1999 by Scriptics Corporation.
+# All rights reserved.
 #
 # RCS: @(#) $Id$
 
-if {"[info procs test]" != "test"} {
-    source defs
+if {[lsearch [namespace children] ::tcltest] == -1} {
+    source [file join [pwd] [file dirname [info script]] defs.tcl]
 }
 
 foreach i [winfo children .] {
@@ -106,7 +105,7 @@ test canvText-3.4 {TextCoords procedure} {
 } {10.0 10.0}
 test canvText-3.5 {TextCoords procedure} {
     list [catch {.c coords test 10} msg] $msg
-} {1 {wrong # coordinates: expected 0 or 2, got 1}}
+} {1 {wrong # coordinates: expected 2, got 1}}
 test canvText-3.6 {TextCoords procedure} {
     list [catch {.c coords test 10 10 10} msg] $msg
 } {1 {wrong # coordinates: expected 0 or 2, got 3}}
@@ -174,7 +173,7 @@ test canvText-5.1 {ConfigureText procedure: adjust cursor} {
     .c delete x
 } {}
 
-test canvText-6.1 {ComputeTextBbox procedure} {fonts} {
+test canvText-6.1 {ComputeTextBbox procedure} {fonts nonPortable} {
     .c itemconfig test -font $font -text 0
     .c coords test 0 0
     set x {}
@@ -200,7 +199,7 @@ test canvText-6.1 {ComputeTextBbox procedure} {fonts} {
 focus .c
 .c focus test
 .c itemconfig test -text "abcd\nefghi\njklmnopq"
-test canvText-7.1 {DisplayText procedure: stippling} {
+test canvText-7.0 {DisplayText procedure: stippling} {
     .c itemconfig test -stipple gray50
     update
     .c itemconfig test -stipple {}
@@ -241,6 +240,20 @@ test canvText-7.8 {DisplayText procedure: not selected} {
     .c select clear
     update
 } {}
+test canvText-7.9 {DisplayText procedure: select end} {
+    catch {destroy .t}
+    toplevel .t
+    wm geometry .t +0+0
+    canvas .t.c
+    pack .t.c
+    set id [.t.c create text 0 0 -text Dummy -anchor nw]
+    update
+    .t.c select from $id 0
+    .t.c select to $id end
+    update
+    #catch {destroy .t}
+    update
+} {}
 
 test canvText-8.1 {TextInsert procedure: 0 length insert} {
     .c insert test end {}
@@ -491,3 +504,34 @@ restore showpage
 end
 %%EOF
 "
+
+test canvText-18.1 {bug fix 2525, find enclosed on text with newlines} {
+    catch {destroy .c}
+    canvas .c
+    pack .c
+    .c delete all
+    .c create text 100 100 -text Hello\n -anchor nw
+    set bbox [.c bbox 1]
+    set x2 [lindex $bbox 2]
+    set y2 [lindex $bbox 3]
+    incr y2
+    update
+    .c find enclosed 99 99 [expr $x2 + $i] [expr $y2 + 1]
+} 1
+
+# cleanup
+::tcltest::cleanupTests
+return
+
+
+
+
+
+
+
+
+
+
+
+
+