Events in user objects

When you build a user object, you can write scripts for any event associated with that user object.

Events in class user objects

Most custom class user objects have only constructor and destructor events. Activate and deactivate events are created for EAServer and Application Server custom class user objects that you create using the Target or PB Object wizards in the New dialog box. For more information, see Application Techniques.

Table 15-1: Events for custom class user objects

Event

Occurs when

Constructor

The user object is created

Destructor

The user object is destroyed

Activate

The user object is activated in an application server (EAServer component wizard only)

Deactivate

The user object is deactivated in an application server (EAServer component wizard only)

Standard class user objects have the same events as the PowerBuilder system object from which they inherit.

Events in visual user objects

Standard visual user objects have the same events as the PowerBuilder control from which they inherit. Custom and external visual user objects have a common set of events.

Table 15-2: Events for custom and external visual user objects

Event

Occurs when

Constructor

Immediately before the Open event of the window and when the user object is dynamically placed in a window

Destructor

Immediately after the Close event of the window and when the user object is dynamically removed from a window

DragDrop

A dragged object is dropped on the user object

DragEnter

A dragged object enters the user object

DragLeave

A dragged object leaves the user object

DragWithin

A dragged object is moved within the user object

Help

A user presses the F1 key or clicks the context Help button [?] on the title bar of the window with which the menu is associated and then points and clicks on a menu item

Other

A Windows message occurs that is not a PowerBuilder event

RButtonDown

The right mouse button is pressed

For more about drag and drop, see Application Techniques.