DEFINITION Books; (* portable *)

 IMPORT Books0, Panels, Documents, Display, TextGadgets,
  Texts;

 CONST
  EOL = 0DX; Tab = 09X; quote = CHR(34);
  looksLib = 0; looksCol = 1;
  maxSect = 4;
  linkCol = 3 (*Display3.blue*); callCol = 1(*Display3.red*); noteCol = 8;
  link = 1; call = 2; note = 3;
  formated = 0; resize = 1; icon = 2; usesnotes = 3; formatText = 4; twoRow = 5;
  invalid = 15; left = 16; middle = 17; right = 18; pad = 19;
  border = 4;
  borderL = 1; borderR = 0;
  borderT = 0; borderB = 1;
  barH = 4;
  buttonW = 50; buttonH = 20;
  scrollBW = 25;

 TYPE
  TGFrame = POINTER TO TGFrameDesc;
  Panel = POINTER TO PanelDesc;
  TGFrameDesc = RECORD ( TextGadgets.FrameDesc ) 
   lastPos: LONGINT;
   panel: Panel
  END;

  PanelDesc = RECORD ( Panels.PanelDesc ) 
   doc: Documents.Document;
   iconStr: ARRAY 2*Books0.nameLen OF CHAR;
   texts, cur: Books0.TextList;
   cmds, notes: Texts.Text;
   useStack: Chain;
   imps: Books0.ImpList;
   options: SET;
   noteH: INTEGER
  END;

 VAR 
  newPos, newInd: LONGINT;
 PROCEDURE GetText (P: Panel; VAR T: TGFrame);
 PROCEDURE GetNote (P: Panel; VAR T: TGFrame);
 PROCEDURE ResizeControls (P: Panel; T: TGFrame; w: INTEGER);
 PROCEDURE ReDisplay (VAR M: Display.ModifyMsg; mode: INTEGER; broadcast: BOOLEAN);
 PROCEDURE CopyText (from: Texts.Text; VAR to: Texts.Text);
 PROCEDURE NewPanel;
 PROCEDURE NewText (P: Panel);
 PROCEDURE GetPanel (VAR P: Panel);
 PROCEDURE ShowText (P: Panel; t: Books0.TextList; pos: LONGINT);
 PROCEDURE Push (P: Panel);
 PROCEDURE GetInd (P: Panel; cur: Books0.TextList): LONGINT;
 PROCEDURE ChapUp;
 PROCEDURE ChapDown;
 PROCEDURE History (P: Panel; t: Texts.Text);
 PROCEDURE GotoText (P: Panel; ind, pos: LONGINT; sel: BOOLEAN);
 PROCEDURE GetIndex (P: Panel): Books0.TextList;
 PROCEDURE ShowFootNote (P: Panel; pos1, pos2: LONGINT);
 PROCEDURE Pop (P: Panel);

END Books.