Blob Blame History Raw
# $XConsortium: Text1.scr /main/6 1995/07/17 20:41:14 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 text widget's contents read "Some Text."  If Adobe fonts are
#   installed on your system, then the text widget
#   will use the Adobe courier 14 font.
#   Otherwise the default font will be used.
#   #) Select a few letters in the middle of the text by dragging
#      MB1.  Now, cut the selection using by pressing the osfCut key.
#      The remaining text should be free of any garbage pixels in 
#      the area where the selection was.
LocatePointer Text1 RTextChar 1
DragComponent Text1 RTextChar 5 Btn1
ClickKey KCut
CompareVisual Text1

#   C)
Continue

#   #) Move the pointer into the client window after the text already
#      present and click MB1.  Next, type Return and the following:
#   !)
#         Humpty Dumpty sat on a wall.<CR>
#         Humpty Dumpty had a great fall.<CR>
LocatePointer Text1 RTextChar Max
ClickMB Btn1
ClickKey KReturn
InputString "Humpty Dumpty sat on a wall.\nHumpty Dumpty had a great fall.\n"

#   #) Type the next line, and note that after the horizontal scrollbar
#      slider reaches the right side of its trough, it becomes smaller
#      with each additional keystroke:
#   !)
#         All the king's horses and all the king's men.
InputString "All the king's horses and all the king's men."
CompareVisual Text1

#   #) Again, move the pointer into the client window after the last
#      sentence you just typed and type Return.  Note that the vertical
#      scrollbar slider gets smaller.
LocatePointer Text1 RTextChar Max
ClickMB Btn1
ClickKey KReturn
CompareVisual Text1

#   C)
Continue

#   #) Move the vertical scrollbar's slider all the way up to the top.
LocatePointer Text1 RVertScrollBarSlider
DragSliderValue Up Min

#   #) Resize the window much larger.  The scrollbar sliders should fill
#      the troughs again.
WindowResize Shell1 SouthEast 450 150
CompareVisual Text1

#   #) Move the cursor into the client window and verify that the I-beam is
#      visible in the newly exposed text areas.
LocatePointer Text1 RTextChar Max
CompareVisual Text1

#   C)
Continue

#   #) Try the following MB1 multiple-click tests,
#      and verify the selections:
#   !)
#         Single click -- places insertion cursor.
WindowRaise Shell1
LocatePointer Text1 RTextChar 50
ClickMB Btn1
CompareVisual Text1
Wait 1

#         Double click -- selects word.
ClickMB Btn1 2
CompareVisual Text1
Wait 1

#         Triple click -- selects line.
ClickMB Btn1 3
CompareVisual Text1
Wait 1

#         Quadruple click -- selects all the text.
ClickMB Btn1 4
CompareVisual Text1

# C)
Continue

# 
# @) The following test is concerned about using MCtrlKUp and MCtrlKDown
# to move the cursor back and forth between paragraphs, which was
# reported as a bug (# 3145).
# !)
# #) Move the cursor to the end of the line. Enlarge the window in order
#    to see ten or more lines. Type the following lines, typing a space
#    where the instructions indicate \"_\".
LocatePointer Text1 RTextChar Max 
ClickMB Btn1
InputString "\n\na\n\n x \nb"

# #) With the cursor located after the letter \"b\", press <Ctrl> KUp.
#    The cursor should move to the position before the letter \"x\".
ClickKey <Ctrl>KUp
CompareVisual Text1

#   Press <Ctrl> KUp again. The cursor should now be located
#   before the letter \"a\".
ClickKey <Ctrl>KUp
CompareVisual Text1

#   Pressing <Ctrl> KDown should move the cursor back in front of
#   the letter \"x\".
ClickKey <Ctrl>KDown
CompareVisual Text1

#   Pressing <Ctrl> KDown again should move the cursor after the
#   letter \"b\".
ClickKey <Ctrl>KDown
CompareVisual Text1

# C)
Continue

# @) The following two panels are a test case for CR 5166.
# #) The text widget should now have two lines of text displayed.
# Move the vertical scrollbar down to the bottom of the trough.
LocatePointer Text1 RVertScrollBarSlider
DragSliderValue Down Max

# C)
Continue

#) The text \"Spider Lives!" should now be displayed.
CompareVisual Text1

# C)
Continue

# E)
Exit