The features described in this topic are obsolete
and should not be used in new IDL code.

Auto Event Properties

Auto events are IDL procedures that are called automatically by the control in response to certain events.

OnButtonPress

An IDL procedure that will be called when a mouse button is pressed. The procedure must be in the form:

pro button_press, drawId, button, xPos, yPos 

The default value is NULL.

OnButtonRelease

An IDL procedure that will be called when a mouse button is released. The procedure must be in the form:

pro button_release, drawId, button, xPos, yPos 

The default value is NULL.

OnDblClick

An IDL procedure that will be called when a mouse button is double clicked within the draw widget. The procedure must be in the form:

pro button_dblclick, drawId, button, xPos, yPos 

The following table describes each parameter of the syntax:

Table 8-6: OnDblClick Parameters 

Parameter
Description

button

Describes which mouse button has been clicked. The valid values are:

  • 1 — Left mouse button.
  • 2 — Middle mouse button.
  • 4 — Right mouse button.

xPos

The horizontal position of the mouse when the button was clicked.

yPos

The vertical position of the mouse when the button was clicked.

The default value is NULL.

OnExpose

An IDL procedure that will be called when an expose message is received by the draw widget. The procedure must be in the form:

pro expose, drawId 

The default value is NULL.

OnInit

An IDL procedure that will be called when a draw widget is initially created. The procedure must be in the form:

pro init, drawId, baseId 

This auto event procedure is called once when the CreateDrawWidget method is invoked.

The default value is NULL.

OnMotion

An IDL procedure that will be called when the mouse is moved over the draw widget while a mouse button is pressed. The procedure must be in the form:

pro motion, drawId, button, xPos, yPos 

The default value is NULL.

Note
Motion events may be generated continuously in response to certain operations in IDL. As a result, if you provide an event-handler for mouse motion events, your event handler should check the reported position of the mouse to determine whether it has in fact moved before doing extensive processing.