Chapter Contents

Previous

Next
Widget Class: _setSelection

Widget Class: _setSelection



Sets the selection status of a widget. Used by the Work Area and the Extended Table objects.


Syntax
Details

Syntax

objectName._setSelection( status, color );

Argument Type Use Description
status Character Input specifies a value indicating the status of the widget: ON if selected, OFF if not selected
color Character Input


Details

The _setSelection method is used by the work area object and the extended table object. When you select an object in a work area, the object is sent a _setSelection method with a status of ON. The object that was previously selected in the work area is sent a _setSelection with a status of OFF. Both the selected object and the previously selected object have their border colors changed to indicate their selection status. To achieve a different visual appearance, you could override the _setSelection method and change the object's background color or border title.

For extended table objects, the _setSelection method is automatically called from the GETROW section of the SCL program to update the selection status of a widget. By default, when a row is selected, the border color is changed to the selection color. When a row is unselected, the region's original border color is restored. For example, suppose you have an extended table with a logical row that consists of obj1 and obj2. The table can display four rows. If the user selects row 2, the _selectRow method and the PUTROW block will run for row 2. When the Frame entry is redisplayed, the following processing takes place:

  1. The extended table invokes the _setSelection method for obj1 on row 1 with the OFF parameter and the original color.

  2. The extended table invokes the _setSelection method for obj2 on row 1 with the OFF parameter and the original color.

  3. The _getRowLabel method runs for row 1.

  4. The _getRow method runs for row 1.

  5. The extended table invokes the _setSelection method for obj1 on row 2 with the ON parameter and the selection color.

  6. The extended table invokes the _setSelection method for obj2 on row 2 with the ON parameter and the selection color.

  7. The _getRowLabel method runs for row 2.

  8. The _getRow method runs for row 2.

  9. The same steps are repeated for rows 3 and 4.

Example

The following example is an overridden _setSelection method. Instead of changing the default behavior of the region's border color, this example changes the region's title.

SEL:
  method status color $;
   if(status='ON') then
      _self_._setBorderTitle(selected);
   else
     _self_._setBorderTitle(unselected);
  endmethod;


Chapter Contents

Previous

Next

Top of Page

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