|##########|
|#MAGIC   #|DBGFENIG
|#PROJECT #|""
|#PATHS   #|"EGSProject"
|#FLAGS   #|xx---x--x---xxx-----------------
|#USERSW  #|--------------------------------
|#USERMASK#|--------------------------------
|#SWITCHES#|x----xxxxx-xx---
|##########|
DEFINITION MODULE EGSGadBox;


TYPE ContextPtr = HIDDEN;


FROM EGSGfx    IMPORT EFontPtr;
               IMPORT IntuiGfx,Trees;
FROM System    IMPORT LONGSET,Regs,SysStringPtr;
               IMPORT EGSIntui AS I;
               IMPORT Exec,EGS;

TYPE
  GadBoxPtr   = POINTER TO GadBox;

  DEFINITION MODULE GadBoxTrees = Trees.StdTrees(GadBoxPtr);

TYPE
  ResBoxPtr   = POINTER TO ResBox;
  ResBox      = RECORD
                  x,y,w,h : INTEGER
                END;

  InfoBoxPtr  = POINTER TO InfoBox;
  InfoBox     = RECORD
                  font    : EFontPtr;
                  justify : I.StringJustify;
                  box     : ResBox;
                END;

  MultiPanelPtr = POINTER TO MultiPanel;
  MultiPanel    = RECORD
                    num,
                    active  : INTEGER;
                    data    : POINTER TO ARRAY OF I.GadgetPtr;
                  END;


  FillFlags   = (fillLeft,
                 fillRight,
                 fillTop,
                 fillBottom);
  FillFlagSet = SET OF FillFlags;

  Orientation = (horizontal,
                 vertical,
                 unknown,
                 horizTable,
                 vertiTable,
                 select);

  GadBoxType  = (gbGadget,
                 gbDraw,
                 gbWindow,
                 gbLate,
                 gbResponse);

  GBCreate    = PROCEDURE(box IN A0 : GadBoxPtr);

  GadContextFlags   = (ownFont,ownTFont);
  GadContextFlagSet = SET OF GadContextFlags;

  GadContext  = POINTER TO GadContextNode;

  GBFlags           = (SameSize);
  GBFlagSet         = SET OF GBFlags;

  GadBox      = RECORD OF GadBoxTrees.Leaf;
                  orient     : Orientation;
                  minWidth,
                  maxWidth,
                  minHeight,
                  maxHeight  : INTEGER;
                  x,y        : INTEGER;
                  pri        : SHORTINT;
                  con        : GadContext;
                  IF KEY type : GadBoxType
                    OF gbGadget THEN gad  : I.GadgetPtr;
                    OF gbDraw   THEN draw    : I.IntuiGfxPtr;
                    OF gbWindow THEN new  : POINTER TO I.NewWindow;
                    OF gbLate   THEN call : GBCreate;
                    OF gbResponse THEN res : ResBoxPtr

                  END;
                  selector   : PROCEDURE(to  IN A0 : GadBoxPtr;
                                         num IN D0 : INTEGER;
                                         gfx IN A1 : IntuiGfx.IntuiGfxPtr);
                  userData   : ANYPTR;
                  flags      : GBFlagSet;

                  cMinWidth,
                  cMaxWidth,
                  cMinHeight,
                  cMaxHeight  : INTEGER;
                  IF KEY cType : GadBoxType
                    OF gbGadget,gbWindow,gbDraw THEN
                      cRender     : I.IntuiGfxPtr;
                    OF gbResponse THEN
                      cRes        : ResBoxPtr;
                  END
                END;

  GadContextNode =
                  RECORD
                    gadres,
                    helpres  : ContextPtr;
                    fHeight,
                    fWidth   : INTEGER;
                    font,
                    tfont    : EFontPtr;
                    newWin   : POINTER TO I.NewWindow;
                    first    : I.GadgetPtr;
                    num      : INTEGER;
                    color,
                    back     : LONGINT;
                    flags    : GadContextFlagSet;
                    error    : (Ok,
                                NotEnoughMemory=$4000,
                                UnknownWithMultipleSons,
                                StringGadNotFound,
                                IllegalSelect,
                                UnknownFont,
                                NoWindow,
                                NoGadSolution,
                                BadFonts,
                                UnmatchingTables);
                    quickBox : POINTER TO ARRAY [32] OF GadBox;
                    quickNum : INTEGER;

                    lateRes  : ContextPtr;

                    tfWidth,
                    tfHeight : INTEGER;

                    sizeHook : I.ResizeHook;
                    win      : I.WindowPtr;
                    root     : GadBoxPtr;
                  END;
  StrArray    = ARRAY OF SysStringPtr;
  StrArrayPtr = POINTER TO StrArray;
  StrArray2   = ARRAY OF StrArrayPtr;
  StrArray2Ptr= POINTER TO StrArray2;

  GadBoxArray = ARRAY OF GadBoxPtr;
  GadBoxArrayPtr = POINTER TO GadBoxArray;

