TApxTerminalBuffer.GetInvalidRect

TApxTerminalBuffer

function GetInvalidRect(var aRect : TRect) : Boolean;

Returns the next invalid rectangle.

An invalid rectangle is a TRect structure that defines an area of the terminal screen that needs repainting. The fields of the record, Left, Top, Right, and Bottom, define the area, not in pixels, but in row and column numbers. Thus the rectangle (1, 2, 3, 4) describes the area from the top left hand corner at row 2, column 1, to the bottom right hand corner at row 4, column 3. The row and column numbers are absolute values and do not depend on the current scrolling area, even if it activated. They are one-based values.

The return value is False if there was no invalid rectangle. Otherwise, it is True and aRect has the first invalid rectangle. The intent of this method is for the terminal display component to continually call this method, repainting the areas of the screen affected, until the method returns False.

Every change to the terminal is recorded by the terminal buffer as a list of invalid rectangles. Conceivably, there could be very many by the time the terminal emulator component comes to repainting. Rather than have the display component continually call this method to get the full list of invalid rectangles, if there are a large number, the buffer uses an optimization whereby it will merge all of the invalid rectangles into the one smallest rectangle that overlaps all of the others. This is done automatically.

See also: HasCursorMoved, HasDisplayChanged