1# 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$
6
7catch {destroy .t}
8toplevel .t
9wm title .t "Visual Tests for Borders in Text Widgets"
10wm iconname .t "Text Borders"
11wm geom .t +0+0
12
13text .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
16scrollbar .t.v -orient vertical -command ".t.t yview"
17scrollbar .t.h -orient horizontal -command ".t.t xview"
18button .t.quit -text Quit -command {destroy .t}
19pack .t.quit -side bottom -pady 3 -ipadx 4 -ipady 2
20pack .t.h -side bottom -fill x
21pack .t.v -side right -fill y
22pack .t.t -expand yes -fill both
23wm minsize .t 1 1
24
25if {[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
40regions to exercise the bevel-drawing facilities of
41DisplayLineBackground.  The letters have the following
42significance:
43
44r - should appear raised
45u - should appear raised and also slightly offset vertically
46s - should appear sunken
47n - preceding relief should extend right to end of line.
48* - should appear "normal"
49x - extra long lines to allow horizontal scrolling.
50
51Try scrolling the text both vertically and horizontally to
52be sure that the bevels are still drawn correctly.
53
54xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
55
56Pass 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
120foreach 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142