drawLine

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

The drawLine method of the Window class draws a line 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.

The line drawn by this method extends up to but does not include the end point. If this method is not called from a paint event, set the autoRedraw property to true, as shown in the method in the following example.

redrawGraph() updating;
vars
    counter : Real;
    s       : String;
begin
    self.width  := self.parent.IGXFrame.clientWidth * 4;
    self.height := self.parent.IGXFrame.clientHeight;
    self.top  := 0;
    self.left := 0;
    pixelInc  := self.clientWidth div 4 div (self.increment + 1);
    self.autoRedraw := true;
    self.clearGraphics;
    self.drawWidth := 3;
    self.drawLine(0, 0, self.clientWidth, 0, 0);
    counter := 1;
    while counter <= increment * 4 do
        self.drawLine(counter * pixelInc, 0, counter * pixelInc, 5, 0);
        counter := counter + 1;
    endwhile;
    counter := 1;
    foreach s in labelArray do
        if counter.Integer div 2 * 2 = counter.Integer then
            drawFontSize := 7;
            drawTextAt(s, (counter * pixelInc) - 14, 6, 0);
        endif;
        counter := counter + 1;
    endforeach;
end;

The drawLine method parameters are listed in the following table.

Parameter Description
x1, y1 Left and top start points of the line, respectively
x2, y2 Right and bottom end points of the line, respectively
color Color of the pen used

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