Chapter Contents

Previous

Next
SAS/AF Software: Class Dictionary

Using the Color List Model

You can use the Color List Model class in conjunction with a viewer control for model/view communication. When you drop a model on a control in a frame, or you set the control's model attribute to the name of the instantiated model object, the items attribute of the view is automatically set to the items attribute of the model.

For example, add a list box control and a color list model to a frame, then set listbox1.model to colorlist1. To display a list of colors in the listbox, set colorlist1.basicColorsDisplayed and/or colorlist1.SASColorsDisplayed to 'Yes'.

You can also use the color list model to return a list of colors for use in an SCL program. Once you instantiate a color list model, simply query the items attribute to get the list of colors.

For example, the following code instantiates a color list model and returns a list of basic colors:

init: 
  dcl sashelp.classes.colorlist_c.class colorobj; 
  dcl list colors;
  colors = makelist(); 
  colorobj = _new_ sashelp.classes.colorlist_c();
  colorobj.basicColorsDisplayed = 'Yes'; 
  colors=colorobj.items; 
  call putlist(colors); 
  colorobj._term(); 
  rc=dellist(colors);
return;


Chapter Contents

Previous

Next

Top of Page

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