CONST
  SuperPropType  = CAST(LONGINT,"SPRP".data);

TYPE
  SPropGadPtr    = POINTER TO SPropGadget;
  SPropGadget    = RECORD OF I.MasterGadget
                     realProp : I.PropGadPtr;
                   END;

CONST
  max        = INTEGER'MAX;
  min        = 0;
  AllFill    = FillFlagSet:{fillLeft..fillBottom};

TYPE ArrowFlags   = (aDecUL,aDecBR,aIncUL,aIncBR);
     ArrowFlagSet = SET OF ArrowFlags;

VAR
  EGBBase    : Exec.LibraryPtr;

LIBRARY EGBBase BY -30  PROCEDURE AllocMemCon(con IN A0 : ContextPtr;size IN D0 : LONGINT):ANYPTR;

LIBRARY EGBBase BY -36  PROCEDURE FreeMemCon(mem IN A0 : ANYPTR);

LIBRARY EGBBase BY -42  PROCEDURE AddFirstSon(father IN A0,son IN A1 : GadBoxPtr);

LIBRARY EGBBase BY -48  PROCEDURE AddLastSon(father IN A0,son IN A1 : GadBoxPtr);

LIBRARY EGBBase BY -54  PROCEDURE MIN(a IN D0,b IN D1 : INTEGER):INTEGER;

LIBRARY EGBBase BY -60  PROCEDURE MAX(a IN D0,b IN D1 : INTEGER):INTEGER;

LIBRARY EGBBase BY -66  PROCEDURE SWidth(REF s IN A0 : STRING;f IN A1 : EFontPtr):INTEGER;

LIBRARY EGBBase BY -72  PROCEDURE SMatch(REF s IN A0 : STRING;
                                             f IN A1 : EFontPtr;
                                             w IN D2 : INTEGER):INTEGER;

LIBRARY EGBBase BY -78  PROCEDURE CWidth(c2 IN D2 : CHAR;f IN A1 : EFontPtr):INTEGER;

LIBRARY EGBBase BY -84  PROCEDURE FindGadget(first IN A0 : I.GadgetPtr;
                                             num   IN D0 : INTEGER;
                                             id    IN D1 : LONGINT):I.GadgetPtr;



LIBRARY EGBBase BY -90  PROCEDURE CreateGadContext(font  IN A0,
                                                   tfont IN A1  : EFontPtr;
                                                   color IN D0,
                                                   back  IN D1  : LONGINT):GadContext;

LIBRARY EGBBase BY -96  PROCEDURE DeleteGadContext(con IN A0 : GadContext);


LIBRARY EGBBase BY -102 PROCEDURE CreateBox(con        IN A0 : GadContext;
                                            orient     IN D0 : Orientation;
                                            minWidth   IN D1,
                                            maxWidth   IN D2,
                                            minHeight  IN D3,
                                            maxHeight  IN D4 : INTEGER):GadBoxPtr;

LIBRARY EGBBase BY -108 PROCEDURE CreateLateBox(con       IN A0 : GadContext;
                                                create    IN A1 : GBCreate;
                                                minWidth  IN D0,
                                                maxWidth  IN D1,
                                                minHeight IN D2,
                                                maxHeight IN D3 : INTEGER):GadBoxPtr;

LIBRARY EGBBase BY -114 PROCEDURE CreateResponseBox(    con       IN A0 : GadContext;
                                                    VAR response  IN A1 : ResBox;
                                                        minWidth  IN D0,
                                                        maxWidth  IN D1,
                                                        minHeight IN D2,
                                                        maxHeight IN D3 : INTEGER):GadBoxPtr;

