|##########|
|#MAGIC   #|DBGFFCAF
|#PROJECT #|""
|#PATHS   #|"StdProject"
|#FLAGS   #|xx---x--x---xxx--x--------------
|#USERSW  #|--------------------------------
|#USERMASK#|--------------------------------
|#SWITCHES#|x----x----------
|##########|
DEFINITION MODULE GBScrollBox;

FROM System IMPORT Regs;
FROM EGSGfx IMPORT EFontPtr;
IMPORT EGSIntui AS I;
IMPORT EGSGadBox AS GB;
FROM Exec IMPORT List,ListPtr,Node,NodePtr,LibraryPtr;


TYPE
  ScrollGadPtr = POINTER TO ScrollGadget;
  ScrollGadget = RECORD OF I.MasterGadget
                   pixWidth,
                   pixHeight,
                   width,
                   height   : INTEGER;
                   scroller : GB.SPropGadPtr;
                   list     : List;
                   actText,
                   topText  : NodePtr;
                   font     : EFontPtr;
                   selects  : I.GadgetPtr;
                   sort     : BOOLEAN;
                   string   : I.StringGadPtr;
                 END;

CONST
  SuperScrType   = CAST(LONGINT,"SLCT".data);

VAR
  GBScrollBase : LibraryPtr;

LIBRARY GBScrollBase BY - 30
    PROCEDURE CreateLateScrollBox(con       IN A0 : GB.GadContext;
                                  minWidth  IN D0,
                                  maxWidth  IN D1,
                                  minHeight IN D2,
                                  maxHeight IN D3 : INTEGER;
                                  sort      IN D4 : BOOLEAN;
                                  id        IN D5 : LONGINT):GB.GadBoxPtr;

LIBRARY GBScrollBase BY - 36
    PROCEDURE AddItemToScrollBox(win  IN A0 : I.WindowPtr;
                                 gad  IN A1 : ScrollGadPtr;
                                 item IN A2 : NodePtr);

LIBRARY GBScrollBase BY - 42
    PROCEDURE AddListToScrollBox(win  IN A0 : I.WindowPtr;
                                 gad  IN A1 : ScrollGadPtr;
                                 list IN A2 : ListPtr);

LIBRARY GBScrollBase BY - 48
    PROCEDURE RemItemFromScrollBox(win  IN A0 : I.WindowPtr;
                                   gad  IN A1 : ScrollGadPtr;
                                   item IN A2 : NodePtr);

LIBRARY GBScrollBase BY - 54
    PROCEDURE UpdateScrollBox(win  IN A0 : I.WindowPtr;
                              gad  IN A1 : ScrollGadPtr);

LIBRARY GBScrollBase BY - 60
    PROCEDURE RemListFromScrollBox(win  IN A0 : I.WindowPtr;
                                   gad  IN A1 : ScrollGadPtr;
                                   list IN A2 : ListPtr);

LIBRARY GBScrollBase BY - 66
    PROCEDURE NextElem(win  IN A0 : I.WindowPtr;
                       gad  IN A1 : ScrollGadPtr);

LIBRARY GBScrollBase BY - 72
    PROCEDURE PrevElem(win  IN A0 : I.WindowPtr;
                       gad  IN A1 : ScrollGadPtr);

LIBRARY GBScrollBase BY - 78
    PROCEDURE ActivateElem(win  IN A0 : I.WindowPtr;
                           gad  IN A1 : ScrollGadPtr;
                           elem IN A2 : NodePtr);

LIBRARY GBScrollBase BY - 84
    PROCEDURE SetTopElem(win  IN A0 : I.WindowPtr;
                         gad  IN A1 : ScrollGadPtr;
                         elem IN A2 : NodePtr);

LIBRARY GBScrollBase BY - 90
    PROCEDURE LinkStringToScroll(scroll IN A0 : ScrollGadPtr;
                                 string IN A1 : I.StringGadPtr);


LIBRARY GBScrollBase BY - 96
    PROCEDURE GCAddItemToScrollBox(con  IN A0 : GB.GadContext;
                                   id   IN D0 : LONGINT;
                                   item IN A1 : NodePtr);

LIBRARY GBScrollBase BY -102
    PROCEDURE GCRemItemFromScrollBox(con  IN A0 : GB.GadContext;
                                     id   IN D0 : LONGINT;
                                     item IN A1 : NodePtr);

LIBRARY GBScrollBase BY -108
    PROCEDURE GCAddListToScrollBox(con  IN A0 : GB.GadContext;
                                   id   IN D0 : LONGINT;
                                   list IN A1 : ListPtr);

LIBRARY GBScrollBase BY -114
    PROCEDURE GCRemListFromScrollBox(con  IN A0 : GB.GadContext;
                                     id   IN D0 : LONGINT;
                                     list IN A1 : ListPtr);

LIBRARY GBScrollBase BY -120
    PROCEDURE GCChangeListInScrollBox(con  IN A0 : GB.GadContext;
                                      id   IN D0 : LONGINT;
                                      old  IN A1 : ListPtr;
                                      new  IN A2 : ListPtr);

LIBRARY GBScrollBase BY -126
    PROCEDURE GCNextItem(con  IN A0 : GB.GadContext;
                         id   IN D0 : LONGINT);

LIBRARY GBScrollBase BY -132
    PROCEDURE GCPrevItem(con  IN A0 : GB.GadContext;
                         id   IN D0 : LONGINT);

LIBRARY GBScrollBase BY -138
    PROCEDURE GCSetScrollBoxValue(con  IN A0 : GB.GadContext;
                                  id   IN D0 : LONGINT;
                                  item IN A1 : NodePtr);

LIBRARY GBScrollBase BY -144
    PROCEDURE GCGetScrollBoxValue(con  IN A0 : GB.GadContext;
                                  id   IN D0 : LONGINT):NodePtr;

LIBRARY GBScrollBase BY -160
    PROCEDURE GCSetScrollBoxTop(con  IN A0 : GB.GadContext;
                                id   IN D0 : LONGINT;
                                item IN A1 : NodePtr);

LIBRARY GBScrollBase BY -166
    PROCEDURE GCGetScrollBoxTop(con  IN A0 : GB.GadContext;
                                id   IN D0 : LONGINT):NodePtr;

LIBRARY GBScrollBase BY -172
    PROCEDURE GCLinkScrollToString(con    IN A0 : GB.GadContext;
                                   scroll IN D0,
                                   string IN D1 : LONGINT);

END GBScrollBox.
