File: TextField2.dat

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 (97 lines) | stat: -rw-r--r-- 4,494 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
/* 
 * 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: TextField2.dat /main/6 1995/07/13 19:34:53 drk $"
*/
@) 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.
#) 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.
C)
#) 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
C)
/* 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).
#) Click MB1 in the TextField widget.  Use the osfBeginLine key to
move the insertion cursor to the very beginning of the text.  
#) Press the osfSelect key to place the insertion point before the first
word of text.
#) Move the I-beam off the insertion point using the osfRight key
several times. 
#) 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 */
E)