File: Text9.scr

package info (click to toggle)
motif 2.3.4-13
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 81,160 kB
  • ctags: 51,769
  • sloc: ansic: 596,938; cpp: 3,951; yacc: 2,854; makefile: 2,070; csh: 1,199; sh: 1,070; lex: 455
file content (387 lines) | stat: -rw-r--r-- 12,147 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
# $XConsortium: Text9.scr /main/6 1995/07/17 20:42:26 drk $
# 
# Motif
#
# Copyright (c) 1987-2012, The Open Group. All rights reserved.
#
# These libraries and programs are free software; you can
# redistribute them and/or modify them under the terms of the GNU
# Lesser General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# These libraries and programs are distributed in the hope that
# they will be useful, but WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU Lesser General Public License for more
# details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with these librararies and programs; if not, write
# to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
# Floor, Boston, MA 02110-1301 USA
# 
# 
# HISTORY
# 

#  @) The left side of this test contains a MultiLine Text widget and
#     the right, a SingleLine Text widget.  Each set of widgets
#     below the text widgets pertain to the text widget above them.
#     Do all the first tests on the MultiLine Text widget.
#  #) The MultiLine Text widget should have \"His wife could...
#     on the top line in the window.  Grab the vertical scrollbar
#     and slide it up so the first line is displayed reading \"Jack
#     Sprat could...\".
LocatePointer Text1 RVertScrollBarSlider
DragSliderValue Up Min
CompareVisual Text1

#  #) Click MB1 right before the word \"Sprat\" in the MultiLine
#     Text widget.  The I-beam cursor should now be at that position.
LocatePointer Text1 RTextChar 5
ClickMB Btn1
CompareVisual Text1

#  #) Try inserting new text into the widget by typing \"NEW\".
#     You should just hear the bell beep 3 times, but no text will
#     be inserted.
InputString "NEW"
CompareVisual Text1

#  #) Now click MB1 on the \"verifyBell\" togglebutton.  Click in
#     the text widget at the same position and try typing \"NEW\" again.
#     There should be NO bell, and still no text inserted.
LocatePointer veriTB1
ClickMB Btn1
LocatePointer Text1 RTextChar 5
ClickMB Btn1
InputString "NEW"
CompareVisual Text1

#  #) Now click MB1 on the \"doit flag\" togglebutton.  Click in the
#     text widget and try typing again.  It should work this time.  Note
#     that the \"text length\" should increase as you insert characters
#     into the text widget.
LocatePointer doitTB1
ClickMB Btn1
LocatePointer Text1 RTextChar 5
ClickMB Btn1
InputString "NEW"
CompareVisual Text1

#  C)
Continue

#  #) Drag the \"top character\" slider to the right until it reads 35.
#     The MultiLine text widget should now have the second line of text at
#     the top of the window (starts with \"His wife could..\").
LocatePointer topScale1 RScaleSlider
DragSliderValue Right 35
CompareVisual Text1

#  #) Drag the \"cursor position\" slider out to 12.  The widget should
#     shift so that the first line is again at the top and the caret
#     cursor is before the eighth position (just before the \'t\' in \"Sprat\").
LocatePointer cursScale1 RScaleSlider
DragSliderValue Right 12
CompareVisual Text1

#  #) Now drag the \"top character\" to 43.  The second line of text should
#     again be the top line in the window and there should be no cursor
#     visible at all.
LocatePointer topScale1 RScaleSlider
DragSliderValue Right  43
CompareVisual Text1

#  #) Click MB1 on the \"show position\" pushbutton.  The window should
#     change to have the first text line visible again.  If you press <Tab>,
#     the highlight will move to the MultiLine Text widget and the I-beam cursor
#     will again be showing before the t in \"Sprat\".
LocatePointer showPosPB1
ClickMB Btn1
ClickKey KTab
CompareVisual Text1

#  C)
Continue

#  #) Click MB1 on the \"6x12\" button in the radio box.  The text widget
#     font should shrink and its window should size itself accordingly.
#     Also, the \"text baseline\" should now read 17.
LocatePointer RB1_6x12
ClickMB Btn1
CompareVisual Text1

