Popup Rectangle (PopupRect)

Defines the position and size of a rectangle to use as an anchor for a popup form, in character cells or pixels. The default value is 0,0,0,0.

PopupRect="xpos{px},ypos{px},xsize{px},ysize{px} "

Values

Value

Meaning

xpos,ypos

xpospx,ypospx

Starting position of the popup window, expressed as 0, positive, or negative numbers relative to the top left corner of the widget; in character cells by default, or in pixels if px is specified.

xsize,ysize

xsizepx,ysizepx

Dimensions of the popup rectangle; in character cells by default, or in pixels if px is specified.

xsize and ysize can be 0 or larger, but not negative.

Usage

Dynamic?

Yes

Supported in Grid?

No

Dependencies:

None

Description

The PopupRect property provides precise control for positioning a popup form. It can only be set in ProcScript, using $fieldproperties.

By default, a popup form is anchored to the bottom left corner of a field and drops down to the right. The anchor corner and direction can be changed with the form's Position property, but the popup window always appears outside the widget boundaries. This not always fine-grained enough. You may want to overlay the contents of a field, or display a popup inside a large field.

When PopupRect is defined, it is used as an anchor for the popup form, instead of the widget boundaries. The top left corner of the rectangle can be inside or outside the widget.

The PopupRect property affects all popup forms anchored to a field. You can first instantiate a popup form without the PopupRect property and then set the property to instantiate another popup. If both popup instances remain open, the anchor point of the first popup changes when the size or position of the anchor field changes. This triggers Uniface to reevaluate the position of all popup instances and use the current value of the PopupRect property for all instances, even when the different popups were instantiated with a different value.

Setting in ProcScript

The following ProcScript sets the PopupRect property for field WID, and displays a form in a drop-down window.

;Detail trigger of WID field
newinstance "POPUPFRM", "Popup", "windowtype=popup"
$fieldproperties(FLD1) = "popuprect=5,1,100px,10px"
activate "Popup"
Popup Window for Popup Rectangle in Field

Popup Window for Popup Rectangle in Field

Related Topics