Progress
AppBuilder
Developer’s Guide
Configuring an ActiveX Combo Box Instance
ActiveX (OCX) objects are functionally similar to native Progress objects, but written to the Component Object Model (COM) standard defined by Microsoft. To adapt them for use in the Progress environment, AppBuilder automatically supplies a two-layer interface object, the Control Frame. Control Frames translate between the COM world and the 4GL world.
When you select an ActiveX (OCX) object and choose Tools
Property Sheet, the dialog box that opens in response displays the few properties belonging to the 4GL layer of the Control Frame. See the "ActiveX Control Frame Properties" section in "Frequently Used Dialogs," for further information.
To open the properties dialog box for the Combo Box itself, double-click on the object. The special ActiveX-style properties dialog box opens:
![]()
References in your code to the native ActiveX properties of the Combo Box instance must take the indirect form Com-Handle:ActiveX-Identifier:Property-Identifier.
Minimal Configuration
While you can accept many of the default settings, you will need to make some changes:
- Replace the default Object identifier for the Control Frame with one that more clearly represents the role of this Combo Box instance in your application. You can do this directly in the main AppBuilder window, when the instance is selected. You need not change the identifier of the actual ActiveX object itself, though you can if you wish.
- Populate the list of choices that the Combo Box will use.
To populate the list of choices, follow these steps:
Additional Property Configuration
Choose from three different styles:
- 0 Dropdown Combo — Default. The user can open and pick from the list, or type a value into the Fill–in component. Note that this style is not the default style for the 4GL Combo Box.
- 1 Simple Combo — In this style, you must explicitly make the Selection List component visible at design time, if it is to be visible at all. By default, AppBuilder generates the widget with only the Fill–in visible. Drag the bottom handle to reveal as much of the List element as you like. In this style, the Fill–in element is editable.
- 2 Dropdown List — In this style, the Fill–in component is read-only—the user cannot type into it. The user can only open and pick from the list. The choice then appears in the Fill–in component. Note that, in other taxonomies, a Drop-Down List is a type of Selection List, not a type of Combo Box Configuration
Code Configuration
When you run a workspace for the first time after placing your first ActiveX (OCX) object in it, AppBuilder creates the control_load procedure. You can inspect that procedure in the Section Editor, but not edit it.
In that procedure, AppBuilder creates the variable of type COM–HANDLE that you will use when you write event handlers. The identifier of the variable is the same as the identifier you assign to the Control Frame’s Object field, with “ch” prepended. Thus, if you assign the identifier Example to the Control Frame, the COM–HANDLE identifier will be chExample.
The Combo Box stores its current string value in the Value property. To determine the index value of that string (the topmost list item is index 0), pass the Value property to the FindStringExact() method. Presuming you use the Object identifier Example for the OCX Control Frame, this toy code will detect the user’s selection, and print out the string and index values:
For further information about events, methods, and properties for the three OCX objects that AppBuilder supplies in the Objects Palette, see the online help.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |