drawSolidRectangle

drawSolidRectangle(x1:    Real;
                   y1:    Real;
                   x2:    Real;
                   y2:    Real;
                   color: Integer);

The drawSolidRectangle method of the Window class draws a rectangle on a form or control using a colored pen the width of the drawWidth property, the style of the drawStyle property, and the mode of the drawMode property.

If this method is not called from a paint event, set the autoRedraw property to true.

The figure is solidly filled using the same color as the border. The drawFillColor and drawFillStyle properties are ignored.

The drawSolidRectangle method parameters are listed in the following table.

Parameter Description
x1, y1 Left and top points of the rectangle
x2, y2 Right and bottom points of the rectangle
color Color of the pen used

The position units are Real primitive type values, in the units of the scaleMode property of the form or control.

If the width or the height of the rectangle is zero (0), the function does not draw the rectangle.

The figure drawn by this function extends up to but does not include the right and bottom coordinates, meaning that the height of the figure is y2 through y1 and the width is x2 through x1.

The figure drawn by this rectangle is equivalent to using the drawFilledRectangle method with the drawFillColor property set to the appropriate color and the drawFillStyle property set to DrawFillStyle_Solid (0).

When you use the drawFilledRectangle or drawSolidRectangle method to draw a solid rectangle, previous figures that were drawn in the history but are covered and all property settings that have been made redundant are removed. In addition, the drawLine method removes any previous lines with the same co-ordinates where the same width and drawStyle property values apply. The automatic process does not occur if you use flood-fill or after logic calls to the drawSize method.