Blob Blame History Raw
# $XConsortium: SpinBox5.scr /main/5 1996/04/30 13:58:02 schuldy $
# 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

# @) Welcome to the Resource Control Panel test for SpinBox.
#    The test is comprised of a Resource Control Panel and
#    a client window containing two SpinBox widgets.
#    The Resource Control Panel is divided into three sections.
#    The topmost section allows the user to set SpinBox resources.
#    Changes made to resource values in this section will affect
#    both of the SpinBox widgets in the client window.
#    The middle section allows the user to set SpinBox constraint
#    resources on the SpinBox widget labelled \"XmSTRING\".
#    The bottom section allows the user to set SpinBox constraint
#    resources on the SpinBox widget labelled \"XmNUMERIC\".

# C)
Continue

# #) Verify that the SpinBox arrows are displayed to the right
#    of the SpinBox widgets.

CompareVisual SpinBox1

# #) Change the value of Arrow Layout to \"Arrows Split\".
#    The left-pointing arrows should display on the left of
#    each SpinBox while the right-pointing arrows display on the
#    right.

LocatePointer ArrowLayoutOptions ROptionButton
PressMB Btn1
LocatePointer ArrowLayoutPB0
ReleaseMB Btn1 
CompareVisual SpinBox1

# #) Change the value of Arrow Layout to \"Arrows Beginning\".
#    Verify that both the left-pointing and right-pointing arrows
#    are displayed on the left of each SpinBox.

LocatePointer ArrowLayoutOptions ROptionButton
PressMB Btn1
LocatePointer ArrowLayoutPB1
ReleaseMB Btn1 
CompareVisual SpinBox1

# C)
Continue

# #) Change the value of Arrow Size. Check that the arrows increase
#   in size accordingly.

LocatePointer ArrowSizeOptions ROptionButton
PressMB Btn1
LocatePointer ArrowSizePB1
ReleaseMB Btn1 
CompareVisual SpinBox1

LocatePointer ArrowSizeOptions ROptionButton
PressMB Btn1
LocatePointer ArrowSizePB2
ReleaseMB Btn1 
CompareVisual SpinBox1

LocatePointer ArrowSizeOptions ROptionButton
PressMB Btn1
LocatePointer ArrowSizePB0
ReleaseMB Btn1 
CompareVisual SpinBox1

# #) Verify that each of the SpinBox arrows are sensitive by clicking
#    MB1 on both the left and right pointing arrows.  The values
#    displayed in the SpinBoxes should change with each mouse click.

# C)
Continue

# #) Change the value of Default Arrow Sensitivity to \"Arrows Decrement
#    Sensitive\". The right-pointing arrows should be grayed out and
#    should not respond to clicking MB1.  

LocatePointer DefArrowSensitiveOptions ROptionButton
PressMB Btn1
LocatePointer DefArrowSensitivePB1
ReleaseMB Btn1
CompareVisual SpinBox1

# #) Change the value of Default Arrow Sensitivity to \"Arrows Increment
#    Sensitive\". The left-pointing arrows should be grayed out and
#    should not respond to clicking MB1.

LocatePointer DefArrowSensitiveOptions ROptionButton
PressMB Btn1
LocatePointer DefArrowSensitivePB2
ReleaseMB Btn1
CompareVisual SpinBox1

# #) Change the value of Default Arrow Sensitivity to \"Arrows Insensitive\".
#    Both the left and right pointing arrows should be grayed out and
#    should not respond to clicking MB1.

LocatePointer DefArrowSensitiveOptions ROptionButton
PressMB Btn1
LocatePointer DefArrowSensitivePB3
ReleaseMB Btn1
CompareVisual SpinBox1

# #) Change the value of Default Arrow Sensitivity back to \"Arrows Sensitive\".

LocatePointer DefArrowSensitiveOptions ROptionButton
PressMB Btn1
LocatePointer DefArrowSensitivePB0
ReleaseMB Btn1
CompareVisual SpinBox1

# C)
Continue

# #) Set Initial Delay to a 2000. Click KReturn. Set Repeat Delay to 1000. 
#    Click KReturn. Press MB1 on one of the XmSTRING SpinBox arrows.
#    arrows. While holding MB1 should notice a delay
#    of 2 seconds before the SpinBox value changes.  After the initial value
#    change there should be a delay of 1 second between each value
#    change.  Release MB1.


