Rectangle control

A rectangle is a filled or outlined rectangular form within a window and is typically used for design purposes. For example, you can put a CommandButton or a picture in a rectangle, or you can use a rectangle behind and slightly offset from another control to create a shadow effect. When you use a rectangle to group controls, the grouping does not affect the behavior of the controls in the rectangle.

Properties

Rectangle property

Datatype

Description

ClassDefinition

PowerObject

An object of type PowerObject containing information about the class definition of the object or control.

FillColor

Long

Specifies the numeric value of the color used to fill the control: -2 to 16,777,215. For more information about color, see the section called “RGB” in PowerScript Reference.

FillPattern

FillPattern (enumerated)

Specifies the hatch pattern used to fill the control. Values are:

BDiagonal!

Diamond!

FDiagonal!

Horizontal!

Solid!

Square!

Vertical!

FDiagonal! is lines going from the lower-left to the upper-right. BDiagonal! is lines going from the upper-left to the lower-right.

Height

Integer

Specifies the height of the control, in PowerBuilder units.

LineColor

Long

Specifies the numeric value of the line color: -2 to 16,777,215. For more information about color, see the section called “RGB” in PowerScript Reference.

LineStyle

LineStyle (enumerated)

Specifies the pattern of the line used to draw the control. Values are:

Continuous!

Dash!

DashDot!

DashDotDot!

Dot!

Transparent!

LineThickness

Integer

Specifies the thickness of the line used to draw the control, in PowerBuilder units. If LineThickness is greater than one pixel (about four PowerBuilder units), the LineStyle is forced to Continuous!

Tag

String

Specifies the tag value assigned to the control.

Visible

Boolean

Specifies whether the control is visible. Values are:

TRUE -- Control is visible.

FALSE -- Control is not visible.

Width

Integer

Specifies the width of the control, in PowerBuilder units.

X

Integer

Specifies the X position (the distance from the left edge of the window), in PowerBuilder units.

Y

Integer

Specifies the Y position (the distance from the top of the window), in PowerBuilder units.


Events

Rectangle event

Occurs

Constructor in PowerScript Reference

Immediately before the Open event occurs in the window

Destructor in PowerScript Reference

Immediately after the Close event occurs in the window


Functions

Rectangle function

Datatype returned

Description

ClassName in PowerScript Reference

String

Returns the name assigned to the control

GetContextService in PowerScript Reference

Integer

Creates a reference to a context-specific instance of the specified service

GetParent in PowerScript Reference

PowerObject

Returns a reference to the name of the parent object

Hide in PowerScript Reference

Integer

Makes the control invisible

Move in PowerScript Reference

Integer

Moves the control to a specified location

PostEvent in PowerScript Reference

Boolean

Adds an event to the end of the message queue for the control

Resize in PowerScript Reference

Integer

Changes the size of the control

Show in PowerScript Reference

Integer

Makes the control visible

TriggerEvent in PowerScript Reference

Integer

Triggers a specified event in the control and executes the script for the event

TypeOf in PowerScript Reference

Object

Returns the type of the control