Release 10.1A: OpenEdge Development:
Progress 4GL Reference

> ## DEFINE RECTANGLE statement

> Defines a rectangle widget for use in the current procedure.

> Note: Does not apply to SpeedScript programming.

> #### Syntax

>     DEFINE [ PRIVATE ] RECTANGLE rectangle [ LIKE rectangle2 ]
>       [ NO-FILL ]
>       [ { EDGE-CHARS width } | { EDGE-PIXELS width } ]
>       [ DCOLOR expression ]
>       [ BGCOLOR expression ]
>       [ FGCOLOR expression ]
>       [ GRAPHIC-EDGE ]
>       [ PFCOLOR expression ]
>       [ size-phrase ]
>       [ TOOLTIP tooltip ]
>       { [ trigger-phrase ] }

> `[ PRIVATE ] RECTANGLE `rectangle``

> Defines and identifies a rectangle widget as a data member for a class, and optionally specifies an access mode for that data member. Do not specify the access mode when defining a rectangle widget for a method within a class.

> PRIVATE data members can be accessed only by the defining class. The default access mode is PRIVATE.

> Note: This option is applicable only when defining a data member for a class in a class definition (`.cls`) file.

> `RECTANGLE `rectangle``

> Identifies the name of the rectangle widget you are defining. You can define the rectangle widget in a procedure or a method within a class.

> `LIKE `rectangle2``

> Specifies a previously defined rectangle whose characteristics you want to apply to the new rectangle. If you name a rectangle with this option, you must have defined that rectangle previously in the procedure.

> `NO-FILL`

> Indicates that only the outline of the rectangle should be drawn. By default, the rectangle is filled with the background color.

> `EDGE-CHARS `width``

> Specifies the width of the rectangle outline in characters. The default width is 1. If you do not want an edge on the rectangle, specify EDGE-CHARS 0.

> `EDGE-PIXELS `width``

> Specifies the width of the rectangle outline in pixels. The default width is 1. If you do not want an edge on the rectangle, specify EDGE-PIXELS 0.

> `DCOLOR `expression``

> Specifies the fill color of the rectangle in character interfaces. This option is ignored in graphical interfaces.

> `BGCOLOR `expression``

> Specifies the background color or fill color of the rectangle in graphical interfaces. This option is ignored in character interfaces.

> `FGCOLOR `expression``

> Specifies the foreground color or edge color of the rectangle in graphical interfaces. This option is ignored in character interfaces.

> `GRAPHIC-EDGE`

> Specifies that in a character interface, the rectangle is drawn with graphic characters. This option is ignored in a graphical interface. This overrides the EDGE-CHARS and EDGE-PIXELS options. The border is one graphic unit thick.

> `PFCOLOR `expression``

> Specifies the edge color of the rectangle in character interfaces. This option is ignored in graphical interfaces. It is also ignored if you specify GRAPHIC-EDGE.

> ``size-phrase``

> Specifies the outside dimensions of the rectangle widget. This is the syntax for `size-phrase`:

>     { SIZE | SIZE-CHARS | SIZE-PIXELS } width BY height

> If you specify SIZE or SIZE-CHARS, the units are characters; if you specify SIZE-PIXELS, the units are pixels. For character units, the values `width` and `height` must be decimal constants. For pixels units, they must be integer constants. For more information, see the SIZE phrase reference entry.

> `TOOLTIP `tooltip``

> Allows you to define a help text message for a rectangle widget. Progress automatically displays this text when the user pauses the mouse button over the rectangle widget.

> You can add or change the TOOLTIP option at any time. If TOOLTIP is set to "" or the Unknown value (`?`), then the ToolTip is removed. No ToolTip is the default. The TOOLTIP option is supported in Windows only.

> ``trigger-phrase``

> Specifies application triggers for the rectangle.

> For more information, see the Trigger phrase reference entry.

> Example

> The following example uses a set of thin rectangles as lines to create graphic columns within a frame background:

> r-bkgrnd.p
>     DEFINE VARIABLE item-tot AS DECIMAL LABEL "Value" NO-UNDO.

>     DEFINE RECTANGLE vline1 SIZE .4 BY 5 EDGE-PIXELS 2.
>     DEFINE RECTANGLE vline2 LIKE vline1.
>     DEFINE RECTANGLE vline3 LIKE vline1.
>     DEFINE RECTANGLE vline4 LIKE vline1.
>     DEFINE RECTANGLE vline5 LIKE vline1.
>     DEFINE RECTANGLE vline6 LIKE vline1.

>     DEFINE RECTANGLE hline SIZE 78 BY .1 EDGE-PIXELS 2.

>     DEFINE FRAME item-info
>       item.item-num
>       item.item-name
>       item.on-hand
>       item.re-order
>       item.on-order
>       item.price
>       item-tot
>       BACKGROUND skip(1) hline
>         vline1 AT 9
>         vline2 AT 25
>         vline3 AT 33
>         vline4 AT 42
>         vline5 AT 51
>         vline6 AT 65
>       WITH TITLE "Inventory Current Value" CENTERED USE-TEXT 5 DOWN.

>     FOR EACH item NO-LOCK WITH FRAME item-info:
>       DISPLAY item.item-num
>         item.item-name
>         item.on-hand
>         item.re-order
>         item.on-order
>         item.price
>         item.on-hand * item.price @ item-tot.

> #### Notes

> - To create the static rectangle you are defining, you must define a static frame that contains the rectangle. Each frame you define that contains the same rectangle creates an additional instance of that rectangle. The widget handle for a static rectangle is not available until the rectangle is created.

> - You can specify an application-defined widget ID for a static rectangle widget using the `form-item` phrase in either the FORM statement or the DEFINE FRAME statement. See the FORM statement and DEFINE FRAME statement reference entries for more information.

> - When defining a rectangle, you must specify either the LIKE option or the size phrase.

> #### See also

> FORM statement

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095