LocatePointer InitialDelayTF RTextChar Max 
ClickMB Btn1
ClickKey KBackSpace
ClickKey KBackSpace
ClickKey KBackSpace
InputString "2000"
ClickKey KReturn
LocatePointer RepeatDelayTF RTextChar Max 
ClickMB Btn1
ClickKey KBackSpace
ClickKey KBackSpace
ClickKey KBackSpace
InputString "1000"
ClickKey KReturn
CompareVisual StringTextF
LocatePointer StringTextF
ClickMB Btn1
LocatePointer SpinBox1 RIncrementBtn
PressMB Btn1
Wait 2
CompareVisual StringTextF
Wait 1
CompareVisual StringTextF
ReleaseMB Btn1

# #) Set Initial Delay to 0. Click KReturn.
#    When Initial Delay equals zero, the SpinBox
#    uses the value of RepeatDelay as the time lapsed prior to any value change.
#    Press MB1 on one of the XmSTRING SpinBox arrows. Verify that a delay of 1
#    second occurs prior to the SpinBox value changing.  Release MB1.
LocatePointer InitialDelayTF RTextChar Max 
ClickMB Btn1
ClickKey KBackSpace
ClickKey KBackSpace
ClickKey KBackSpace
ClickKey KBackSpace
InputString "0"
ClickKey KReturn
CompareVisual StringTextF
LocatePointer StringTextF
ClickMB Btn1
LocatePointer SpinBox1 RIncrementBtn
PressMB Btn1
Wait 1
CompareVisual StringTextF
ReleaseMB Btn1

# #) Set Initial Delay to 1000. Click KReturn. Set Repeat Delay to 0.
#    Click KReturn.  When Repeat Delay equals zero automatic
#    spinning is disabled.  Press MB1 on one of the SpinBox arrows
#    for over one second.  Verify that the SpinBox value does not change while
#    the SpinBox arrow is depressed. Release MB1.
LocatePointer InitialDelayTF RTextChar Max 
ClickMB Btn1
ClickKey KBackSpace
InputString "1000"
ClickKey KReturn
LocatePointer RepeatDelayTF RTextChar Max 
ClickMB Btn1
ClickKey KBackSpace
ClickKey KBackSpace
ClickKey KBackSpace
ClickKey KBackSpace
InputString "0"
ClickKey KReturn
CompareVisual StringTextF
LocatePointer StringTextF
ClickMB Btn1
LocatePointer SpinBox1 RIncrementBtn
PressMB Btn1
Wait 1
CompareVisual StringTextF
ReleaseMB Btn1

# C)
Continue

# #) Set Default Arrow Sensitivity to \"Arrows Insensitive\". The SpinBox
#    arrows of both SpinBox widgets should be insensitive.
LocatePointer DefArrowSensitiveOptions ROptionButton
PressMB Btn1
LocatePointer DefArrowSensitivePB3
ReleaseMB Btn1
CompareVisual SpinBox1

# #) Set Arrow Sensitivity for the XmSTRING SpinBox to \"Arrow Sensitive\".
#    Verify that both the left and right pointing arrows are sensitive.
LocatePointer StringArrowSensOptions ROptionButton
PressMB Btn1
LocatePointer StringArrowSensPB0
ReleaseMB Btn1
CompareVisual SpinBox1

# #) Set Arrow Sensitivity for the XmSTRING SpinBox to \"Arrow Decrement
#    Sensitive\".  Verify that the left-pointing arrow is sensitive.
LocatePointer StringArrowSensOptions ROptionButton
PressMB Btn1
LocatePointer StringArrowSensPB1
ReleaseMB Btn1
CompareVisual SpinBox1

# #) Set Arrow Sensitivity for the XmSTRING SpinBox to \"Arrow Increment
#    Sensitive\".  Verify that the right-pointing arrow is sensitive.
LocatePointer StringArrowSensOptions ROptionButton
PressMB Btn1
LocatePointer StringArrowSensPB2
ReleaseMB Btn1
CompareVisual SpinBox1

# #) Set Arrow Sensitivity for the XmSTRING SpinBox to \"Arrow Insensitive\".
#    Verify that both the left and right pointing arrows are insensitive.
LocatePointer StringArrowSensOptions ROptionButton
PressMB Btn1
LocatePointer StringArrowSensPB3
ReleaseMB Btn1
CompareVisual SpinBox1

