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
|
# $XConsortium: TextField2.scr /main/5 1995/07/17 20:42: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
#
# @) This test uses a MultiLine Text widget and a TextField widget to test
# various TextField widget functions. Almost all of the functions to
# test can be found on a popup menu accessible by pressing MB3 in either
# widget.
# @) In the stdout window, there should now be several messages about
# TextPositions and XY locations of various characters. Verify that they
# all are correct.
# @) The TextField widget should have a string starting at character
# position 3 reading \"**THIS TEXT INSERTED**\" that was inserted into
# the original source after the widget was created.
CompareVisual Text2
# #) Whenever a primary selection of any kind is made in either widget, a
# callback is called that prints a message saying that it gained or lost the
# primary selection ownership. Verify that these come out in the stdout
# window.
# #) Whenever a selection is made in either widget and a function is chosen
# off the popup menu, the selection's left and right character positions
# are displayed in the stdout window. If the widget does not own the Primary
# selection or can not perform the operation for some reason, a message to
# that affect will be printed in the stdout window.
LocatePointer Text1 RTextChar 5
DragComponent Text1 RTextChar 10 Btn1
LocatePointer Text2 RTextChar 5
DragComponent Text2 RTextChar 10 Btn1
# C)
Continue
# #) The following functions are found on the popup menus. Each one should be
# tested in both widgets and between the widgets where appropriate:
# !)
# Cut - cuts primary selection to clipboard
# Copy - copies primary selection to clipboard
# Paste - pastes from clipboard to current
# cursor location
# Remove - deletes primary selection
# HiLi Normal - highlights 5 characters left of
# cursor location in normal mode (no
# highlight)
# HiLi Selected - highlights 5 characters left of
# cursor in selected mode (reverse
# video)
# HiLi Secondary - highlights 5 characters left of
# cursor in secondary selected mode
# (underlined)
# Toggle AddMode - toggles AddMode on and off
# (I-beam should be stippled)
# Set String NULL - sets the text's string to \"\"
# Get String - gets the current text string and
# prints to stdout window
# Set String Orig - sets the text's string back to what
# it was instantiated with
# SetValue String - sets the text's string to
# \"new_string\", try after making a
# long primary selection (uses XtSetValues)
#
# On the TextField widget only:
# Show Pos 3 - adjusts the text string position so
# that character at position 3 is
# visible
## ** Text1 tests ** ##
## test Cut/Paste in Text1
#**
#** No need to test Texgt1 -> Text1 cut/copy/paste here,
#** it's done already this same way in ScrollText2.
#**
## test set string NULL in Text1
LocatePointer Text1
PressMB Btn3
LocatePointer Set_String_NULL1
ReleaseMB Btn3
CompareVisual Text1
## test get string in Text1
LocatePointer Text1
PressMB Btn3
LocatePointer Get_String1
ReleaseMB Btn3
CompareVisual Text1
## test setvalue string in Text1
LocatePointer Text1
PressMB Btn3
LocatePointer SetValue_String1
ReleaseMB Btn3
CompareVisual Text1
## test set string orig in Text1
LocatePointer Text1
PressMB Btn3
LocatePointer Set_String_Orig1
ReleaseMB Btn3
CompareVisual Text1
## ** Text2 tests ** ##
## test Cut/Paste in Text2
LocatePointer Text2 RTextChar 5
DragComponent Text2 RTextChar 10
PressMB Btn3
LocatePointer Cut2
ReleaseMB Btn3
CompareVisual Text2
LocatePointer Text2 RTextChar 29
ClickMB Btn1
PressMB Btn3
LocatePointer Paste2
ReleaseMB Btn3
CompareVisual Text2
## test Copy/Paste in Text2
LocatePointer Text2 RTextChar 24
DragComponent Text2 RTextChar 29
PressMB Btn3
LocatePointer Copy2
ReleaseMB Btn3
CompareVisual Text2
LocatePointer Text2 RTextChar 15
ClickMB Btn1
PressMB Btn3
LocatePointer Paste2
ReleaseMB Btn3
CompareVisual Text2
## test Remove in Text2
LocatePointer Text2 RTextChar 20
DragComponent Text2 RTextChar 25
PressMB Btn3
LocatePointer Remove2
ReleaseMB Btn3
CompareVisual Text2
LocatePointer Text2 RTextChar 5
ClickMB Btn1
PressMB Btn3
LocatePointer Paste2
ReleaseMB Btn3
CompareVisual Text2
## test highlight selected in Text2
LocatePointer Text2 RTextChar 29
PressMB Btn3
LocatePointer HiLi_Selected2
ReleaseMB Btn3
CompareVisual Text2
## test highlight normal in Text2
LocatePointer Text2 RTextChar 29
PressMB Btn3
LocatePointer HiLi_Normal2
ReleaseMB Btn3
CompareVisual Text2
## test highlight secondary in Text2
LocatePointer Text2 RTextChar 29
PressMB Btn3
LocatePointer HiLi_Secondary2
ReleaseMB Btn3
CompareVisual Text2
## test toggle addmode in Text2
LocatePointer Text2 RTextChar 10
DragComponent Text2 RTextChar 15
PressMB Btn3
LocatePointer Toggle_AddMode2
ReleaseMB Btn3
LocatePointer Text2
ClickKey KRight
ClickKey KRight
CompareVisual Text2
PressMB Btn3
LocatePointer Toggle_AddMode2
ReleaseMB Btn3
LocatePointer Text2
ClickKey KLeft
ClickKey KLeft
CompareVisual Text2
## test set string NULL in Text2
LocatePointer Text2
PressMB Btn3
LocatePointer Set_String_NULL2
ReleaseMB Btn3
CompareVisual Text2
## test get string in Text2
LocatePointer Text2
PressMB Btn3
LocatePointer Get_String2
ReleaseMB Btn3
CompareVisual Text2
## test set string orig in Text2
LocatePointer Text2
PressMB Btn3
LocatePointer Set_String_Orig2
ReleaseMB Btn3
CompareVisual Text2
## test setvalue string in Text2
LocatePointer Text2
PressMB Btn3
LocatePointer SetValue_String2
ReleaseMB Btn3
CompareVisual Text2
## test show pos 3 in Text2
LocatePointer Text2
PressMB Btn3
LocatePointer Set_String_Orig2
ReleaseMB Btn3
LocatePointer Text2
ClickMB Btn1
ClickKey KEndLine
LocatePointer Text2
PressMB Btn3
LocatePointer Show_Pos_32
ReleaseMB Btn3
CompareVisual Text2
## ** Text1 to Text2 tests ** ##
## test Cut in Text1/Paste in Text2
LocatePointer Text1 RTextChar 5
DragComponent Text1 RTextChar 10
PressMB Btn3
LocatePointer Cut1
ReleaseMB Btn3
CompareVisual Text1
LocatePointer Text2 RTextChar 29
ClickMB Btn1
PressMB Btn3
LocatePointer Paste2
ReleaseMB Btn3
CompareVisual Text2
## test Copy in Text1/Paste in Text2
LocatePointer Text1 RTextChar 24
DragComponent Text1 RTextChar 29
PressMB Btn3
LocatePointer Copy1
ReleaseMB Btn3
CompareVisual Text1
LocatePointer Text2 RTextChar 15
ClickMB Btn1
PressMB Btn3
LocatePointer Paste2
ReleaseMB Btn3
CompareVisual Text2
## ** Text2 to Text1 tests ** ##
## test Cut in Text2/Paste in Text1
LocatePointer Text2 RTextChar 5
DragComponent Text2 RTextChar 10
PressMB Btn3
LocatePointer Cut2
ReleaseMB Btn3
CompareVisual Text2
LocatePointer Text1 RTextChar 29
ClickMB Btn1
PressMB Btn3
LocatePointer Paste1
ReleaseMB Btn3
CompareVisual Text1
## test Copy in Text2/Paste in Text1
LocatePointer Text2 RTextChar 24
DragComponent Text2 RTextChar 29
PressMB Btn3
LocatePointer Copy2
ReleaseMB Btn3
CompareVisual Text2
LocatePointer Text1 RTextChar 15
ClickMB Btn1
PressMB Btn3
LocatePointer Paste1
ReleaseMB Btn3
CompareVisual Text1
# C)
Continue
# /* test case for PIR 2895 */
# #) If it isn't already, set the string in the TextField widget back to
# its original string (use the "Set String Orig" item off popup menu).
LocatePointer Text2
PressMB Btn3
LocatePointer Set_String_Orig2
ReleaseMB Btn3
# #) Click MB1 in the TextField widget. Use the osfBeginLine key to
# move the insertion cursor to the very beginning of the text.
LocatePointer Text2
ClickMB Btn1
ClickKey KBeginLine
# #) Press the osfSelect key to place the anchor before the first
# word of text.
ClickKey KSelect
# #) Move the insertion cursor off the anchor using the osfRight key
# several times. You should now see the destination (caret) cursor before
# the first word and the insertion (I-beam) cursor to its right a few
# characters.
ClickKey KRight
ClickKey KRight
ClickKey KRight
CompareVisual Text2
# #) Select the "SetValue String" item off the popup menu for the
# TextField widget. This will change the string in the widget to
# be read "new string". Move the mouse pointer over the TextField widget.
# The insertion cursor should be located before the first
# "n" in "new string" with no other cursors visible in this widget.
# /* end of test case for PIR 2895 */
LocatePointer Text2
PressMB Btn3
LocatePointer SetValue_String2
ReleaseMB Btn3
LocatePointer Text2
CompareVisual Text2
# E)
Exit
|