LIBRARY EGBBase BY -120 PROCEDURE CreateInfoBox(    con      IN A0 : GadContext;
                                                VAR info     IN A1 : InfoBox;
                                                    font     IN A2 : EFontPtr;
                                                    minWidth IN D0,
                                                    maxWidth IN D1 : INTEGER;
                                                    justify  IN D2 : I.StringJustify):GadBoxPtr;

LIBRARY EGBBase BY -126 PROCEDURE WriteInfoBox(REF info IN A0 : InfoBox;
                                                   win  IN A1 : I.WindowPtr;
                                               REF str  IN A2 : STRING);

LIBRARY EGBBase BY -132 PROCEDURE WriteInfoBoxInt(REF info IN A0 : InfoBox;
                                                      win  IN A1 : I.WindowPtr;
                                                      i    IN D0 : LONGINT);


LIBRARY EGBBase BY -138 PROCEDURE CreateHorizBox(con IN A0 : GadContext):GadBoxPtr;

PROCEDURE CreateHorizBoxL(con : GadContext;sons : LIST OF GadBoxPtr):GadBoxPtr;

LIBRARY EGBBase BY -144 PROCEDURE CreateVertiBox(con IN A0 : GadContext):GadBoxPtr;

PROCEDURE CreateVertiBoxL(con : GadContext;sons : LIST OF GadBoxPtr):GadBoxPtr;

LIBRARY EGBBase BY -150 PROCEDURE CreateHorizTable(con IN A0 : GadContext):GadBoxPtr;

PROCEDURE CreateHorizTableL(con : GadContext;sons : LIST OF GadBoxPtr):GadBoxPtr;

LIBRARY EGBBase BY -156 PROCEDURE CreateVertiTable(con IN A0 : GadContext):GadBoxPtr;

PROCEDURE CreateVertiTableL(con : GadContext;sons : LIST OF GadBoxPtr):GadBoxPtr;

LIBRARY EGBBase BY -162 PROCEDURE CreateFillBox(con IN A0 : GadContext;pri IN D0 : SHORTINT):GadBoxPtr;

LIBRARY EGBBase BY -168 PROCEDURE CreateHorizFill(con  IN A0 : GadContext;
                                                  fill IN D0 : BOOLEAN;
                                                  pri  IN D1 : SHORTINT):GadBoxPtr;

LIBRARY EGBBase BY -174 PROCEDURE CreateVertiFill(con  IN A0 : GadContext;
                                                  fill IN D0 : BOOLEAN;
                                                  pri  IN D1 : SHORTINT):GadBoxPtr;

LIBRARY EGBBase BY -180 PROCEDURE CreateBorder(con    IN A0 : GadContext;
                                               around IN A1 : GadBoxPtr;
                                               fill   IN D0 : FillFlagSet):GadBoxPtr;



LIBRARY EGBBase BY -186 PROCEDURE CreateText(con IN A0 : GadContext;REF s IN A1 : STRING):GadBoxPtr;

LIBRARY EGBBase BY -516 PROCEDURE CreateUText(    con IN A0 : GadContext;
                                              REF s   IN A1 : STRING;
                                              VAR c   IN A2 : CHAR):GadBoxPtr;

LIBRARY EGBBase BY -192 PROCEDURE CreateCenterText(con IN A0 : GadContext;REF s IN A1 : STRING):GadBoxPtr;

LIBRARY EGBBase BY -198 PROCEDURE CreateBackBorder(con    IN A0 : GadContext;
                                                   around IN A1 : GadBoxPtr;
                                                   fill   IN D0 : FillFlagSet):GadBoxPtr;

LIBRARY EGBBase BY -204 PROCEDURE CreateFrontBorder(con    IN A0 : GadContext;
                                                    around IN A1 : GadBoxPtr;
                                                    fill   IN D0 : FillFlagSet):GadBoxPtr;

LIBRARY EGBBase BY -210 PROCEDURE CreateButton24(con    IN A0 : GadContext;
                                                 around IN A1 : GadBoxPtr;
                                                 color  IN D0,
                                                 back   IN D1 : LONGINT;
                                                 fill   IN D2 : FillFlagSet):GadBoxPtr;

LIBRARY EGBBase BY -216 PROCEDURE CreateDoubleBorder(con    IN A0 : GadContext;
                                                     around IN A1 : GadBoxPtr;
                                                     fill   IN D0 : FillFlagSet):GadBoxPtr;


