Adding Component Objects to Zim Forms

OLE Controls can be added to a Zim form.  The Zim screen painter enables objects of type OLE to be assigned a ProgID, which identify them as a component.  The control is created when the form is opened and destroyed when the form is closed.

Once the control has been created, it’s properties can be changed.  Zim extends the default properties OLE controls by providing additional read/write properties: left, top, width, and height.  These properties are returned in pixels.

(Not mentioning the ’ShowProperties’ bit because it’s basically useless – it should be a design time thing, not a run time thing)

To insert an OLE control, add an ”OLE Insertable Object” to your form, and double-click on it. In the ”Edit OLE Container” dialog, set the OLE Type to ”Component Object” and click on ”Select Component…”.  The Insert OLE Control dialog will appear:

 

 

In Zim 7.1, this dialog lists all the available OLE controls installed on the local system.  The Type Info dialog:

 

 

Lists all the Properties, Methods, Events, and Enumerations in the selected control.  The text box at the bottom is a very handy feature in that it generates Zim code to run the selected method, get the selected property or catch the selected event.

In most cases you’ll want to set the Auto Size mode to Stretch, so that the size of the control is the size that you create for it in the Painter.