# C)
Continue

# #) Change the values of Decimal Pts, Increment Value, Maximum Value
#    and Minimum Value in the XmSTRING SpinBox. Verify that changing
#    these values has no effect on the XmSTRING SpinBox.
LocatePointer StringDecimalPtsTF RTextChar Max
ClickMB Btn1
ClickKey KBackSpace
InputString "2"
ClickKey KReturn
CompareVisual SpinBox1

LocatePointer StringIncrValueTF RTextChar Max 
ClickMB Btn1
ClickKey KBackSpace
InputString "2"
ClickKey KReturn
CompareVisual SpinBox1

LocatePointer StringMaxValueTF RTextChar Max 
ClickMB Btn1
ClickKey KBackSpace
ClickKey KBackSpace
InputString "20"
ClickKey KReturn
CompareVisual SpinBox1

LocatePointer StringMinValueTF RTextChar Max 
ClickMB Btn1
ClickKey KBackSpace
InputString "2"
ClickKey KReturn
CompareVisual SpinBox1

# #) Change the value of Position for the XmSTRING SpinBox to 3.
#    Verify that the string now displayed in the XmSTRING SpinBox
#    is \"Fourth\".
LocatePointer StringPositionTF RTextChar Max 
ClickMB Btn1
ClickKey KBackSpace
InputString "3"
ClickKey KReturn
CompareVisual StringTextF

# C)
Continue

# #) Change the value of Default Arrow Sensitivity back to \"Arrows Sensitive\".

LocatePointer DefArrowSensitiveOptions ROptionButton
PressMB Btn1
LocatePointer DefArrowSensitivePB0
ReleaseMB Btn1
CompareVisual SpinBox1

# #) Change the Increment Value in the XmNUMERIC SpinBox from 1 to 3.
#    Click MB1 on the right-pointing arrow. Verify that the value
#    in the XmNUMERIC SpinBox changes to 3.  Click MB1 on the right-pointing
#    arrow again.  The value should now be 6. Click MB1 two more times
#    on the right-pointing arrow. The XmNUMERIC SpinBox should wrap around
#    pass the maximum value to the minimum value of 0.
LocatePointer NumericIncrValueTF RTextChar Max 
ClickMB Btn1
ClickKey KBackSpace
InputString "3"
ClickKey KReturn
LocatePointer NumericTextF
ClickMB Btn1
LocatePointer SpinBox2 RIncrementBtn
ClickMB Btn1
CompareVisual NumericTextF

LocatePointer NumericTextF
ClickMB Btn1
LocatePointer SpinBox2 RIncrementBtn
ClickMB Btn1
CompareVisual NumericTextF

LocatePointer NumericTextF
ClickMB Btn1
LocatePointer SpinBox2 RIncrementBtn
ClickMB Btn1
ClickMB Btn1
CompareVisual NumericTextF

# #) Change the Maximum Value in the XmNUMERIC SpinBox to 20 and the
#    Increment Value to 5. Click on the right-pointing arrow four times.
#    The XmNUMERIC SpinBox should display the value of 20.
#    Click on the right-pointing arrow one more time.  The value should
#    wrap around to the minimum value of 0.
LocatePointer NumericMaxValueTF RTextChar Max
ClickMB Btn1
ClickKey KBackSpace
ClickKey KBackSpace
InputString "20"
ClickKey KReturn
LocatePointer NumericIncrValueTF RTextChar Max 
ClickMB Btn1
ClickKey KBackSpace
InputString "5"
ClickKey KReturn
LocatePointer NumericTextF
ClickMB Btn1
LocatePointer SpinBox2 RIncrementBtn
ClickMB Btn1
ClickMB Btn1
ClickMB Btn1
ClickMB Btn1
CompareVisual NumericTextF
LocatePointer NumericTextF
ClickMB Btn1
LocatePointer SpinBox2 RIncrementBtn
ClickMB Btn1
CompareVisual NumericTextF

