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
|
# $XConsortium: Text3.scr /main/6 1995/07/17 20:41:51 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
#
# @) A client with a list of functions, a control panel and a Text widget to
# be acted upon should appear.
# #) Select the XmTextGetEditable() function from the Functions List by
# clicking MB1 on it.
# Click on the Call Function PushButton.
# The current editing status of the Action Text widget will be shown in
# the Status/Input widget. The status will be True. Confirm this by clicking
# MB1 in the Action text and deleting a few characters.
WindowRaise Shell1
LocatePointer List1 RListItem 0
ClickMB Btn1
LocatePointer ApplyB
ClickMB Btn1
CompareVisual Text1
LocatePointer Text1 RTextChar 10
ClickMB Btn1
ClickKey KBackSpace
ClickKey KBackSpace
CompareVisual Text1
# #) Select the XmTextSetEditable() function. Set the True/False Arg
# ToggleButton to False. Click on the Call Function PushButton.
# The Action Text widget's editable property will be toggled to False.
# Select XmTextGetEditable() function and click the Call Function PushButton
# again. It should now show a value of False in the Status/Input widget.
# Also, now try deleting some characters from the Action Text widget.
LocatePointer List1 RListItem 1
ClickMB Btn1
LocatePointer ToggleB
ClickMB Btn1
LocatePointer ApplyB
ClickMB Btn1
CompareVisual Text1
LocatePointer List1 RListItem 0
ClickMB Btn1
LocatePointer ApplyB
ClickMB Btn1
CompareVisual Text1
LocatePointer Text1 RTextChar 10
ClickMB Btn1
ClickKey KBackSpace
ClickKey KBackSpace
CompareVisual Text1
# #) Make the Action Text widget editable again by selecting
# XmTextSetEditable, setting the True/False Arg to True and clicking on
# Call Function.
LocatePointer List1 RListItem 1
ClickMB Btn1
LocatePointer ToggleB
ClickMB Btn1
LocatePointer ApplyB
ClickMB Btn1
CompareVisual Text1
# C)
Continue
# #) Select the XmTextGetMaxLength() function and call it.
# The value 27 will be reported in the Status widget.
WindowRaise Shell1
LocatePointer List1 RListItem 0
ClickMB Btn1
LocatePointer ApplyB
ClickMB Btn1
CompareVisual Text1
# #) Select the XmTextSetMaxLength() function from the list.
# Set the Numerical Arg 1 Scale to 30. Click the Call Function PushButton.
# Now select the XmTextGetMaxLength() function. The Status widget should
# read 30.
# You should be able to add text to the Action
# Text widget until it's length is 30.
LocatePointer List1 RListItem 1
ClickMB Btn1
LocatePointer Scale1 RScaleSlider
DragSliderValue Right 30
LocatePointer ApplyB
ClickMB Btn1
CompareVisual Text1
LocatePointer List1 RListItem 0
ClickMB Btn1
LocatePointer ApplyB
ClickMB Btn1
CompareVisual Text1
LocatePointer Text1 RTextChar 20
ClickMB Btn1
InputString "New text"
CompareVisual Text1
# #) Select the XmTextGetLastPosition() function and call it. It should
# read 30. Now delete a few characters from the Action Text and click Call
# Function again. It will now read a few less than 30.
LocatePointer List1 RListItem 2
ClickMB Btn1
LocatePointer ApplyB
ClickMB Btn1
CompareVisual Text1
LocatePointer Text1 RTextChar 10
ClickMB Btn1
ClickKey KBackSpace
ClickKey KBackSpace
CompareVisual Text1
LocatePointer ApplyB
ClickMB Btn1
CompareVisual Text1
# C)
Continue
#
# #) Select XmTextSetInsertionPosition() from the Functions List. Set the
# Numerical Arg 1 Scale to 3. Click the Call Function PushButton. The
# caret cursor in the Action Text should move between the 'i' and 's' in
# 'This' (assuming that part of the text is still intact).
WindowRaise Shell1
LocatePointer List1 RListItem 0
ClickMB Btn1
LocatePointer Scale1 RScaleSlider
DragSliderValue Left 3
LocatePointer ApplyB
ClickMB Btn1
CompareVisual Text1
# C)
Continue
# #) Select and call the XmTextGetBaseline() function. It should read
# something near 20 depending on the metrics of the 'variable' font in use.
WindowRaise Shell1
LocatePointer List1 RListItem 0
ClickMB Btn1
LocatePointer ApplyB
ClickMB Btn1
CompareVisual Text1
# #) Select the XmTextXYToPos() function. Set the Num Arg 1 Scale to 14
# and the Num Arg 2 Scale to 18. Click the Call Function PushButton.
# The Status/Input widget should read "Position = 1". (The Num Arg 1
# corresponds to the x argument and Num Arg 2 to the y argument.)
LocatePointer List1 RListItem 1
ClickMB Btn1
LocatePointer Scale1 RScaleSlider
DragSliderValue Right 14
LocatePointer Scale2 RScaleSlider
DragSliderValue Right 18
LocatePointer ApplyB
ClickMB Btn1
CompareVisual Text1
# #) Set the Num Arg 2 Scale to a number about 4 larger than the value
# returned by the earlier call to XmTextGetBaseline() (i.e. 24-26).
# Click Call Function. The Status widget should read the last position
# in the string. Verify this by scrolling up the Functions List and calling
# XmTextGetLastPosition() again.
LocatePointer Scale2 RScaleSlider
DragSliderValue Right 25
LocatePointer ApplyB
ClickMB Btn1
CompareVisual Text1
LocatePointer List1 RVertScrollBarUpArrow
ClickMB Btn1
ClickMB Btn1
ClickMB Btn1
LocatePointer List1 RListItem 0
ClickMB Btn1
LocatePointer ApplyB
ClickMB Btn1
CompareVisual Text1
LocatePointer List1 RVertScrollBarDownArrow
ClickMB Btn1
ClickMB Btn1
ClickMB Btn1
# #) Select the XmTextPosToXY() function and set the Num Arg 1 Scale to 2.
# Click the Call Function PushButton. The Status widget should read something
# like "x = 24, y = 20" (this will vary depending on the font metrics and what
# the second character in the Action Text widget is).
LocatePointer List1 RListItem 2
ClickMB Btn1
LocatePointer Scale1 RScaleSlider
DragSliderValue Left 2
LocatePointer ApplyB
ClickMB Btn1
CompareVisual Text1
# C)
Continue
# #) Select and call the XmTextGetTopCharacter() function.
# The value returned in the Status widget should be 0.
WindowRaise Shell1
LocatePointer List1 RListItem 0
ClickMB Btn1
LocatePointer ApplyB
ClickMB Btn1
CompareVisual Text1
# #) Select the XmTextSetTopCharacter() function. Set the Num Arg 1 Scale
# to 6. Click the Call Function PushButton. The text in the Action Text
# widget should shift such that the first visible character on the left
# is the seventh character in the string (origin of 0).
LocatePointer List1 RListItem 1
ClickMB Btn1
LocatePointer Scale1 RScaleSlider
DragSliderValue Right 6
LocatePointer ApplyB
ClickMB Btn1
CompareVisual Text1
# #) Set the Num Arg 1 Scale back to 0 and click Call Function again. The
# Action Text widget should return to it's original appearance.
LocatePointer Scale1 RScaleSlider
DragSliderValue Left 0
LocatePointer ApplyB
ClickMB Btn1
CompareVisual Text1
# E)
Exit
|