Events (ActiveX Control)

An ActiveX Control can specify Events, e.g. a button would have a Click event.

Events are used to notify the ActiveX Control Container when something important happens in the ActiveX Control, typically when the user interacts with the control.

ControlEvents are not sent to the Container if they occur as a result of the Container’s actions, ie when the ActiveX Control is inside one of its Methods.

Therefore it may be necessary to act after calling one of the ActiveX ControlMethods as well as reacting to an Event (e.g. the ScaleChange Event will be called if the user zooms using the keyboard or mousewheel but not if the ZoomView method is called).

Note: The LicenceError event is an exception to this rule, and will be called immediately any licence error occurs. Care should therefore be taken not to call more Methods from within the LicenceErrorEvent, in order to avoid possible recursion.

The ActiveX Control contains the following Events:

AppCommand (comname$)

Called whenever an application command added using AddCommand is selected.

The command name specified in AddCommand.

CommandAction (comname$, action$)

Called when system command actions take place.

The command class name.

The command action. One of the following:

  • End - the current callback command has ended.
  • Failed - the one-shot command failed.
  • KeyBack - the Backspace key has been pressed.
  • KeyEnter - the Enter key has been pressed.
  • KeyTab - the Tab key has been pressed.
  • Succeeded - the one-shot command succeeded.

DatasetItemEdit (dataset$, edit%, nItems&)

Called when a dataset item is edited.

The name of the dataset containing the edited items.

The edit action. One of the following:

  • 0 - Items have been added.
  • 1 - Items have been removed.
  • 2 - Items have been swapped.

Always 0 in this release.

LicenceError ()

Called whenever a runtime licensing error occurs.

MessageChange ()

Called whenever the system message changes.

MouseTrack (x#, y#, z#)

Called whenever the mouse moves in the SIS Control, if the TrackMouse property is set to True. This event can be used in conjuction with the GetCoordString method to mimic the behaviour of the Status Bar in SIS applications.

x#, y#, z#
The mouse position.

PromptChange ()

This event is retained for backwards compatibility only and is never called. The MessageChange event is called instead.

ScaleChange (displayScale#)

Called whenever the display scale changes, e.g. if the view is zoomed or the SIS Control window changes size.

SelectionChange (nEditable&, nHittable&, commonClass$)

Called whenever the selection changes.

The number of editable items currently selected.

The number of hittable items currently selected.

The lowest common denominator class of those selected.

Snap (x#, y#, z#)

Can be used to query any snapped item, subsequent to calling GetPos or GetPosEx methods.

x#, y#, z#
The snap position.

Note: The special snapped named list is only populated by a snap in the GetPos or GetPosEx methods (not by ‘normal’ snapping).