# #) Change the Minimum Value in the XmNUMERIC SpinBox to 10. Click on
#    the right-pointing arrow two times. The value should now be 20.
#    Click on the right-pointing arrow once more. The XmNUMERIC SpinBox
#    should display the minimum value of 10.
LocatePointer NumericMinValueTF RTextChar Max 
ClickMB Btn1
ClickKey KBackSpace
InputString "10"
ClickKey KReturn
LocatePointer NumericTextF
ClickMB Btn1
LocatePointer SpinBox2 RIncrementBtn
ClickMB Btn1 2
CompareVisual NumericTextF

LocatePointer SpinBox2 RIncrementBtn
ClickMB Btn1
CompareVisual NumericTextF



# #) Change the value of Decimal Pts in the XmNUMERIC SpinBox to 2.
#   Verify that the value is now 0.10 in the XmNUMERIC SpinBox.
LocatePointer NumericDecimalPtsTF RTextChar Max
ClickMB Btn1
ClickKey KBackSpace
InputString "2"
ClickKey KReturn
CompareVisual NumericTextF

# #) Change the value of Decimal Pts in the XmNUMERIC SpinBox back to 0.
#    Verify that the value is again 10 in the XmNUMERIC SpinBox.

LocatePointer NumericDecimalPtsTF RTextChar Max
ClickMB Btn1
ClickKey KBackSpace
InputString "0"
ClickKey KReturn
CompareVisual NumericTextF

# C)
Continue

# #) Change the Increment Value to 1 and the Position value to 5
#    in the XmNUMERIC SpinBox.
#    Verify that the value displayed in the XmNUMERIC SpinBox is 15.

LocatePointer NumericIncrValueTF RTextChar Max 
ClickMB Btn1
ClickKey KBackSpace
InputString "1"
ClickKey KReturn
LocatePointer NumericPositionTF RTextChar Max 
ClickMB Btn1
ClickKey KBackSpace
InputString "5"
ClickKey KReturn
CompareVisual NumericTextF

# C)
Continue

# #) Change Increment Value of the XmNUMERIC SpinBox to 0.
#    Verify that at least one message is printed to stdout indicating that zero
#    is not a valid value for XmNincrementValue.
LocatePointer NumericIncrValueTF RTextChar Max
ClickMB Btn1
ClickKey KBackSpace
InputString "0"
ClickKey KReturn

# C)
Continue

# #) Change Increment Value of the XmNUMERIC SpinBox back to 1.
LocatePointer NumericIncrValueTF RTextChar Max
ClickMB Btn1
ClickKey KBackSpace
InputString "1"
ClickKey KReturn

# #) Change Position Value back to 0.
LocatePointer NumericPositionTF RTextChar Max
ClickMB Btn1
ClickKey KBackSpace
InputString "0"
ClickKey KReturn

# #) Change Minimum Value of the XmNUMERIC SpinBox to some value
#    greater than Maximum Value.
#    Verify that a message is printed to stdout indicating that
#    the spin direction specified by XmNincrementValue has been reversed.
LocatePointer NumericMinValueTF RTextChar Max
ClickMB Btn1
ClickKey KBackSpace
ClickKey KBackSpace
InputString "25"
ClickKey KReturn

# #) Click MB1 on the right-pointing arrow of the XmNUMERIC SpinBox.
#    The value of the SpinBox should decrease.
LocatePointer SpinBox2 RIncrementBtn 
ClickMB Btn1
CompareVisual NumericTextF

# #) Now change Increment Value of the XmNUMERIC SpinBox to -1.
#    Change Minimum Value of the same SpinBox to a value less than
#    the Maximum Value.
#    Another message should appear indicating that the spin direction
#    specified by XmNincrementValue has been reversed.
LocatePointer NumericIncrValueTF RTextChar Max
ClickMB Btn1
ClickKey KBackSpace
InputString "-1"
ClickKey KReturn

# #) Click MB1 on the right-pointing arrow of the XmNUMERIC SpinBox.
#    The value of the SpinBox should increase.
LocatePointer SpinBox2 RIncrementBtn 
ClickMB Btn1
CompareVisual NumericTextF

# C)
Continue

# #) Change Increment Value back to 1.
#    Change Minimum Value to the same value as Maximum Value.
#    A warning message should be printed indicating that XmNminimumValue
#    equals XmNmaximumValue.
LocatePointer NumericIncrValueTF RTextChar Max
ClickMB Btn1
ClickKey KBackSpace
InputString "1"
ClickKey KReturn

