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
|
/*
* 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
*/
/*
static char rcsid[] = "$XConsortium: ScrollText3.dat /main/7 1995/07/13 19:23:47 drk $"
*/
@) This test is used to exercise the user-level implementation of the
text widgets. Below is a list of all the keyboard/mouse bindings
and their expected actions. Try each one on all four flavors of
text widgets and in both add mode and normal mode on each.
#) Scrolling:
@) KPageUp -- pages up
@) KPageDown -- pages down
@) KPageLeft -- pages left
@) KPageRight -- pages right
#) With MB1 or MB2 pressed, moving the pointer beyond the list should
scroll the text in that direction.
C)
#) Keyboard Navigation:
@) KLeft -- move the cursor back one character (wraps)
@) KRight -- move the cursor forward one character (wraps)
@) Ctrl KLeft -- move the cursor to the beginning of the word
@) Ctrl KRight -- move the cursor to the beginning of the
following word
@) KUp -- move the cursor up one line
@) KDown -- move the cursor down one line
@) Ctrl KUp -- move the cursor to the first non-blank
character in the paragraph
@) Ctrl KDown -- move the cursor to the first non-blank
character in the following paragraph
@) KBeginLine -- move the cursor to the beginning of the line
@) KEndLine -- move the cursor to the end of the line
@) KBeginData -- move the cursor to the beginning of the file
@) KEndData -- move the cursor to the end of the file
#) In normal mode, the previous navigation operations clear the current
selection, and set the anchor at the cursor position. The cursor is shown
as an I-beam.
#) In add mode, the anchor and the selection remain unchanged during
navigation operations. The cursor is shown as a stippled I-beam.
C)
@) The following is a test case for CR 5186.
#) In Normal Mode, use KSelect and KExtend to select a collection of text.
KDelete should delete the selection.
#) Use KSelect and KExtend to select another collection of text.
KBackSpace should also delete the selection.
#) Switch into Add Mode, KSelect and KExtend a collection of text.
#) While the cursor is within the selection, KDelete or KBackSpace
should delete the selection.
#) Switch back into Add Mode, KSelect and KExtend another collection of text.
#) Move the cursor outside the current selection.
#) KDelete should delete one character forward.
#) KBackSpace should delete one character backward.
C)
#) Keyboard Selection -- Add Mode & Normal Mode:
@) KSelect -- clears the current selection and sets the
anchor
@) Ctrl KSelect -- Same as KSelect (Ctrl SELECT is allowed to
have no effect)
@) Shift KSelect -- selects the text between the anchor and the
cursor, takes ownership of primary selection
@) Ctrl Shift KSelect -- no effect
@) Shift <navigation operation> -- moves the cursor as indicated,
selects the text between the anchor and the
cursor, takes ownership of primary selection
(Rebalances the anchor if necessary)
@) KSelectAll -- selects entire text and takes ownership of
primary selection
@) KDeselectAll -- deselects everything in that widget
C)
#) Mouse-based primary selection:
@) BSelect Click -- moves cursor and anchor, deselect selection
if in the same widget, does not take ownership
of the primary selection
@) BSelect Drag -- drags cursor, selects characters between press
and cursor, places anchor at press, cursor
at release, takes ownership of primary selection
@) Ctrl BSelect Click -- moves cursor, leaves anchor and primary
selection alone
@) Ctrl BSelect Drag -- either no effect, or leaves cursor where
pressed
@) Shift BSelect Click -- moves the cursor as indicated, selects
the text between the anchor and the cursor,
takes ownership of primary selection
(Rebalances the anchor if necessary)
@) Shift BSelect Drag -- drags the cursor, selects the text
between the anchor and cursor
@) BSelect(2) Click -- selects word, places cursor at position
and anchor at end
@) BSelect(2) Drag -- drags out the word selection, moves
anchor to other end of word if necessary
to keep the original word selected
(Rebalances anchor if necessary)
#) Try extending the selection after a BSelect(2) with a Shift BSelect
click or drag. Try a Shift BSelect(2) Drag after a BSelect Click.
#) BSelect(3) actions should work the same, but a line at a time.
C)
#) Clipboard and Primary Transfer:
@) Ctrl KInsert -- copy primary selection to clipboard
@) KCopy -- copy primary selection to clipboard
@) Shift KDelete -- cut primary selection to clipboard
@) KCut -- cut primary selection to clipboard
@) Shift KInsert -- paste clipboard to insertion cursor
@) KPaste -- paste clipboard to insertion cursor
@) Btn2 Click -- copy primary selection to pointer
@) Ctrl Btn2 Click -- copy primary selection to pointer
@) Shift Btn2 Click -- cut primary selection to pointer
@) KPrimaryPaste -- copy primary selection to cursor
@) Ctrl KPrimaryPaste -- copy primary selection to cursor
@) Alt Ctrl KInsert -- copy primary selection to cursor
@) Alt KCopy -- copy primary selection to cursor
@) Alt KPrimaryPaste -- cut primary selection to cursor
@) Alt Shift KDelete -- cut primary selection to cursor
@) Alt KCut -- cut primary selection to cursor
!)
#) Try all the above with:
@) - source and destination in same widget
@) - source and destination in different widgets in same window
@) - source and destination in different windows in same application
@) - source and destination in different applications
C)
#) Quick Transfer:
@) Btn2 Drag -- copy secondary selection to
destination cursor
@) Ctrl Btn2 Drag -- copy secondary selection to
destination cursor
@) Alt Btn2 Drag -- cut secondary selection to
destination cursor
@) KCancel -- cancels quick transfer operations
(Region between Btn2 Press and pointer is underlined)
@) KQuickPaste -- set quick anchor as copy
@) Ctrl KQuickPaste -- set quick anchor as copy
@) Alt KQuickPaste -- set quick anchor as cut
@) Shift KQuickPaste -- do quick transfer to
destination cursor
/* Is this true?
(Region between KQuickPaste and cursor underlined until
Shift KQuickPaste)
*/
!)
#) Try all the above with:
@) - source and destination in same widget
@) - source and destination in different widgets in same window
@) - source and destination in different windows in same application
@) - source and destination in different applications
C)
#) Other Behavior:
@) Space just inserts a space.
@) Return does a carriage return in multi-line.
@) Tab inserts a tab in multi-line.
#) Check that if pending delete enabled, typing a character or doing
any kind of paste deletes the text only if the cursor is within
the bounds of the selected area.
#) Check that KClear clears the selected area (fills it with spaces).
Use a fixed font, and try a multi-line selected region.
#) Check that Ctrl KDelete erases text between the cursor and the
end of line.
C)
/* test case for PIR 3768 */
#) Make a small selection in the TextField widget. Click MB2 elsewhere
in the TextField to copy the primary selection. The original selection
should remain highlighted.
#) Click MB2 several more times to copy the selection several times.
Confirm that the original selection remains highlighted the whole time.
/* end of test case for PIR 3768 */
C)
/* test case for PIR 1983 */
#) Click MB1 on the ScrolledText widget. It should now have focus.
#) Now press Ctrl-Tab twice to get the focus to the MultiLine Text widget.
#) Holding the Shift key, drag MB1 in the ScrolledText widget to select
some text there. As this text is selected, the focus should also move
off of the MultiLine Text widget and onto this widget.
#) Try typing some text to confirm that the selected text in
the ScrolledText widget is
replaced with the newly typed text.
/* end of test case for PIR 1983 */
C)
#) Each of the four widgets now have their XmNsensitive resource set to
False. They should all be grayed out and inaccessible from the keyboard
or the mouse.
E)
|