LIBRARY EGBBase BY -504 PROCEDURE CreateGroupBorder(    con    IN A0 : GadContext;
                                                        around IN A1 : GadBoxPtr;
                                                        fill   IN D0 : FillFlagSet;
                                                    REF name   IN A2 : STRING):GadBoxPtr;

LIBRARY EGBBase BY -222 PROCEDURE CreateMultiText(con IN A0 : GadContext;text IN A1 : StrArrayPtr):GadBoxPtr;

LIBRARY EGBBase BY -228 PROCEDURE CreateBoxedMultiText(con  IN A0 : GadContext;
                                                       text IN A1 : StrArrayPtr):GadBoxPtr;

                        | 0 : Oben, 1: Unten, 2: Links, 3: Rechts;
LIBRARY EGBBase BY -234 PROCEDURE CreateArrowGfx(con IN A0 : GadContext;dest IN D0 : INTEGER):GadBoxPtr;


LIBRARY EGBBase BY -240 PROCEDURE NewPri(box IN A0 : GadBoxPtr;pri IN D0 : SHORTINT):GadBoxPtr;

LIBRARY EGBBase BY -246 PROCEDURE NewMinHeight(box IN A0 : GadBoxPtr;height IN D0 : INTEGER):GadBoxPtr;

LIBRARY EGBBase BY -252 PROCEDURE NewMinWidth(box IN A0 : GadBoxPtr;width IN D0 : INTEGER):GadBoxPtr;

LIBRARY EGBBase BY -258 PROCEDURE NewMaxHeight(box IN A0 : GadBoxPtr;height IN D0 : INTEGER):GadBoxPtr;

LIBRARY EGBBase BY -264 PROCEDURE NewMaxWidth(box IN A0 : GadBoxPtr;width IN D0 : INTEGER):GadBoxPtr;

LIBRARY EGBBase BY -270 PROCEDURE NewFixHeight(box IN A0 : GadBoxPtr):GadBoxPtr;

LIBRARY EGBBase BY -276 PROCEDURE NewFixWidth(box IN A0 : GadBoxPtr):GadBoxPtr;

LIBRARY EGBBase BY -480 PROCEDURE NewSameSize(box IN A0 : GadBoxPtr):GadBoxPtr;

LIBRARY EGBBase BY -522 PROCEDURE NewHotKey(box IN A0 : GadBoxPtr;key IN D0 : CHAR):GadBoxPtr;

LIBRARY EGBBase BY -282 PROCEDURE CreateMaster(con  IN A0 : GadContext;
                                               type IN D0 : LONGINT;
                                               id   IN D1 : LONGINT):GadBoxPtr;

LIBRARY EGBBase BY -288 PROCEDURE CreateActionGadget(con   IN A0 : GadContext;
                                                     with  IN A1 : GadBoxPtr;
                                                     id    IN D0 : LONGINT):GadBoxPtr;

LIBRARY EGBBase BY -294 PROCEDURE CreateTextAction(    con   IN A0 : GadContext;
                                                   REF name  IN A1 : STRING;
                                                       id    IN D0 : LONGINT;
                                                       fill  IN D1 : FillFlagSet):GadBoxPtr;


LIBRARY EGBBase BY -300 PROCEDURE CreateBoolGadget(con   IN A0 : GadContext;
                                                   with  IN A1 : GadBoxPtr;
                                                   id    IN D0 : LONGINT):GadBoxPtr;

LIBRARY EGBBase BY -306 PROCEDURE CreateTextBoolean(    con   IN A0 : GadContext;
                                                    REF name  IN A1 : STRING;
                                                        id    IN D0 : LONGINT;
                                                        fill  IN D1 : FillFlagSet):GadBoxPtr;

LIBRARY EGBBase BY -312 PROCEDURE CreateMultiAction(con   IN A0 : GadContext;
                                                    names IN A1 : StrArrayPtr;
                                                    ids   IN D0 : LONGINT;
                                                    fill  IN D1 : FillFlagSet):GadBoxPtr;

LIBRARY EGBBase BY -318 PROCEDURE CreateMultiActionV(con   IN A0 : GadContext;
                                                     names IN A1 : StrArrayPtr;
                                                     ids   IN D0 : LONGINT;
                                                     fill  IN D1 : FillFlagSet):GadBoxPtr;

