Blob Blame History Raw
/* 
 * 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: Text9.dat /main/7 1995/07/13 19:32:12 drk $"
*/
@) The left side of this test contains a MultiLine Text widget and
   the right, a SingleLine Text widget.  Each set of widgets
   below the text widgets pertain to the text widget above them.
   Do all the first tests on the MultiLine Text widget.
#) The MultiLine Text widget should have \"His wife could...
   on the top line in the window.  Grab the vertical scrollbar
   and slide it up so the first line is displayed reading \"Jack
   Sprat could...\".
#) Click MB1 right before the word \"Sprat\" in the MultiLine
   Text widget.  The I-beam cursor should now be at that position.
#) Try inserting new text into the widget by typing \"NEW\".
   You should just hear the bell beep 3 times, but no text will
   be inserted.
#) Now click MB1 on the \"verifyBell\" togglebutton.  Click in
   the text widget at the same position and try typing \"NEW\" again.
   There should be NO bell, and still no text inserted.
#) Now click MB1 on the \"doit flag\" togglebutton.  Click in the
   text widget and try typing again.  It should work this time.  Note
   that the \"text length\" should increase as you insert characters
   into the text widget.
C)
#) Drag the \"top character\" slider to the right until it reads 35.
   The MultiLine text widget should now have the second line of text at
   the top of the window (starts with \"His wife could..\").
#) Drag the \"cursor position\" slider out to 12.  The widget should
   shift so that the first line is again at the top and the insertion
   cursor is before the twelfth position (just before the \'t\' in \"Sprat\").
#) Now drag the \"top character\" to 43.  The second line of text should
   again be the top line in the window and there should be no cursor
   visible at all.
#) Click MB1 on the \"show position\" pushbutton.  The window should
   change to have the first text line visible again.  If you press <Tab>,
   the highlight will move to the MultiLine Text widget and the I-beam cursor
   will again be showing before the \'t\' in \"Sprat\".
C)
#) Click MB1 on the \"6x12\" button in the radio box.  The text widget
   font should shrink and its window should size itself accordingly.
   Also, the \"text baseline\" should now read 17.
#) Click MB1 on the \"9x15\" button.  The text widget font should change
   again and its window will grow.  The \"text baseline\" should now
   read 21.
#) Click MB1 on the \"8x13\" button.  The text widget font should return
   to its initial size, and the window should also resize.
C)

@) Test whether the setting of top character works 
   correctly when word wrap is on. 
#) Some text is displayed with word wrap off. Scroll text widget vertically
   to verify that the text runs horizontally outside of the window. 
#) Select the word wrap toggle.  All text should now fit within
   the vertical bounds of the text widget.
   There are actually three logical lines of text. The first two lines
   of text end with a newline character.  The third line of text does not.
   When word wrap is set, the third logical line of text is displayed as 
   nine lines of physical text. 
#) Drag the \"top character\" slider to the right until it reads 38.
   The beginning of the third logical line should be displayed at
   the top of the window.  It reads "This line of text".
#) Drag the \"top character\" slider to the right until it reads 56.
   The text "does not end with a" should be displayed at the top of
   the window.
C)

@) Now do all of the tests again on the SingleLine Text widget.
#) The SingleLine Text widget should have \"s wife could eat no\" 
   displayed in the window.
#) Click MB1 right before the word \"could\" in the SingleLine
   Text widget.  The I-beam cursor should now be at that position.
#) Try inserting new text into the widget by typing \"NEW\".
   You should not hear any bell and no text should be inserted.
#) Now click MB1 on the \"verifyBell\" togglebutton.  Click at the
   same position in the text widget and try typing \"NEW\" again.
   There should now be three bells, and still no text inserted.
#) Now click MB1 on the \"doit flag\" togglebutton.  Try typing
   into the text widget again.  It should work this time.  Note
   that the \"text length\" should increase as you insert characters
   into the text widget.
C)
#) Drag the \"top character\" slider to the right until it reads 35.
   The SingleLine text widget should now have shifted the text in
   the window (should read \"e NEWcould eat no le\").
#) Drag the \"cursor position\" slider out to 5.  The widget should
   shift so that the first line is again in the window and the insertion
   cursor is before the fifth position (just before \"Sprat\").
#) Now drag the \"top character\" to 43.  Part of the second line of text
   should again be in the window and there should be no cursor visible at
   all.
#) Click MB1 on the \"show position\" pushbutton.  The window should
   change to have the first text line visible again with the insertion cursor
   showing before the word \"Sprat\".
C)
#) Click MB1 on the \"6x12\" button in the radio box.  The text widget
   font should shrink and the window should size itself accordingly.
   Also, the \"text baseline\" should now read 17.
#) Click MB1 on the \"9x15\" button.  The text widget font should change
   again and the window should grow.  The \"text baseline\" should now
   read 21.
#) Click MB1 on the \"8x13\" button.  The text widget font should return
   to its initial size, and the window should also resize.
C)
@) You can change the range of text which is selected by a double click
   by changing the selection in the \"Double Click Selects...\" option
   menu. When you make a new selection, both text widgets will be altered.
#) Try each selection in the option menu and confirm that a double click
   selects the correct amount of text in both widgets.
!) 
        Position    double click just sets the
                    cursor and nothing is selected.
        Word        selects a word. 
        Line        selects one line of text source.
                    ( When wordWrap is ON, one line of text
                      source may be displayed as multiple 
                      output lines.
                      Each of the output lines which 
                      correspond to one source line
                      will be selected. )
        All         means the entire contents is selected.
C)

@)  The following testcase checks the amount of indentation which
    results after inserting a tab into a Text widget. Before inserting
    tabs, verify that the wordWrap toggle is selected.

#)  ClickMB1 at the beginning of the Scrolled Text widget. Click KTab.
    Verify that the text is indented by eight columns. The first character
    on the first line of text should align to the right of the first
    occurance of the number "8" on the second line of text. 

#)  Click KTab again. The text should indent by another eight columns.
    The first character on the first line of text should align to the
    right of the second occurance of the number "8" on the second
    line of text.

#)  Click KTab once again.  Since wordWrap is on, and the first word is
    too long to fit on the first line after the indentation, the
    text moves to the next line in the Text widget.

#)  Click KTab seven more times. Verify that upto 10 tabs can be inserted
    into the Text widget.

C)

E)