Chapter Contents

Previous

Next
Work Area: _popUp

Work Area: _popUp



Displays pop-up menu choices supplied by the Work Area class, or defined by the user. Overrides _popUp in the Widget class.


Syntax
Details
Example

Syntax

CALLSUPER(_SELF_, '_popUp', fill-list, sel);

Argument Type Description
fill-list
N specifies the identifier of an SCL list containing the pop-up menu items
sel
N returns the selected pop-up menu item


Details

The _popUp method runs when the user causes the WPOPUP event (usually with a mouse button). The method has the opportunity to modify the list of pop-up menu items passed in and then pass the fill-list on up the class hierarchy to be handled by the WIDGET class. After the CALL SUPER, sel is set to the index of the selected item from the pop-up menu. If that selection belongs to this method, the selection should be handled, the fill-list cleaned up and sel set to 0 before returning. It is important that the fill-list and sel returned from this method be consistent with the fill-list that was passed into the method.

By default, _popUp for the work area adds the following items to the menu:
Add Item
Modify Resource
Turn Growing On/Off
Auto Arrange
Adjust Arrangement

These items are described in Work Area Run-time Menus.


Example

This example adds three items to the pop-up menu. These items allow you to edit work area attributes, copy the work area, or remove it. It also passes the request on up for the Widget class to handle.

   /* Override the _popup method. */
POPUP: Method plist 8 sel 8;
      /* Insert items on the front of the  */
      /* pop-up menu list */
   rc = insertc(plist, "Edit", 1);
   rc = insertc(plist, "Copy", 2);
   rc = insertc(plist, "Remove", 3);
   call super(_self_, "_popup", plist, sel);

      /* Clean up the list so items are  */
      /* not passed */
      /* to the child subclasses  */
   rc = delitem(plist, 1);
   rc = delitem(plist, 1);
   rc = delitem(plist, 1);

      /* Test the value of SEL to see if  */
      /* it is one of the 3 new items*/
   if (sel > 0) then do;
   if (sel <= 3) then do;

       /* If so, perform the requested  */
       /* action and reset to 0 */
      if (sel = 1) then call send(_self_,
         '_attributes_dialog_');
      else if (sel = 2) then call send
         (_self_, '_copy_region_');
      else if (sel = 3) then call send
         (_self_, '_delete_object_');
      sel = 0;
   end;
   else

      /* Otherwise, since 3 items were  */
      /* added to the front */
      /*  of the list, subtract 3 from  */
      /*  the selection.     */
   sel = sel-3;
   end;
endmethod;


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.