LIBRARY EGBBase BY -324 PROCEDURE CreateMultiAction2(con   IN A0 : GadContext;
                                                     names IN A1 : StrArray2Ptr;
                                                     ids   IN D0 : LONGINT):GadBoxPtr;

LIBRARY EGBBase BY -486 PROCEDURE CreateButtonGadget(con  IN A0 : GadContext;
                                                     id   IN D0 : LONGINT):GadBoxPtr;

LIBRARY EGBBase BY -492 PROCEDURE CreateCheckmarkGadget(con  IN A0 : GadContext;
                                                        id   IN D0 : LONGINT):GadBoxPtr;

LIBRARY EGBBase BY -510 PROCEDURE CreateDropGadget(con     IN A0 : GadContext;
                                                   with    IN A1 : GadBoxPtr;
                                                   accepts IN A2 : I.AcceptListPtr;
                                                   flags   IN D0 : I.DropFlagSet;
                                                   id      IN D1 : LONGINT):GadBoxPtr;


LIBRARY EGBBase BY -330 PROCEDURE CreateArrow(con  IN A0 : GadContext;
                                              dest IN D0 : INTEGER;
                                              id   IN D1 : LONGINT):GadBoxPtr;

LIBRARY EGBBase BY -336 PROCEDURE CreateHorizProp(con      IN A0 : GadContext;
                                                  maximum  IN D0,
                                                  size     IN D1,
                                                  val      IN D2 : INTEGER;
                                                  id       IN D3 : LONGINT):GadBoxPtr;

LIBRARY EGBBase BY -342 PROCEDURE CreateVertiProp(con      IN A0: GadContext;
                                                  maximum  IN D0,
                                                  size     IN D1,
                                                  val      IN D2 : INTEGER;
                                                  id       IN D3 : LONGINT):GadBoxPtr;


LIBRARY EGBBase BY -348 PROCEDURE CreateSuperHorizProp(con      IN A0: GadContext;
                                                       maximum  IN D0,
                                                       size     IN D1,
                                                       value    IN D2 : INTEGER;
                                                       id       IN D3 : LONGINT;
                                                       flags    IN D4 : ArrowFlagSet):GadBoxPtr;

LIBRARY EGBBase BY -354 PROCEDURE CreateSuperVertiProp(con      IN A0 : GadContext;
                                                       maximum  IN D0,
                                                       size     IN D1,
                                                       value    IN D2 : INTEGER;
                                                       id       IN D3 : LONGINT;
                                                       flags    IN D4 : ArrowFlagSet):GadBoxPtr;
LIBRARY EGBBase BY -528 PROCEDURE SetPropBackMap(con      IN A0 : GadContext;
                                                 win      IN A1 : I.WindowPtr;
                                                 gad      IN A2 : I.PropGadPtr;
                                                 map      IN A3 : EGS.EBitMapPtr);

LIBRARY EGBBase BY -360 PROCEDURE CreateStringGadget(con     IN A0 : GadContext;
                                                     minChar IN D0 : INTEGER;
                                                     buffLen IN D1 : INTEGER;
                                                     justify IN D2 : I.StringJustify;
                                                     id      IN D3 : LONGINT):GadBoxPtr;

LIBRARY EGBBase BY -366 PROCEDURE CreateNameStringGadget(    con     IN A0 : GadContext;
                                                         REF name    IN A1 : STRING;
                                                             minChar IN D0 : INTEGER;
                                                             buffLen IN D1 : INTEGER;
                                                             justify IN D2 : I.StringJustify;
                                                             id      IN D3 : LONGINT):GadBoxPtr;


LIBRARY EGBBase BY -372 PROCEDURE CreateIntegerGadget(con     IN A0 : GadContext;
                                                      minChar IN D0 : INTEGER;
                                                      digits  IN D1 : INTEGER;
                                                      id      IN D2 : LONGINT):GadBoxPtr;

LIBRARY EGBBase BY -378 PROCEDURE CreateNameIntegerGadget(    con     IN A0 : GadContext;
                                                          REF name    IN A1 : STRING;
                                                              minChar IN D0 : INTEGER;
                                                              digits  IN D1 : INTEGER;
                                                              id      IN D2 : LONGINT):GadBoxPtr;


LIBRARY EGBBase BY -384 PROCEDURE CreateRealGadget(con     IN A0 : GadContext;
                                                   minChar IN D0 : INTEGER;
                                                   digits  IN D1 : INTEGER;
                                                   id      IN D2 : LONGINT):GadBoxPtr;

