1 |
578 |
markom |
# This file creates a visual test for bevels drawn around text in text
|
2 |
|
|
# widgets. It is part of the Tk visual test suite, which is invoked
|
3 |
|
|
# via the "visual" script.
|
4 |
|
|
#
|
5 |
|
|
# RCS: @(#) $Id: bevel.tcl,v 1.1.1.1 2002-01-16 10:25:58 markom Exp $
|
6 |
|
|
|
7 |
|
|
catch {destroy .t}
|
8 |
|
|
toplevel .t
|
9 |
|
|
wm title .t "Visual Tests for Borders in Text Widgets"
|
10 |
|
|
wm iconname .t "Text Borders"
|
11 |
|
|
wm geom .t +0+0
|
12 |
|
|
|
13 |
|
|
text .t.t -width 60 -height 30 -setgrid true -xscrollcommand {.t.h set} \
|
14 |
|
|
-font {Courier 12} \
|
15 |
|
|
-yscrollcommand {.t.v set} -wrap none -relief raised -bd 2
|
16 |
|
|
scrollbar .t.v -orient vertical -command ".t.t yview"
|
17 |
|
|
scrollbar .t.h -orient horizontal -command ".t.t xview"
|
18 |
|
|
button .t.quit -text Quit -command {destroy .t}
|
19 |
|
|
pack .t.quit -side bottom -pady 3 -ipadx 4 -ipady 2
|
20 |
|
|
pack .t.h -side bottom -fill x
|
21 |
|
|
pack .t.v -side right -fill y
|
22 |
|
|
pack .t.t -expand yes -fill both
|
23 |
|
|
wm minsize .t 1 1
|
24 |
|
|
|
25 |
|
|
if {[winfo depth .t] > 1} {
|
26 |
|
|
.t.t tag configure r1 -relief raised -borderwidth 2 -background #b2dfee
|
27 |
|
|
.t.t tag configure r2 -relief raised -borderwidth 2 -background #b2dfee \
|
28 |
|
|
-offset 2
|
29 |
|
|
.t.t tag configure s1 -relief sunken -borderwidth 2 -background #b2dfee
|
30 |
|
|
} else {
|
31 |
|
|
.t.t tag configure r1 -relief raised -borderwidth 2 -background white
|
32 |
|
|
.t.t tag configure r2 -relief raised -borderwidth 2 -background white \
|
33 |
|
|
-offset 2
|
34 |
|
|
.t.t tag configure s1 -relief sunken -borderwidth 2 -background white
|
35 |
|
|
}
|
36 |
|
|
.t.t tag configure indent1 -lmargin1 100
|
37 |
|
|
.t.t tag configure indent2 -lmargin1 200
|
38 |
|
|
|
39 |
|
|
.t.t insert end {This display contains a bunch of raised and sunken
|
40 |
|
|
regions to exercise the bevel-drawing facilities of
|
41 |
|
|
DisplayLineBackground. The letters have the following
|
42 |
|
|
significance:
|
43 |
|
|
|
44 |
|
|
r - should appear raised
|
45 |
|
|
u - should appear raised and also slightly offset vertically
|
46 |
|
|
s - should appear sunken
|
47 |
|
|
n - preceding relief should extend right to end of line.
|
48 |
|
|
* - should appear "normal"
|
49 |
|
|
x - extra long lines to allow horizontal scrolling.
|
50 |
|
|
|
51 |
|
|
Try scrolling the text both vertically and horizontally to
|
52 |
|
|
be sure that the bevels are still drawn correctly.
|
53 |
|
|
|
54 |
|
|
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
55 |
|
|
|
56 |
|
|
Pass 1 (side bevels):
|
57 |
|
|
|
58 |
|
|
}
|
59 |
|
|
.t.t insert end ****
|
60 |
|
|
.t.t insert end rrrrrrr r1
|
61 |
|
|
.t.t insert end uuuu r2
|
62 |
|
|
.t.t insert end ************
|
63 |
|
|
.t.t insert end ssssssssssssssssss s1
|
64 |
|
|
.t.t insert end \n\n****************
|
65 |
|
|
.t.t insert end rrrrrrrrrrrrrrn\n r1
|
66 |
|
|
|
67 |
|
|
.t.t insert end "\nPass 2 (top bevels):\n\n"
|
68 |
|
|
.t.t insert end rrrrrrrrrrrrrr r1
|
69 |
|
|
.t.t insert end rrrrr {r1 dummy}
|
70 |
|
|
.t.t insert end rrrrrrrrrrrrrrrrrrr r1
|
71 |
|
|
.t.t insert end \n************
|
72 |
|
|
.t.t insert end rrrrrrrrrrrrrrrrr r1
|
73 |
|
|
.t.t insert end ***********\n
|
74 |
|
|
.t.t insert end rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr r1
|
75 |
|
|
.t.t insert end \n\n***
|
76 |
|
|
.t.t insert end rrrrrrrrrrrrrrrrrrr r1
|
77 |
|
|
.t.t insert end ***********\n*
|
78 |
|
|
.t.t insert end rrrrrrrrr r1
|
79 |
|
|
.t.t insert end ********
|
80 |
|
|
.t.t insert end rrrrrrrrrrrrrrrrrrrrrrrrr r1
|
81 |
|
|
.t.t insert end \n\n*
|
82 |
|
|
.t.t insert end *** dummy
|
83 |
|
|
.t.t insert end rrrrrrrrrrrrrrrrrrrrrrrrr r1
|
84 |
|
|
.t.t insert end n\nrrrrrrrrrrrrrrr {r1 indent1}
|
85 |
|
|
.t.t insert end \n\n***
|
86 |
|
|
.t.t insert end rrr r1
|
87 |
|
|
.t.t insert end \n
|
88 |
|
|
.t.t insert end rrrr {r1 indent1}
|
89 |
|
|
|
90 |
|
|
.t.t insert end \n\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n\n
|
91 |
|
|
.t.t insert end "Pass 3 (bottom bevels):\n\n"
|
92 |
|
|
.t.t insert end *******
|
93 |
|
|
.t.t insert end ********** dummy
|
94 |
|
|
.t.t insert end rrrrrrrrrrrrrrrr r1
|
95 |
|
|
.t.t insert end **********\n
|
96 |
|
|
.t.t insert end rrrrrrrrr r1
|
97 |
|
|
.t.t insert end uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu r2
|
98 |
|
|
.t.t insert end \n********************
|
99 |
|
|
.t.t insert end rrrrrrrrrrrrrrr r1
|
100 |
|
|
.t.t insert end ************\n\n*
|
101 |
|
|
.t.t insert end rrrrrrrrrrrr r1
|
102 |
|
|
.t.t insert end ********
|
103 |
|
|
.t.t insert end rrrrrrrrrrrrrrrrrrrrrrrrr r1
|
104 |
|
|
.t.t insert end \n*****
|
105 |
|
|
.t.t insert end rrrrrrrrrrrrrrrrrrrr r1
|
106 |
|
|
.t.t insert end **********\n\n
|
107 |
|
|
.t.t insert end rrrrrrrrrrrrrrr {r1 indent1}
|
108 |
|
|
.t.t insert end \n** dummy
|
109 |
|
|
.t.t insert end **
|
110 |
|
|
.t.t insert end rrrrrrrrrrrrrrrrrrrrn\n r1
|
111 |
|
|
.t.t insert end \n
|
112 |
|
|
.t.t insert end rrrr {r1 indent1}
|
113 |
|
|
.t.t insert end \n***
|
114 |
|
|
.t.t insert end rrr r1
|
115 |
|
|
|
116 |
|
|
.t.t insert end \n\nMiscellaneous:\n\n
|
117 |
|
|
.t.t insert end rrr r1
|
118 |
|
|
.t.t insert end *****
|
119 |
|
|
.t.t insert end rrr r1
|
120 |
|
|
foreach i {1 2 3} {
|
121 |
|
|
.t.t insert end \n
|
122 |
|
|
.t.t insert end ***
|
123 |
|
|
.t.t insert end rrrrr r1
|
124 |
|
|
}
|
125 |
|
|
.t.t insert end \n
|
126 |
|
|
.t.t insert end rrr r1
|
127 |
|
|
.t.t insert end *****
|
128 |
|
|
.t.t insert end rrr r1
|