{$I OVC.INC}

{$B-} {Complete Boolean Evaluation}
{$I+} {Input/Output-Checking}
{$P+} {Open Parameters}
{$T-} {Typed @ Operator}
{$W-} {Windows Stack Frame}
{$X+} {Extended Syntax}

{$IFNDEF Win32}
{$G+} {286 Instructions}
{$N+} {Numeric Coprocessor}

{$C MOVEABLE,DEMANDLOAD,DISCARDABLE}
{$ENDIF}

{*********************************************************}
{*                  OVCTCARY.PAS 2.00                    *}
{*     Copyright (c) TurboPower Software Co 1995-96      *}
{*                 All rights reserved.                  *}
{*********************************************************}

unit OvcTCAry;
  {-Orpheus Table - Cell Array class}

interface

{Note: this class exists for the *sole* purpose of providing a sorted
       list of cell addresses that need repainting. It has no other
       possible application. It also stores a flag that states that
       the unused bit of the table window needs painting}

uses
  SysUtils, Classes, OvcTCmmn;

type
  TOvcCellAddress = record
    Row : TRowNum;
    Col : TColNum;
  end;

  TOvcCellArray = class
    protected {private}
      {.Z+}
      FArray : pointer;
      FLimit : Integer;
      FCount : Integer;

      DoUnusedBit : boolean;
      {.Z-}

    protected
      {.Z+}
      function GetEmpty : boolean;
      {.Z-}

    public
      destructor Destroy; override;

      procedure AddCell(RowNum : TRowNum; ColNum : TColNum);
      procedure AddUnusedBit;
      procedure Clear;
      function DeleteCell(RowNum : TRowNum; ColNum : TColNum) : boolean;
      procedure GetCellAddr(Inx : Integer; var CellAddr : TOvcCellAddress);
      procedure Merge(CA : TOvcCellArray);
      function MustDoUnusedBit : boolean;

      property Count : Integer
         read FCount;

      property Empty : boolean
         read GetEmpty;
    end;

implementation