LIBRARY EGBBase BY -390 PROCEDURE CreateNameRealGadget(    con     IN A0 : GadContext;
                                                       REF name    IN A1 : STRING;
                                                           minChar IN D0 : INTEGER;
                                                           digits  IN D1 : INTEGER;
                                                           id      IN D2 : LONGINT):GadBoxPtr;


LIBRARY EGBBase BY -396 PROCEDURE LinkStringGadgets(con     IN A0 : GadContext;
                                                    from    IN A1,
                                                    to      IN A2 : GadBoxPtr):BOOLEAN;


LIBRARY EGBBase BY -402 PROCEDURE LinkStringGadgetsID(con     IN A0 : GadContext;
                                                      from    IN D0,
                                                      to      IN D1 : LONGINT;
                                                      first   IN A1 : I.GadgetPtr;
                                                      num     IN D2 : INTEGER):BOOLEAN;

LIBRARY EGBBase BY -408 PROCEDURE C_GetStringData(gad IN A0 : I.StringGadPtr;
                                                  str IN A1 : SysStringPtr);

                        PROCEDURE GetStringData(    gad IN A0 : I.StringGadPtr;
                                                VAR str IN A1 : STRING);

LIBRARY EGBBase BY -414 PROCEDURE PutStringData(    win IN A0 : I.WindowPtr;
                                                    gad IN A1 : I.StringGadPtr;
                                                REF str IN A2 : STRING);

LIBRARY EGBBase BY -420 PROCEDURE PutIntData(win IN A0 : I.WindowPtr;
                                             gad IN A1 : I.IntGadPtr;
                                             val IN D0 : LONGINT);

LIBRARY EGBBase BY -426 PROCEDURE PutRealData(win    IN A0 : I.WindowPtr;
                                              gad    IN A1 : I.RealGadPtr;
                                              val    IN D0 : LONGREAL;
                                              field  IN D2 : INTEGER;
                                              digits IN D3 : INTEGER;
                                              exp    IN D4 : BOOLEAN);

LIBRARY EGBBase BY -432 PROCEDURE CreateWindow(con   IN A0 : GadContext;
                                               left  IN D0,
                                               top   IN D1 : INTEGER):GadBoxPtr;

LIBRARY EGBBase BY -438 PROCEDURE CreateMasterWindow(con  IN A0 : GadContext;
                                                     win  IN A1 : I.WindowPtr;
                                                     with IN A2 : GadBoxPtr):GadBoxPtr;




LIBRARY EGBBase BY -444 PROCEDURE CalcMinMax(box IN A0 : GadBoxPtr):BOOLEAN;

LIBRARY EGBBase BY -450 PROCEDURE CalcRealSize(box IN A0 : GadBoxPtr):BOOLEAN;

LIBRARY EGBBase BY -456 PROCEDURE CalcPositions(box IN A0 : GadBoxPtr;
                                                x   IN D0,
                                                y   IN D1 : INTEGER):BOOLEAN;

LIBRARY EGBBase BY -462 PROCEDURE CalcGadgetGfx(con IN A0 : GadContext;
                                                box IN A1 : GadBoxPtr):BOOLEAN;

LIBRARY EGBBase BY -468 PROCEDURE ConnectGadgets(    box   IN A0 : GadBoxPtr;
                                                 VAR first IN A1 : I.GadgetPtr;
                                                 VAR num   IN A2 : INTEGER);

LIBRARY EGBBase BY -474 PROCEDURE ProcessGadBoxes(con  IN A0 : GadContext;
                                                  root IN A1 : GadBoxPtr):BOOLEAN;

LIBRARY EGBBase BY -498 PROCEDURE ProcessGadBoxesSize(con  IN A0 : GadContext;
                                                      root IN A1 : GadBoxPtr;
                                                      w    IN D0 : INTEGER;
                                                      h    IN D1 : INTEGER):BOOLEAN;

LIBRARY EGBBase BY -534 PROCEDURE ProcessGadBoxesResize(con  IN A0 : GadContext;
                                                        root IN A1 : GadBoxPtr;
                                                        win  IN A2 : I.WindowPtr;
                                                        w    IN D0 : INTEGER;
                                                        h    IN D1 : INTEGER):BOOLEAN;