LocatePointer NumericMinValueTF RTextChar Max
ClickMB Btn1
ClickKey KBackSpace
InputString "0"
ClickKey KReturn

# C)
Continue

# #) Change Position Value of the XmSTRING SpinBox to a value greater
#    than Num Values.
#    Scroll the items in the Values list to the end.
#    Verify that the string displayed in the SpinBox is the same as
#    the last value in the Values array.
LocatePointer StringPositionTF RTextChar Max
ClickMB Btn1
ClickKey KBackSpace
InputString "8"
ClickKey KReturn

LocatePointer StringValuesList RVertScrollBarSlider
DragSliderValue Down Max
CompareVisual StringTextF

# #) Now change the Position Value to equal Num Values.
#    The same string should still be displayed.
LocatePointer StringPositionTF RTextChar Max
ClickMB Btn1
ClickKey KBackSpace
InputString "5"
ClickKey KReturn
CompareVisual StringTextF

# #) Change the Position Value to -1.
#    Scroll the items in the Values list to the beginning.
#    Verify that the string displayed in the SpinBox is the same as
#    the first value in the Values array.
LocatePointer StringPositionTF RTextChar Max
ClickMB Btn1
ClickKey KBackSpace
InputString "-1"
ClickKey KReturn

LocatePointer StringValuesList RVertScrollBarSlider
DragSliderValue Up Min
CompareVisual StringTextF

# C)
Continue

# #) Change the Minimum Value of the XmNUMERIC SpinBox to a positive value
#    less than the Maximum Value.  Set Increment Value to 1.
LocatePointer NumericMinValueTF RTextChar Max 
ClickMB Btn1
ClickKey KBackSpace
ClickKey KBackSpace
InputString "10"
ClickKey KReturn

LocatePointer NumericIncrValueTF RTextChar Max
ClickMB Btn1
ClickKey KBackSpace
InputString "1"
ClickKey KReturn

# #) Now change the Position Value of the XmNUMERIC SpinBox to a value
#    greater than Maximum Value.  Verify that the value displayed in
#    the SpinBox equals Maximum Value.
LocatePointer NumericPositionTF RTextChar Max
ClickMB Btn1
ClickKey KBackSpace
InputString "35"
ClickKey KReturn
CompareVisual NumericTextF

# #) Change the Position Value of the XmNUMERIC SpinBox to a negative
#    value.  Verify that the value displayed in the SpinBox equals
#    Minimum Value.
LocatePointer NumericPositionTF RTextChar Max
ClickMB Btn1
ClickKey KBackSpace
ClickKey KBackSpace
InputString "-5"
ClickKey KReturn
CompareVisual NumericTextF

# C)
Continue

# #) (Motif/CDE Convergence TP3)
# #) Programmatically reset the minumum value to 5, the maximum value to 25,
#    and the increment value to 5.
# #) Enter a value that is less than the minimum into the XmNUMERIC text field
#    (programatically), and the SpinBox should display the minimum value
#    instead, and print the minimum value to stdout.  Verify, by image
#    comparison that the value is now the minimum.
# C)
CompareVisual NumericTestF
Continue

# #) (Motif/CDE Convergence TP4)
# #) Enter a value that is more than the maximum into the XmNUMERIC text field
#    (programatically), and the SpinBox should display the maximum value
#    instead, and print the maximum value to stdout.  Verify, by image
#    comparison that the value is now the maximum.
# C)
CompareVisual NumericTestF
Continue

# #) (Motif/CDE Convergence TP5)
# #) Enter 11 into the XmNUMERIC text field (programatically), and the SpinBox
#    should display 10 instead, and print the increment value to stdout.
#    Verify, by image comparison that the value is now 10.
# C)
CompareVisual NumericTestF
Continue

# #) (Motif/CDE Convergence TP6)
# #) Enter 20 into the XmNUMERIC text field (programatically), and the SpinBox
#    should accept 20, and print the valid alue to stdout.  Verify, by image
#    comparison that the value is now 20.
# C)
CompareVisual NumericTestF
Continue

# #) (Motif/CDE Convergence TP7)
# #) Enter .10 into the XmNUMERIC text field (programatically), and the
#    SpinBox should display the minimum value instead, and print the minimum
#    value to stdout.  Verify, by image comparison that the value is now the
#    minimum.
# C)
CompareVisual NumericTestF
Continue

# E)
Exit