Chapter Contents

Previous

Next
SAS/AF Software: Class Dictionary

Using the Spin Box Control


Key properties to set
dataSource attribute Specify whether a spin box uses numeric or character values.

You can also query or set this attribute using SCL. For example, the following line of SCL code sets spin box values to 'character.'

spinbox1.dataSource = 'List of Values';

Note:   If the dataSource attribute is set to 'List of Values,' you must also set the items attribute.  [cautionend]

The following line of SCL code sets spin box values to 'numeric.'

spinbox1.dataSource = 'Range of Integers';

Note:   If the dataSource attribute is set to 'Range of Integers' and the items attribute is not set, the maximum and minimum attributes default to 100 and 0 respectively.  [cautionend]

text attribute (default attribute) Specify the text or number that should display in the text portion of the spin box.

You can also query or set this attribute using SCL. For example, the following line of code sets the text attribute to 'Table.'

spinbox1.text='Table';

Note:   The following line of code is also valid since the text attribute is the default attribute:

spinbox1 = 'Table';
  [cautionend]

Note:   This code only works if the dataSource attribute is set to 'List of Values.'  [cautionend]


Setting spin box items

You must tell every spin box control what items to display. Use one of the following ways to add items to a spin box control:


Build-time attributes

The following attribute is a build-time attribute, meaning it can only be set at build-time if you choose to use it:


Using SCL to specify spin box items

You can specify spin box items using an SCL program.

For example, the following code creates a list and assigns the list to a spin box control:

petList = makelist(); 
rc = insertc(petList, 'Dog', -1); 
rc = insertc(petList, 'Cat', -1); 
rc = insertc(petList, 'Bird', -1); 
spinbox1.items = petList;

You could just as easily fill a spin box control with a list of items that already exists in a model that you have instantiated. The following code assigns color list model items to a spin box control:

spinbox1.items = colorlist1.items;


Chapter Contents

Previous

Next

Top of Page

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