LIBRARY EGBBase BY -540 PROCEDURE OpenGadWindow(con IN A0 : GadContext):I.WindowPtr;

LIBRARY EGBBase BY -546 PROCEDURE CloseGadWindow(con IN A0 : GadContext);

LIBRARY EGBBase BY -552 PROCEDURE NewPropFollow(box IN A0 : GadBoxPtr):GadBoxPtr;

LIBRARY EGBBase BY -558 PROCEDURE GetGadget(box IN A0 : GadBoxPtr;VAR gad IN A1 : I.GadgetPtr):GadBoxPtr;

LIBRARY EGBBase BY -564 PROCEDURE CreateTextCheckmark(con IN A0 : GadContext;text IN A1 : SysStringPtr;id IN D0 : LONGINT):GadBoxPtr;

LIBRARY EGBBase BY -570 PROCEDURE CreateTextCircleButton(con IN A0 : GadContext;text IN A1 : SysStringPtr;id IN D0 : LONGINT):GadBoxPtr;


LIBRARY EGBBase BY -576 PROCEDURE GCFindGadget(con IN A0 : GadContext;id IN D0 : LONGINT):I.GadgetPtr;

LIBRARY EGBBase BY -582 PROCEDURE GCSetIntValue(con IN A0 : GadContext;id IN D0 : LONGINT;val IN D1 : LONGINT);

LIBRARY EGBBase BY -588 PROCEDURE GCGetIntValue(con IN A0 : GadContext;id IN D0 : LONGINT):LONGINT;

LIBRARY EGBBase BY -594 PROCEDURE GCSetRealValue(con IN A0 : GadContext;id IN D0 : LONGINT;
                                                 val    IN D1 : LONGREAL;
                                                 field  IN D2 : INTEGER;
                                                 digits IN D3 : INTEGER;
                                                 exp    IN D4 : BOOLEAN);

LIBRARY EGBBase BY -600 PROCEDURE GCGetRealValue(con IN A0 : GadContext;id IN D0 : LONGINT):LONGREAL;

LIBRARY EGBBase BY -606 PROCEDURE GCSetStringValue(con IN A0 : GadContext;id IN D0 : LONGINT;val IN A1 : SysStringPtr);

LIBRARY EGBBase BY -612 PROCEDURE GCGetStringValue(con IN A0 : GadContext;id IN D0 : LONGINT;val IN A1 : SysStringPtr;len IN D1 : INTEGER):INTEGER;

LIBRARY EGBBase BY -618 PROCEDURE GCSetBoolValue(con IN A0 : GadContext;id IN D0 : LONGINT;val IN D1 : BOOLEAN);

LIBRARY EGBBase BY -624 PROCEDURE GCGetBoolValue(con IN A0 : GadContext;id IN D0 : LONGINT):BOOLEAN;

LIBRARY EGBBase BY -630 PROCEDURE GCSetPropValue(con IN A0 : GadContext;id IN D0 : LONGINT;
                                                 val IN D1,size IN D2,max IN D3 : INTEGER);

LIBRARY EGBBase BY -636 PROCEDURE GCGetPropValue(con IN A0 : GadContext;id IN D0 : LONGINT):INTEGER;

LIBRARY EGBBase BY -642 PROCEDURE GCOnGadget(con IN A0 : GadContext;id IN D0 : LONGINT);

LIBRARY EGBBase BY -648 PROCEDURE GCOffGadget(con IN A0 : GadContext;id IN D0 : LONGINT);

LIBRARY EGBBase BY -654 PROCEDURE GCLinkStringGadgets(con IN A0 : GadContext;from IN D0,to IN D1 : LONGINT);

LIBRARY EGBBase BY -660
    PROCEDURE CreateMultiPanel(    con   IN A0 : GadContext;
                               VAR panel IN A1 : MultiPanel;
                                   boxes IN A2 : GadBoxArrayPtr):GadBoxPtr;

PROCEDURE CreateMultiPanelL(    con   : GadContext;
                            VAR panel : MultiPanel;
                                boxes : LIST OF GadBoxPtr):GadBoxPtr;

LIBRARY EGBBase BY -666
    PROCEDURE SetMultiPanel(    win   IN A0 : I.WindowPtr;
                            REF panel IN A1 : MultiPanel;
                                sel   IN D0 : INTEGER);

|-552 CloseGadWindow


END EGSGadBox.

