Progress
Language Reference


DEFINE RECTANGLE Statement

Interfaces
OS
SpeedScript
All
All
No

Defines a rectangle widget for use in the current procedure.

SYNTAX

DEFINE 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 ] } 

rectangle

The name of the rectangle you are defining.

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.

SYNTAX
{ 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

SEE ALSO

FORM Statement


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