Making a New Class Available for Use

Introduction

After a class has been created and is ready to be used on a frame for testing or production, you can make it available for use from the Components window. The Components window loads resources and individual classes that can be added to a frame at design time. All classes in a resource that are set to “Display” (via the Toggle Display Status check box in the Resource Editor) are shown in the Components window, including
  • all visual controls and subclasses of visual controls
  • non-visual components that work in conjunction with visuals, such as models
  • legacy objects that are subclasses of sashelp.fsp.Widget.class
Components that are designed to be instantiated at run time should be included in a resource, but you do not have to consider their use in the Components window. Developers can use the _NEW_ operator in their SCL code to add these components to their applications.

Associating Resources with FRAME Entries

The applications developers who use your components to create frames must have access to those components. You can make the components available for drag and drop operations from the Components window, or developers can explicitly associate a resource with a frame.
You can control the contents of the Components window that appears in the build environment in any of the following ways:
  • Add individual classes to the Components window to test those classes. To add an individual class to the Components window, select Add Classes from the pop-up menu inside the Components window.
  • Add classes to a resource, and then add that resource to the Components window to organize several classes. This process is recommended for deploying most components. To add a resource to the Components window, select Add Resources from the pop-up menu inside the Components window.
  • Add classes or resources to the Components key of the SAS Registry to change the default contents of the Components window. See Modifying the Components Key of the SAS Registry for details.
The Components window displays any classes and resources that are defined in the Components key of the SAS Registry. Resources that are used by any open FRAME entries are also temporarily added to the Components window while those frames are open. The default resource settings include sashelp.fsp.AFComponents.resource and sashelp.fsp.build.resource.
When you open a frame, the Components window displays the resource that was used to create the frame. Classes that are used by the frame and are not contained in the resource are loaded individually by the frame but do not necessarily appear in the Components window.
The resource that was used when the frame was created is stored with the FRAME entry. By default, a new frame uses the resource specified in the Resource value of the Products\AF\Design Time\Frame key. You can explicitly change the active resource for the current frame from the default frame resource in either of the following ways:
  • Enter the RESOURCE resource-name command.
  • Include a RESOURCE=resource-name option as part of the BUILD command. For example:
    build work.a.a.frame resource=sashelp.fsp.afcomponents.resource
To see which resource is used by the current frame, you can enter the RESOURCE command without a specified resource. The active resource is displayed on the SAS status bar.

Modifying the Components Key of the SAS Registry

The SAS Registry contains a key that stores the settings for the Components window. The values defined in this key specify the resources and/or classes that are displayed when the Components window is opened. You can add values to this key or modify existing values on the key to change the default setting.
To change the Components key:
  1. Enter the REGEDIT command to open the SAS Registry.
  2. Expand the registry to view Products\AF\Design Time\Component Window\Components.
  3. Select New String from the pop-up menu to add a new value, or select the name of the value you want to modify and then select Modify from the pop-up menu.
  4. Enter the changes for Value Data as required. (The value of Value Name is not significant.) Click OK.
  5. Exit from the SAS Registry.
For more information on the SAS Registry, see Working with SAS/AF Keys in the SAS Registry.