DoubleClicked

Description

Occurs when the user double-clicks in a DataWindow control.

PowerBuilder event information Event ID: pbm_dwnlbuttondblclk

Argument

Description

xpos

Integer by value. The distance of the pointer from the left side of the DataWindow’s workspace. The distance is given in pixels.

ypos

Integer by value. The distance of the pointer from the top of the DataWindow’s workspace. The distance is given in pixels.

row

Long by value. The number of the row the user double-clicked.

If the user did not double-click on a row, the value of the row argument is 0. For example, row is 0 when the user double-clicks outside the data area, in text or spaces between rows, or in the header, summary, or footer area.

dwo

DWObject by value. A reference to the control within the DataWindow the user double-clicked.

Web ActiveX event information Event name: DblClick

Argument

Description

Button

Number. A value that is the sum of the values of the buttons the user clicked. Values are:

  • 1 Left button

  • 2 Right button

  • 4 Middle button

The PowerBuilder DoubleClicked event is always the left mouse button, but in the MouseUp event for the Web ActiveX, you have to check which button was pressed.

XPos

Number. The distance of the pointer from the left side of the DataWindow’s workspace. The distance is given in pixels.

YPos

Number. The distance of the pointer from the top of the DataWindow’s workspace. The distance is given in pixels.

Row

Number. The number of the row the user double-clicked.

If the user did not double-click on a row, the value of the Row argument is 0. For example, Row is 0 when the user double-clicks outside the data area, in text or spaces between rows, or in the header, summary, or footer area.

Name

String. The name of the control within the DataWindow that the user double-clicked.

Returns

There are no special outcomes for this event. The only code is:

Usage

The dwo, Name, or DWObject argument provides easy access to the control the user clicks. You do not need to know the coordinates of elements within the DataWindow to program control-specific responses to the user’s clicks. For example, you can prevent editing of a column and use the Clicked event to set data or properties for the column and row the user clicks.

PowerBuilder programming note The xpos and ypos arguments provide the same values the functions PointerX and PointerY return when you call them for the DataWindow control.

Examples

Example 1

This example displays a message box reporting the row and column clicked and the position of the pointer relative to the upper-left corner of the DataWindow control:

string ls_columnname


IF dwo.Type = "column" THEN

		ls_columnname = dwo.Name

END IF


MessageBox("DoubleClicked Event", &

		"Row number: " + row &

		+ "~rColumn name: " + ls_columnname &

		+ "~rDistance from top of dw: " + ypos &

		+ "~rDistance from left side of dw: " + xpos)

See also