SQABasic "CheckBoxFunctions" Script

 MODULE DESCRIPTION:

      Routines and utilities to work on SQA Type=CHECKBOX objects in
      Data-Driven Automation.

Action Commands Global Variables Routine Details

User Dependencies:

(stuff the developer's library/script $INCLUDES at compile time.)
(Note: The order of items may matter and may be different for your code.)

Internal Dependencies:

(stuff this library needs at compile time.)

DDE Action Commands

 SUPPORTED ACTION COMMANDS:

      Check                   'Check the CheckBox
      UnCheck                 'UnCheck the CheckBox

 UTILITY ROUTINES:

  Function CheckboxState (winID As String, compID As String) As Integer



Globals

    (none)

Routine Details



 Function CheckboxState (winID As String, compID As String) As Integer

 DESCRIPTION:

      Tries to determine if a checkbox is checked or unchecked.  The routine
      will perform a SetContext on the winID before the attempt is made.
      Currently, this handles most generic checkboxes and HTMLCheckboxes.

 PARAMETERS:

   winID      The recognition method for the Window containing the checkbox.

   compID     The recognition method for the checkbox within the Window.

 RETURNS:

   -1 = checked
    0 = not checked
    1 = get environment error
    2 = unrecognized property status information
   +N = other SQA errors

 ERRORS:

      none

 Orig Author: Carl Nagle
 Orig   Date: DEC 15, 2000
 History:

      DEC 15, 2000    Original Release
      JUL 23, 2001    Bernde Weber adding Java Support
      SEP 25, 2002    (auroge) Fix for standard windows checkboxes
      OCT 30, 2004    (CANAGL) Added .NET support




  Sub SetCheckboxState (winID As String, compID As String, value as integer)

 DESCRIPTION:

      Set the state/value of the checkbox using SQASetProperty.
      The routine will perform a SetContext on the winID before the attempt is
      made. Currently, this handles most generic checkboxes and HTMLCheckboxes.

 PARAMETERS:

      winID   The recognition method for the Window containing the checkbox.

      compID  The recognition method for the checkbox within the Window.

      value   The value to set the chechbox state to.
              -1 for checked.
              0 for unchecked.

 ERRORS:

      none

 Orig Author: Yuesong Wang
 Orig   Date: AUG 06, 2000
 History:

      AUG 06, 2000    Original Release
      OCT 30, 2004    (CANAGL) Added .NET support




   Sub CheckBoxCheck ()


 DESCRIPTION:

 DESCRIPTION:

      Tries to perform a Check on the Checkbox.  If the Checkbox does not
      have a checkmark, it will set the checkmark.  If the Checkbox already
      has a checkmark, then it should leave it alone.
      Currently, this handles most generic checkboxes and HTMLCheckboxes.

      The routine expects that the given object already has Context or Focus.
      It also expects that Global StepDriverTestInfo contains all the information
      it needs to perform its function.

 DATA TABLE PARAMETERS:

      none

 ERRORS:

      none

 Orig Author: Carl Nagle
 Orig   Date: DEC 15, 2000
 History:

      DEC 15, 2000    Original Release
      AUG 06, 2002    (YWANG) Added call to SetCheckboxState to force the state
                      of the checkbox when CheckBox Click does not work.




   Sub CheckBoxUnCheck ()


 DESCRIPTION:

      Tries to UnCheck the Checkbox.  If the Checkbox does not
      have a checkmark, it will leave it alone.  If the Checkbox already
      has a checkmark, then it should uncheck (deselect) it.
      Currently, this handles most generic Checkboxes and HTMLCheckboxes.

      The routine expects that the given object already has Context or Focus.
      It also expects that Global StepDriverTestInfo contains all the information
      it needs to perform its function.

 DATA TABLE PARAMETERS:

      none

 ERRORS:

      none

 Orig Author: Carl Nagle
 Orig   Date: DEC 15, 2000
 History:

      DEC 15, 2000    Original Release
      AUG 06, 2002    (YWANG) Added call to SetCheckboxState to force the state
                      of the checkbox when CheckBox Click does not work.




   Sub Main ()

 DESCRIPTION:

      Entry point to process a StepDriver ACTION COMMAND on a CHECKBOX.
      The routine merely reads the Global StepDriverTestInfo.testcommand and
      calls the appropriate subroutine to process it.

      If the testcommand is unrecognized it will log a WARNING_MESSAGE and
      exit with a WARNING status.

 DATA TABLE PARAMETERS:

      none    -   the called subroutine has the requirements

 ERRORS:

      none

 Orig Author: Carl Nagle
 Orig   Date: JUL 27, 1999
 History:

      JUL 27, 1999    Original Release
      JUL 15, 2000    (CANAGL) Added CLICK
      DEC 15, 2000    (CANAGL) Added Check and UnCheck
      OCT 17, 2002    (CANAGL) Reroute fallback to GenericObjectFunctions.
      OCT 22, 2002    (CANAGL) Warn of unimplemented TF and TW record types.
      DEC 12, 2002    (CANAGL) Added support for XSLComponentActions.MAP


Copyright (C) SAS Institute
GNU General Public License: http://www.opensource.org/licenses/gpl-license.php 
==============================================================================