#  #) Click MB1 on the \"9x15\" button.  The text widget font should change
#     again and its window will grow.  The \"text baseline\" should now
#     read 21.
LocatePointer RB1_9x15
ClickMB Btn1
CompareVisual Text1

#  #) Click MB1 on the \"8x13\" button.  The text widget font should return
#     to its initial size, and the window should also resize.
LocatePointer RB1_8x13
ClickMB Btn1
CompareVisual Text1

#  C)
Continue

# @) Test whether the setting of top character works
#    correctly when word wrap is on.
# #) Some text is displayed with word wrap off. Scroll text widget vertically
#    to verify that the text runs horizontally outside of the window.
# #) Select the word wrap toggle.  All text should now fit within
#    the vertical bounds of the text widget.
#    There are actually three logical lines of text. The first two lines
#    of text end with a newline character.  The third line of text does not.
#    When word wrap is set, the third logical line of text is displayed as
#    nine lines of physical text.
LocatePointer wordWrap
ClickMB Btn1

# #) Drag the \"top character\" slider to the right until it reads 38.
#    The beginning of the third logical line should be displayed at
#    the top of the window.  It reads "This line of text".
LocatePointer topScale1 RScaleSlider
DragSliderValue Right  38
CompareVisual Text3

# #) Drag the \"top character\" slider to the right until it reads 56.
#    The text "does not end with a" should be displayed at the top of
#    the window.
LocatePointer topScale1 RScaleSlider
DragSliderValue Right  56
CompareVisual Text3

# C)
Continue

#  @) Now do all of the tests again on the SingleLine Text widget.
#  #) The SingleLine Text widget should have \"s wife could eat no\" 
#     displayed in the window.
#  #) Click MB1 right before the word \"could\" in the SingleLine
#     Text widget.  The I-beam cursor should now be at that position.
WindowRaise Shell1
LocatePointer Text2 RTextChar 36
ClickMB Btn1
CompareVisual Text2

#  #) Try inserting new text into the widget by typing \"NEW\".
#     You should not hear any bell and no text should be inserted.
InputString "NEW"
CompareVisual Text2

#  #) Now click MB1 on the \"verifyBell\" togglebutton.  Click at the
#     same position in the text widget and try typing \"NEW\" again.
#     There should now be three bells, and still no text inserted.
LocatePointer veriTB2
ClickMB Btn1
LocatePointer Text2 RTextChar 36
ClickMB Btn1
InputString "NEW"
CompareVisual Text2

#  #) Now click MB1 on the \"doit flag\" togglebutton.  Try typing
#     into the text widget again.  It should work this time.  Note
#     that the \"text length\" should increase as you insert characters
#     into the text widget.
LocatePointer doitTB2
ClickMB Btn1
LocatePointer Text2 RTextChar 36
ClickMB Btn1
InputString "NEW"
CompareVisual Text2

#  C)
Continue

#  #) Drag the \"top character\" slider to the right until it reads 35.
#     The SingleLine text widget should now have shifted the text in
#     the window (should read \"e NEWcould eat no le\").
WindowRaise Shell1
LocatePointer topScale2 RScaleSlider
DragSliderValue Right 35
CompareVisual Text2

#  #) Drag the \"cursor position\" slider out to 5.  The widget should
#     shift so that the first line is again in the window and the caret
#     cursor is before the fifth position (just before \"Sprat\").
LocatePointer cursScale2 RScaleSlider
DragSliderValue Right 5
CompareVisual Text2

#  #) Now drag the \"top character\" to 43.  Part of the second line of text
#     should again be in the window and there should be no cursor visible at
#     all.
LocatePointer topScale2 RScaleSlider
DragSliderValue Right 43
CompareVisual Text2

#  #) Click MB1 on the \"show position\" pushbutton.  The window should
#     change to have the first text line visible again with the caret cursor
#     showing before the word \"Sprat\".
LocatePointer showPosPB2
ClickMB Btn1
CompareVisual Text2

#  C)
Continue

