PowerScript Support
\The Sandbox \PB History & Future \New in PB 5 \Component Gallery \PowerScript Support
Registering OLE
Custom Controls
Using OLE
Custom Controls
Custom Control
Properties
PowerScript
Support

The properties, events, and methods of the OLE custom controls can be accessed through PowerScript.

In this simple example two controls have been placed on a Window

  • ole_spin, which is a spin button
  • ole_meter, which is a progress meter

The spin button exposes a number of parameterized events, including the click event. The event parameters are displayed by selecting the Declare > User Events menu in the Window painter.

Here is the script to change the value of the progress bar based on the spin button, nButton is the event parameter of the click event, and value is an integer of the progress bar.

    integer I
    if nButton = 1 then
       I = I - 1
    else
       I = I + 1
    end if
    ole_gauge.object.Value = I

The ole_gauge properties are accessed via PowerScript by pre-fixing the properties with the object keyword.

OCX methods, like those of functions, can be called by using dot notation. For example to display the  About box for the ole_gauge control, you would code the following script:

    ole_gauge.object.AboutBox() 

PBL Peeper PB Help PB History
& Future About Us Feedback Site Map

Google
 
Web www.techno-kitten.com
www.sybase.com