Containers for ActiveX controls

This topic includes the following sections:

 

To use an ActiveX control with a UI Toolkit application, you’ll need two types of containers for the control: a Toolkit container window and an ActiveX container. Toolkit includes routines that create these containers, load ActiveX controls, and retrieve the IDs for ActiveX containers.

The Toolkit container window is a Toolkit window that you can manipulate as you would any other Toolkit window (environment control, place/remove, and so forth). The ActiveX container is placed within the Toolkit window and is exactly the same size as the Toolkit window. This container is “slaved” to the Toolkit container window, so you won’t manipulate it directly. The %AX_TKCID enables you to get the ActiveX container ID, and you can also get this ID by passing the optional ax_container_id argument to %AX_TKWIN. You will need this ID if you want to bind to the ActiveX container’s events or if you want to manipulate the ActiveX container’s properties. (See Extended properties, Ambient properties, and Local properties.)

Using a single control with a Toolkit container

The most common way to use ActiveX controls with a Toolkit application is to use a single ActiveX control with a single Toolkit container window (and a single ActiveX container). To do this, use the following routines, which are designed for this scenario and are easier to use than ActiveX API counterparts. These routines are documented in Routines for ActiveX controls in Toolkit containers unless otherwise noted.

You can also use the method documented in Using multiple controls with a single container below, and load only one control into the container. However, we recommend using %AX_TKSINGLE when working with a single control because it minimizes the number of separate IDs that need to be maintained.

Using multiple controls with a single container

You can use multiple controls with a single Toolkit container window (and a single ActiveX container). Note, however, that with this method, you can’t use the Toolkit container window ID to access properties and methods for an ActiveX control (i.e., you can’t use %AX_TKCALL, AX_TKGET, %AX_TKGETINT, or AX_TKSET). Unless otherwise noted, the following routines are documented in Routines for ActiveX controls in Toolkit containers

To use multiple controls with a single container, use the following routines.

Creating a container for the Spread control

The Professional Series distribution includes the Spread COM control, which is a full-featured spreadsheet encapsulated in an ActiveX control. To use this control, you’ll treat it as a single control in a Toolkit window as discussed in Using a single control with a Toolkit container. However, instead of using %AX_TKSINGLE to create the containers and load the control, you’ll use %GRID_CREATE.

For information on obtaining the Spread COM control, visit the MESCIUS site (formerly GrapeCity). For information on the methods, properties, and events for the Spread COM control, see the Spread documentation.

Using an ActiveX Toolkit list

UI Toolkit includes an ActiveX implementation of the Toolkit list. This implementation wraps some of the functionality of the Spread control, providing an ActiveX list that you can control with Toolkit list routines. Your code creates an ActiveX Toolkit list on Windows platforms and a standard Toolkit list on Unix and OpenVMS. For information, see Defining lists.

In addition to the Toolkit list routines, you can also access published properties and methods for the ActiveX list. For information, see Using lists in Toolkit applications.