#  #) Click MB1 on the \"6x12\" button in the radio box.  The text widget
#     font should shrink and the window should size itself accordingly.
#     Also, the \"text baseline\" should now read 17.
WindowRaise Shell1
LocatePointer RB2_6x12
ClickMB Btn1
CompareVisual Text2

#  #) Click MB1 on the \"9x15\" button.  The text widget font should change
#     again and the window should grow.  The \"text baseline\" should now
#     read 21.
LocatePointer RB2_9x15
ClickMB Btn1
CompareVisual Text2

#  #) Click MB1 on the \"8x13\" button.  The text widget font should return
#     to its initial size, and the window should also resize.
LocatePointer RB2_8x13
ClickMB Btn1
CompareVisual Text2

#  C)
Continue

#  @) You can change the range of text which is selected by a double click
#     by changing the selection in the \"Double Click Selects...\" option
#     menu. When you make a new selection, both text widgets will be altered.
#  #) Try each selection in the option menu and confirm that a double click
#     selects the correct amount of text in both widgets.
#  !) 
#          Position    means double click just sets the
#                      cursor and nothing is selected.
LocatePointer selectionOption1 ROptionButton
PressMB Btn1
LocatePointer Position
ReleaseMB Btn1
LocatePointer Text3 RVertScrollBarSlider
DragSliderValue Up Min
LocatePointer Text3 RTextChar 38
ClickMB Btn1
CompareVisual Text3
System sleep 1
ClickMB Btn1 2
CompareVisual Text3

#          Word        selects a word. 
LocatePointer selectionOption1 ROptionButton
PressMB Btn1
LocatePointer Word
ReleaseMB Btn1
LocatePointer Text3 RTextChar 38
ClickMB Btn1
CompareVisual Text3
System sleep 1
ClickMB Btn1 2
CompareVisual Text3

#          Line        selects one line of text source.
#                   ( When wordWrap is ON, one line of text
#                     source may be displayed as multiple
#                     output lines.
#                     Each of the output lines which
#                     correspond to one source line
#                     will be selected. )
 
LocatePointer selectionOption1 ROptionButton
PressMB Btn1
LocatePointer Line
ReleaseMB Btn1
LocatePointer Text3 RTextChar 38
ClickMB Btn1
CompareVisual Text3
System sleep 1
ClickMB Btn1 2
CompareVisual Text3

#          All         means the entire contents is selected.
## insert returns to make a new paragraph
LocatePointer Text3 RTextChar 18
ClickMB Btn1
ClickKey KReturn
ClickKey KReturn
InputString "new line"
LocatePointer selectionOption1 ROptionButton
PressMB Btn1
LocatePointer All
ReleaseMB Btn1
LocatePointer Text3 RTextChar 38
ClickMB Btn1
CompareVisual Text3
System sleep 1
ClickMB Btn1 2
CompareVisual Text3

# C)
Continue

# The following testcase checks the amount of indentation which
# results after inserting a tab into a Text widget. Before inserting
# tabs, verify that the wordWrap toggle is selected.

# ClickMB1 at the beginning of the Scrolled Text widget. Click KTab.
# Verify that the text is indented by eight columns. The first character
# on the first line of text should align to the right of the first
# occurance of the number "8" on the second line of text.

LocatePointer Text3 RTextChar 0
ClickMB Btn1
ClickKey KTab
CompareVisual Text3

# Click KTab again. The text should indent by another eight columns.
# The first character on the first line of text should align to the
# right of the second occurance of the number "8" on the second
# line of text.

ClickKey KTab
CompareVisual Text3

# Click KTab once again.  Since wordWrap is on, and the first word is
# too long to fit on the first line after the indentation, the
# text moves to the next line in the Text widget.

ClickKey KTab
CompareVisual Text3

# Click KTab seven more times. Verify that upto 10 tabs can be inserted
# into the Text widget.

ClickKey KTab
CompareVisual Text3

ClickKey KTab
CompareVisual Text3

ClickKey KTab
CompareVisual Text3

ClickKey KTab
CompareVisual Text3

ClickKey KTab
CompareVisual Text3

ClickKey KTab
CompareVisual Text3

ClickKey KTab
CompareVisual Text3

# C)
Continue

#  E)
Exit