SQABasic "PopupMenuFunctions" Script

 MODULE DESCRIPTION:

      Since POPUP menus for ALL component types are handled generically by the
      operating system they are mostly handled by the GenericMasterFunctions.

      All of these routines expect a popup menu to be active for the call.

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:

      SelectPopupMenuItem             'Select a text popup menuitem
      SelectUnverifiedPopupMenuItem   'Select a text popup menuitem without verification
      SelectPopupMenuID               'Select a popup menuitem by menuID
      VerifyPopupMenuItem             'verify the state of a text popup menuitem
      VerifyPopupMenuID               'verify the state of a popup menuitem by menuID
      VerifyPopupMenu                 'verify the entire popup menu hierarchy



Globals

    (none)

Routine Details



   Sub SelectPopupMenuItem()

 DESCRIPTION:

      Attempts to select a particular text string menuitem in the currently
      active popup menu.  The menuitem should be specified in the form
      "Menu->Menu->MenuItem   CTRL+V" with the full text, spaces(if any), and
      keyboard shortcut text (if any).

      Ampersands preceding underlined characters are optional.
      The routine first verifies that the specified menuitem exists
      and exits with error if it does not.
      If it does exist then the selection proceeds using the MenuID retrieved
      from the found menuitem.

      The routine expects that the popup menu is currently active and can be
      found by the MenuUtilities.MUGetActivePopupMenu function.

      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:

      FLD     CONTENT
      ---     ------------------------------
       5      Menu->MenuItem hierarchy string to identify which menuitem to select.

              NOTE:SQA can only handle submenus up to 5 levels deep.


 ERRORS:

      none

 Orig Author: Carl Nagle
 Orig   Date: AUG 08, 2000
 History:

      AUG 08, 2000    Original Release
      OCT 31, 2004    (CANAGL) Try other engines if popup not found for certain commands.




   Sub SelectUnverifiedPopupMenuItem()

 DESCRIPTION:

      Attempts to select a particular text string menuitem in the currently
      active popup menu.  The menuitem should be specified in the form
      "Menu->Menu->MenuItem   CTRL+V" with the full text, spaces(if any), and
      keyboard shortcut text (if any).

      Ampersands preceding underlined characters are optional.
      The routine does no verification prior to attempting the click
      or following the click.  This may cause a Rational error if the
      popup menu does not exist or the menu item does not exist

      The routine expects that the popup menu is currently active and can be
      found by the MenuUtilities.MUGetActivePopupMenu function.

      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:

      FLD     CONTENT
      ---     ------------------------------
       5      Menu->MenuItem hierarchy string to identify which menuitem to select.

              NOTE:SQA can only handle submenus up to 5 levels deep.


 ERRORS:

      none

 Orig Author: Robert D'Antoni
 Orig   Date: AUG 23, 2005
 History:

      AUG 23, 2005    Original Release




   Sub SelectPopupMenuID()

 DESCRIPTION:

      Attempts to select a particular menuitem by menuID in the currently
      active popup menu.  This is generally used when the menuitem is a bitmap
      or other item that does not have text.  This value can be retrieved from
      the the menu by index or by manual lookup from a menu structure output
      from MenuUtilities.
      The routine first verifies that the specified menuitem exists and exits
      with error if it does not.  If it does exist then the selection proceeds.

      The routine expects that the popup menu is currently active and can be
      found by the MenuUtilities.MUGetActivePopupMenu function.

      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:

      FLD     CONTENT
      ---     ------------------------------
       5      MenuID to identify which menuitem to select.


 ERRORS:

      none

 Orig Author: Carl Nagle
 Orig   Date: AUG 08, 2000
 History:

      AUG 08, 2000    Original Release




   Sub VerifyPopupMenuItem()

 DESCRIPTION:

      Verify the state of a popup menuItem identified by its text in the
      active popup menu.  The menuitem should be specified in the form
      "Menu->Menu->MenuItem   CTRL+V" with the full text, spaces(if any), and
      keyboard shortcut text (if any).

      Ampersands preceding underlined characters are optional.
      The routine first verifies that the specified menuitem exists
      and exits with error if it does not.

      This command also supports the "TF"(expected failure) record type.
      This command does not support the "TW" record type.

      The routine uses GenericVerifyMenuItem from GenericMasterFunctions.

      The routine expects that the popup menu is currently active and can be
      found by the MenuUtilities.MUGetActivePopupMenu function.

      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:

      FLD     CONTENT
      ---     ------------------------------
       5      Menu->MenuItem hierarchy string to identify which menuitem to test.
              This menu hierarchy IS case-sensitive

       6      Expected status string (or part thereof) to verify.
              Ex: "Enabled Checked"         OR  "Disabled Grayed"    etc.
              Each item separated by a space will be evaluated separately so
              the order of the status items does not matter.
              These status items ARE case-sensitive.

              NOTE:SQA can only handle submenus up to 5 levels deep.


 ERRORS:

      none

 Orig Author: Carl Nagle
 Orig   Date: AUG 08, 2000
 History:

      AUG 08, 2000    Original Release
      DEC 17, 2002    (CANAGL) Enable TF record type.
      OCT 31, 2004    (CANAGL) Try other engines if popup not found for certain commands.




   Sub VerifyPopupMenuID()

 DESCRIPTION:

 DESCRIPTION:

      Attempts to verify the state information of a particular menuitem
      identified by MenuID in a popup menu.  This is generally used when
      the menuitem is a bitmap or other item that does not have text.
      This value can be retrieved from the the menu by index or by manual
      lookup from a menu structure output from MenuUtilities.

      This command also supports the "TF"(expected failure) record type.
      This command does not support the "TW" record type.

      The routine uses GenericVerifyMenuID from GenericMasterFunctions.

      The routine expects that the popup menu is currently active and can be
      found by the MenuUtilities.MUGetActivePopupMenu function.

      The routine expects that Global StepDriverTestInfo contains all the additional
      information it needs to perform its function .


 DATA TABLE PARAMETERS:

      FLD     CONTENT
      ---     ------------------------------
       5      MenuID to identify which menuitem to test.  This is generally used
              when the menuitem is a bitmap or other item that does not have text.
              This value can be retrieved from the the menu by index or by manual
              lookup from a menu structure output from MenuUtilities.

       6      Expected status string (or part thereof) to verify.
              Ex: "Enabled Checked"         OR  "Disabled Grayed"    etc.
              Each item separated by a space will be evaluated separately so
              the order of the status items does not matter.
              These status items ARE case-sensitive.


 ERRORS:

      none

 Orig Author: Carl Nagle
 Orig   Date: AUG 08, 2000
 History:

      AUG 08, 2000    Original Release
      DEC 17, 2002    (CANAGL) Enable TF record type.




   Sub VerifyPopupMenu()

 DESCRIPTION:

      The routine outputs the full structure of the currently active popup menu
      with status to a file.  It then compares that file with the specified
      benchmark file and sets pass/fail conditions for the test.

      This command also supports the "TF"(expected failure) record type.
      This command does not support the "TW" record type.

      The routine uses GenericVerifyMenuStructure from GenericMasterFunctions.

      The routine expects that the popup menu is currently active and can be
      found by the MenuUtilities.MUGetActivePopupMenu function.

      The routine expects that Global StepDriverTestInfo contains all the additional
      information it needs to perform its function .


 DATA TABLE PARAMETERS:

      FLD     CONTENT
      ---     ------------------------------
       5      name.ext of benchmark file on repositiory's Datapool\Bench directory
      [6]     Optional expected descriptive text at start of file (first line of bench).
              (If bench has this descriptive text this field is REQUIRED to pass.)
      [7]     optional name.ext to give current structure in repository's
              Datapool\Test directory for compare with benchmark.
              If no name is given then the bench name is used.
      [8]     optional name.ext to store difference information in repository's Datapool\Dif.
              If no name is given then the bench name is used.


 ERRORS:

      none

 Orig Author: Carl Nagle
 Orig   Date: AUG 08, 2000
 History:

      AUG 08, 2000    Original Release
      DEC 17, 2002    (CANAGL) Enable TF record type.




   Sub Main ()

 DESCRIPTION:

      Entry point to process a StepDriver ACTION COMMAND on a POPUP MENU.
      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: AUG 08, 2000
 History:

      AUG 08, 2000    Original Release
      OCT 22, 2002    (CANAGL) Warn of unimplemented TF and TW record types.
      DEC 12, 2002    (CANAGL) Added support for XSLComponentActions.MAP
      DEC 20, 2005    (RDANTONI) Added SelectUnverifiedPopupMenuItem Command


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