Chapter Contents

Previous

Next
Work Area: _selectItem

Work Area: _selectItem



Adds one or more items to the list of selected work area items


Syntax
Details
Example
See Also

Syntax

CALL NOTIFY (workarea-name, '_selectItem', selected-list, action);

Argument Type Description
selected-list
N specifies the identifier of an SCL list containing the work area items to be listed as currently selected. The list must contain object identifiers that are lists and not numbers. Each identifier needs to be named as well with the name of the object.
action
C specifies how to handle the contents of selected-list:


'APPEND' adds item to list (caused by shift-click)


'REPLACE' replaces all selections in the list with this selections (caused by a single click)


Details

_selectItem allows users to select one item or multiple items.

The method runs automatically when a work area item is selected. The APPEND and REPLACE values are used internally to maintain the list returned by _selectItem.

When you select a work area item, the _selectItem method runs, which in turn runs the _setSelection Widget method. When selected, the item is highlighted with the default border color. However, upon deselection, the work area background color is passed to the _setSelection method; as a result when the item is deselected, the background color of the item replaces the border color and the item appears to lose its border. To change this behavior, override the _setSelection method when you create the subclass.


Example

This example shows how to select all items within a work area. It can be provided with the frame containing the work area.

WORK1:
   widgets = makelist();

      /* Get all the items within the  */
      /* work area */
   call notify('work1','_getWidgets'
               ,widgets);
/**/
      /* Delete these items if they  */
      /* are on the list */
   if nameditem(widgets,'ICONSIZEX') then
      rc = delnitem(widgets,'ICONSIZEX');
   else if nameditem(widgets,'ICONSIZEY') then
      rc = delnitem(widgets,'ICONSIZEY');

      /* Make a list of object identifiers. */
      /* Note that _getWidgets    */
      /* does not return a list of */
      /* identifiers, but is a list     */
      /* describing the items.  _SELF_ */
      /* is the identifier of that item. */
   objids = makelist();
   do i = 1 to listlen(widgets);
      rc = setniteml(objids,
                     getnitemn(getiteml
                     (widgets,i),'_SELF_'),
                     nameitem(widgets,i));
   end;
   call notify('work1','_selectItem'
               ,objids,'REPLACE');
   rc = dellist(widgets);
   rc = dellist(objids);
return;

See Also

_setSelection in the Widget class.


Chapter Contents

Previous

Next

Top of Page

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