
























                              OOGrid Library(TM) v1.0
                      for Borland/Turbo Pascal (Real Mode/TV)


                                 Copyright (C) 1994
                                 by Arturo J. Monge


                          Portions Copyright (C) 1989,1990
                           by Borland International, Inc.


                              OOGrid Library(TM) v1.0
                                   Documentation































   TABLE OF CONTENTS


   ABOUT THE DOCUMENTATION . . . . . . . . . . . . . . . . . . . . . . . . .   1

   HOW TO CONTACT THE AUTHOR . . . . . . . . . . . . . . . . . . . . . . . .   1

   I. UNITS DESCRIPTION  . . . . . . . . . . . . . . . . . . . . . . . . . .   2
        GLEQUATES.PAS Unit . . . . . . . . . . . . . . . . . . . . . . . . .   3
        GLSORT.PAS Unit  . . . . . . . . . . . . . . . . . . . . . . . . . .   3
        GLSUPPRT.PAS Unit  . . . . . . . . . . . . . . . . . . . . . . . . .   4
        GLTSHEET.PAS Unit  . . . . . . . . . . . . . . . . . . . . . . . . .   4
        GLTVR_US.PAS Unit  . . . . . . . . . . . . . . . . . . . . . . . . .   4
        GLVIEWS.PAS Unit . . . . . . . . . . . . . . . . . . . . . . . . . .   5
        GLWINDOW.PAS Unit  . . . . . . . . . . . . . . . . . . . . . . . . .   5

   II. IDENTIFIERS DESCRIPTION . . . . . . . . . . . . . . . . . . . . . . .   6
        BlockOperation type  . . . . . . . . . . . . . . . . . . . . . . . .   6
        CellPos type . . . . . . . . . . . . . . . . . . . . . . . . . . . .   6
        CellTypes type . . . . . . . . . . . . . . . . . . . . . . . . . . .   6
        ChangeHeaderDialog function  . . . . . . . . . . . . . . . . . . . .   6
        ChangeXXXX constants . . . . . . . . . . . . . . . . . . . . . . . .   7
        ClipBoard variable . . . . . . . . . . . . . . . . . . . . . . . . .   7
        ClipBoardRecord type . . . . . . . . . . . . . . . . . . . . . . . .   7
        cmXXXX constants . . . . . . . . . . . . . . . . . . . . . . . . . .   8
        ColStartArray type . . . . . . . . . . . . . . . . . . . . . . . . .   9
        CommasPart constant  . . . . . . . . . . . . . . . . . . . . . . . .   9
        CreateOOGLDialogs procedure  . . . . . . . . . . . . . . . . . . . .   9
        CreateOOGLStrings procedure  . . . . . . . . . . . . . . . . . . . .  10
        CSheetInputLine constant . . . . . . . . . . . . . . . . . . . . . .  11
        CSpreadSheet constant  . . . . . . . . . . . . . . . . . . . . . . .  11
        CSpreadSheetWindow1 constant . . . . . . . . . . . . . . . . . . . .  12
        CSpreadSheetWindow2 constant . . . . . . . . . . . . . . . . . . . .  13
        CSpreadSheetXXXX constants . . . . . . . . . . . . . . . . . . . . .  14
        CurrencyCharPart constant  . . . . . . . . . . . . . . . . . . . . .  14
        CurrencyPart constant  . . . . . . . . . . . . . . . . . . . . . . .  15
        CurrencyShift constant . . . . . . . . . . . . . . . . . . . . . . .  15
        CurrencyStr type . . . . . . . . . . . . . . . . . . . . . . . . . .  15
        DecPlacesPart constant . . . . . . . . . . . . . . . . . . . . . . .  16
        DefaultXXXX constants  . . . . . . . . . . . . . . . . . . . . . . .  16
        DisplayMessage function  . . . . . . . . . . . . . . . . . . . . . .  17
        DisplayXXXX constants  . . . . . . . . . . . . . . . . . . . . . . .  18
        EditXXXX constants . . . . . . . . . . . . . . . . . . . . . . . . .  18
        Empty variable . . . . . . . . . . . . . . . . . . . . . . . . . . .  18
        EraseMessage procedure . . . . . . . . . . . . . . . . . . . . . . .  19
        FixFormulaCol procedure  . . . . . . . . . . . . . . . . . . . . . .  19
        FixFormulaRow procedure  . . . . . . . . . . . . . . . . . . . . . .  20
        FormatDialog function  . . . . . . . . . . . . . . . . . . . . . . .  20
        FormatType type  . . . . . . . . . . . . . . . . . . . . . . . . . .  21
        FormulaOps type  . . . . . . . . . . . . . . . . . . . . . . . . . .  21
        FormulaStart function  . . . . . . . . . . . . . . . . . . . . . . .  22
        GetColWidth function . . . . . . . . . . . . . . . . . . . . . . . .  22
        GetColWidthFunc type . . . . . . . . . . . . . . . . . . . . . . . .  23
        GetWidthDialog function  . . . . . . . . . . . . . . . . . . . . . .  23
        GLResFile variable . . . . . . . . . . . . . . . . . . . . . . . . .  23
        GLSortExit procedure . . . . . . . . . . . . . . . . . . . . . . . .  24
        GLStringList variable  . . . . . . . . . . . . . . . . . . . . . . .  24
        GoToDialog function  . . . . . . . . . . . . . . . . . . . . . . . .  24

                                         i








        hcXXXX constants . . . . . . . . . . . . . . . . . . . . . . . . . .  25
        InitClipboard procedure  . . . . . . . . . . . . . . . . . . . . . .  27
        InitCommandNumber constant . . . . . . . . . . . . . . . . . . . . .  27
        InitHelpContextNumber constant . . . . . . . . . . . . . . . . . . .  27
        InitObjectTypeID constant  . . . . . . . . . . . . . . . . . . . . .  28
        InitStandardContextNumber constant . . . . . . . . . . . . . . . . .  28
        InputLine function . . . . . . . . . . . . . . . . . . . . . . . . .  28
        Justification type . . . . . . . . . . . . . . . . . . . . . . . . .  29
        JustPart constant  . . . . . . . . . . . . . . . . . . . . . . . . .  29
        Keyposition type . . . . . . . . . . . . . . . . . . . . . . . . . .  30
        KeyValue type  . . . . . . . . . . . . . . . . . . . . . . . . . . .  30
        MessageLine variable . . . . . . . . . . . . . . . . . . . . . . . .  31
        ModifiedXXXX constants . . . . . . . . . . . . . . . . . . . . . . .  31
        NumberFormatShift constant . . . . . . . . . . . . . . . . . . . . .  31
        OOGridFileHeader constant  . . . . . . . . . . . . . . . . . . . . .  32
        PasteDialog function . . . . . . . . . . . . . . . . . . . . . . . .  32
        PrintDialog function . . . . . . . . . . . . . . . . . . . . . . . .  32
        PrinterConfigRec variable  . . . . . . . . . . . . . . . . . . . . .  33
        PrintingDialog function  . . . . . . . . . . . . . . . . . . . . . .  33
        PrintToDialog function . . . . . . . . . . . . . . . . . . . . . . .  33
        RBlock constant  . . . . . . . . . . . . . . . . . . . . . . . . . .  34
        RChangeHeader variable . . . . . . . . . . . . . . . . . . . . . . .  34
        RChangeWidth variable  . . . . . . . . . . . . . . . . . . . . . . .  34
        RCopyFormulas variable . . . . . . . . . . . . . . . . . . . . . . .  35
        RedrawXXXX constants . . . . . . . . . . . . . . . . . . . . . . . .  35
        RegisterGLCell procedure . . . . . . . . . . . . . . . . . . . . . .  35
        RegisterGLSupprt procedure . . . . . . . . . . . . . . . . . . . . .  36
        RegisterGLTSheetInputLine procedure  . . . . . . . . . . . . . . . .  36
        RegisterGLViews procedure  . . . . . . . . . . . . . . . . . . . . .  36
        RegisterSpreadSheet procedure  . . . . . . . . . . . . . . . . . . .  37
        RemoveXXXX constants . . . . . . . . . . . . . . . . . . . . . . . .  37
        RepeatFirstChar constant . . . . . . . . . . . . . . . . . . . . . .  37
        RepeatTextChar constant  . . . . . . . . . . . . . . . . . . . . . .  38
        RFormat variable . . . . . . . . . . . . . . . . . . . . . . . . . .  38
        RFormulaCell constant  . . . . . . . . . . . . . . . . . . . . . . .  38
        RGoToCell variable . . . . . . . . . . . . . . . . . . . . . . . . .  39
        RLimScrollBar constant . . . . . . . . . . . . . . . . . . . . . . .  39
        RPrint variable  . . . . . . . . . . . . . . . . . . . . . . . . . .  40
        RRepeatCell constant . . . . . . . . . . . . . . . . . . . . . . . .  40
        RSheetInputLine constant . . . . . . . . . . . . . . . . . . . . . .  41
        RSortInfo variable . . . . . . . . . . . . . . . . . . . . . . . . .  41
        RSpreadSheet constant  . . . . . . . . . . . . . . . . . . . . . . .  41
        RTextCell constant . . . . . . . . . . . . . . . . . . . . . . . . .  42
        RValueCell constant  . . . . . . . . . . . . . . . . . . . . . . . .  42
        ScreenColRange type  . . . . . . . . . . . . . . . . . . . . . . . .  43
        ScreenCols constant  . . . . . . . . . . . . . . . . . . . . . . . .  43
        ScreenPos type . . . . . . . . . . . . . . . . . . . . . . . . . . .  44
        ScreenRowRange type  . . . . . . . . . . . . . . . . . . . . . . . .  44
        ScreenRows constant  . . . . . . . . . . . . . . . . . . . . . . . .  44
        SortDialog function  . . . . . . . . . . . . . . . . . . . . . . . .  45
        SortingDialog function . . . . . . . . . . . . . . . . . . . . . . .  45
        SortTypes type . . . . . . . . . . . . . . . . . . . . . . . . . . .  45
        StandardSortObject variable  . . . . . . . . . . . . . . . . . . . .  45
        stRXXXX constants  . . . . . . . . . . . . . . . . . . . . . . . . .  46
        stXXXX constants . . . . . . . . . . . . . . . . . . . . . . . . . .  46
        sXXXX constants  . . . . . . . . . . . . . . . . . . . . . . . . . .  47
        TBlock object  . . . . . . . . . . . . . . . . . . . . . . . . . . .  48
             Anchor field  . . . . . . . . . . . . . . . . . . . . . . . . .  48

                                         ii








             AnchorColShifted field  . . . . . . . . . . . . . . . . . . . .  49
             AnchorRowShifted field  . . . . . . . . . . . . . . . . . . . .  49
             CellInBlock function  . . . . . . . . . . . . . . . . . . . . .  50
             ExtendTo funcition  . . . . . . . . . . . . . . . . . . . . . .  50
             Init CONSTRUCTOR  . . . . . . . . . . . . . . . . . . . . . . .  50
             Load CONSTRUCTOR  . . . . . . . . . . . . . . . . . . . . . . .  51
             Start field . . . . . . . . . . . . . . . . . . . . . . . . . .  51
             Stop field  . . . . . . . . . . . . . . . . . . . . . . . . . .  51
             Store procedure . . . . . . . . . . . . . . . . . . . . . . . .  52
        TCell object . . . . . . . . . . . . . . . . . . . . . . . . . . . .  52
             CellType function . . . . . . . . . . . . . . . . . . . . . . .  53
             CopyString function . . . . . . . . . . . . . . . . . . . . . .  53
             CurrValue function  . . . . . . . . . . . . . . . . . . . . . .  54
             DisplayString function  . . . . . . . . . . . . . . . . . . . .  54
             Done DESTRUCTOR . . . . . . . . . . . . . . . . . . . . . . . .  55
             EditString procedure  . . . . . . . . . . . . . . . . . . . . .  55
             Format function . . . . . . . . . . . . . . . . . . . . . . . .  55
             FormattedString function  . . . . . . . . . . . . . . . . . . .  56
             HashError function  . . . . . . . . . . . . . . . . . . . . . .  57
             Init CONSTRUCTOR  . . . . . . . . . . . . . . . . . . . . . . .  57
             LegalValue function . . . . . . . . . . . . . . . . . . . . . .  58
             Loc field . . . . . . . . . . . . . . . . . . . . . . . . . . .  58
             Name function . . . . . . . . . . . . . . . . . . . . . . . . .  58
             OverwriteStart function . . . . . . . . . . . . . . . . . . . .  59
             Overwritten function  . . . . . . . . . . . . . . . . . . . . .  59
             ShouldUpdate function . . . . . . . . . . . . . . . . . . . . .  60
             Width function  . . . . . . . . . . . . . . . . . . . . . . . .  61
        TCellHashTable object  . . . . . . . . . . . . . . . . . . . . . . .  61
             Add function  . . . . . . . . . . . . . . . . . . . . . . . . .  62
             CreateItem procedure  . . . . . . . . . . . . . . . . . . . . .  62
             CurrCell field  . . . . . . . . . . . . . . . . . . . . . . . .  62
             CurrLoc field . . . . . . . . . . . . . . . . . . . . . . . . .  63
             Delete procedure  . . . . . . . . . . . . . . . . . . . . . . .  63
             Done DESTRUCTOR . . . . . . . . . . . . . . . . . . . . . . . .  64
             FirstItem function  . . . . . . . . . . . . . . . . . . . . . .  64
             Found function  . . . . . . . . . . . . . . . . . . . . . . . .  64
             HashValue function  . . . . . . . . . . . . . . . . . . . . . .  65
             Init CONSTRUCTOR  . . . . . . . . . . . . . . . . . . . . . . .  65
             ItemSize function . . . . . . . . . . . . . . . . . . . . . . .  66
             Load procedure  . . . . . . . . . . . . . . . . . . . . . . . .  66
             NextItem function . . . . . . . . . . . . . . . . . . . . . . .  67
             Search function . . . . . . . . . . . . . . . . . . . . . . . .  67
             Store procedure . . . . . . . . . . . . . . . . . . . . . . . .  68
        TEmptyCell object  . . . . . . . . . . . . . . . . . . . . . . . . .  68
             CellType function . . . . . . . . . . . . . . . . . . . . . . .  69
             CopyString function . . . . . . . . . . . . . . . . . . . . . .  69
             CurrValue function  . . . . . . . . . . . . . . . . . . . . . .  69
             DisplayString function  . . . . . . . . . . . . . . . . . . . .  70
             EditString procedure  . . . . . . . . . . . . . . . . . . . . .  70
             Format function . . . . . . . . . . . . . . . . . . . . . . . .  70
             FormattedString function  . . . . . . . . . . . . . . . . . . .  71
             HasError function . . . . . . . . . . . . . . . . . . . . . . .  71
             Init CONSTRUCTOR  . . . . . . . . . . . . . . . . . . . . . . .  71
             LegalValue function . . . . . . . . . . . . . . . . . . . . . .  71
             Name function . . . . . . . . . . . . . . . . . . . . . . . . .  72
             OverwriteStart function . . . . . . . . . . . . . . . . . . . .  72
             Overwritten function  . . . . . . . . . . . . . . . . . . . . .  72
             ShouldUpdate function . . . . . . . . . . . . . . . . . . . . .  72

                                        iii








             Width function  . . . . . . . . . . . . . . . . . . . . . . . .  73
        TFormatHashTable object  . . . . . . . . . . . . . . . . . . . . . .  73
             Add function  . . . . . . . . . . . . . . . . . . . . . . . . .  74
             CreateItem procedure  . . . . . . . . . . . . . . . . . . . . .  74
             CurrFormat field  . . . . . . . . . . . . . . . . . . . . . . .  74
             CurrStart field . . . . . . . . . . . . . . . . . . . . . . . .  75
             CurrStop field  . . . . . . . . . . . . . . . . . . . . . . . .  75
             Delete function . . . . . . . . . . . . . . . . . . . . . . . .  76
             Done DESTRUCTOR . . . . . . . . . . . . . . . . . . . . . . . .  76
             Found function  . . . . . . . . . . . . . . . . . . . . . . . .  76
             HashValue function  . . . . . . . . . . . . . . . . . . . . . .  77
             Init CONSTRUCTOR  . . . . . . . . . . . . . . . . . . . . . . .  77
             ItemSize function . . . . . . . . . . . . . . . . . . . . . . .  77
             Load procedure  . . . . . . . . . . . . . . . . . . . . . . . .  77
             Overwrite function  . . . . . . . . . . . . . . . . . . . . . .  78
             Search function . . . . . . . . . . . . . . . . . . . . . . . .  78
             Store procedure . . . . . . . . . . . . . . . . . . . . . . . .  79
        TFormulaCell object  . . . . . . . . . . . . . . . . . . . . . . . .  79
             CellType function . . . . . . . . . . . . . . . . . . . . . . .  80
             CopyString function . . . . . . . . . . . . . . . . . . . . . .  80
             CurrValue function  . . . . . . . . . . . . . . . . . . . . . .  80
             DisplayString function  . . . . . . . . . . . . . . . . . . . .  81
             Done DESTRUCTOR . . . . . . . . . . . . . . . . . . . . . . . .  81
             EditString procedure  . . . . . . . . . . . . . . . . . . . . .  81
             Error field . . . . . . . . . . . . . . . . . . . . . . . . . .  81
             Format function . . . . . . . . . . . . . . . . . . . . . . . .  82
             FormattedString function  . . . . . . . . . . . . . . . . . . .  82
             Formula field . . . . . . . . . . . . . . . . . . . . . . . . .  82
             GetFormula function . . . . . . . . . . . . . . . . . . . . . .  82
             HasError function . . . . . . . . . . . . . . . . . . . . . . .  83
             Init CONSTRUCTOR  . . . . . . . . . . . . . . . . . . . . . . .  83
             LegalValue function . . . . . . . . . . . . . . . . . . . . . .  83
             Load CONSTRUCTOR  . . . . . . . . . . . . . . . . . . . . . . .  83
             Name function . . . . . . . . . . . . . . . . . . . . . . . . .  84
             OverwriteStart function . . . . . . . . . . . . . . . . . . . .  84
             Overwritten function  . . . . . . . . . . . . . . . . . . . . .  84
             ShouldUpdate function . . . . . . . . . . . . . . . . . . . . .  84
             Store procedure . . . . . . . . . . . . . . . . . . . . . . . .  85
             Value field . . . . . . . . . . . . . . . . . . . . . . . . . .  85
             Width function  . . . . . . . . . . . . . . . . . . . . . . . .  85
        THashTable object  . . . . . . . . . . . . . . . . . . . . . . . . .  85
             Add function  . . . . . . . . . . . . . . . . . . . . . . . . .  86
        THeadersHashTable object . . . . . . . . . . . . . . . . . . . . . .  86
             Add function  . . . . . . . . . . . . . . . . . . . . . . . . .  87
             CreateItem procedure  . . . . . . . . . . . . . . . . . . . . .  87
             CurrCol field . . . . . . . . . . . . . . . . . . . . . . . . .  88
             CurrName field  . . . . . . . . . . . . . . . . . . . . . . . .  88
             Delete procedure  . . . . . . . . . . . . . . . . . . . . . . .  88
             Done DESTRUCTOR . . . . . . . . . . . . . . . . . . . . . . . .  89
             Found function  . . . . . . . . . . . . . . . . . . . . . . . .  89
             HashValue function  . . . . . . . . . . . . . . . . . . . . . .  89
             Init CONSTRUCTOR  . . . . . . . . . . . . . . . . . . . . . . .  89
             ItemSize function . . . . . . . . . . . . . . . . . . . . . . .  90
             Load procedure  . . . . . . . . . . . . . . . . . . . . . . . .  90
             Search function . . . . . . . . . . . . . . . . . . . . . . . .  90
             SearchName function . . . . . . . . . . . . . . . . . . . . . .  91
             Store procedure . . . . . . . . . . . . . . . . . . . . . . . .  91
        TLimScrollBar object . . . . . . . . . . . . . . . . . . . . . . . .  91

                                         iv








             Change function . . . . . . . . . . . . . . . . . . . . . . . .  92
             DisplayLimit field  . . . . . . . . . . . . . . . . . . . . . .  92
             Draw procedure  . . . . . . . . . . . . . . . . . . . . . . . .  93
             HandleEvent procedure . . . . . . . . . . . . . . . . . . . . .  93
             Init CONSTRUCTOR  . . . . . . . . . . . . . . . . . . . . . . .  94
             Load CONSTRUCTOR  . . . . . . . . . . . . . . . . . . . . . . .  94
             OldValue field  . . . . . . . . . . . . . . . . . . . . . . . .  95
             Store procedure . . . . . . . . . . . . . . . . . . . . . . . .  95
        TMessageLine object  . . . . . . . . . . . . . . . . . . . . . . . .  95
             Draw procedure  . . . . . . . . . . . . . . . . . . . . . . . .  96
             Init CONSTRUCTOR  . . . . . . . . . . . . . . . . . . . . . . .  96
             StatusMessage field . . . . . . . . . . . . . . . . . . . . . .  96
        ToggleClipBoardOff procedure . . . . . . . . . . . . . . . . . . . .  97
        ToggleClipBoardOn procedure  . . . . . . . . . . . . . . . . . . . .  97
        TOverwriteHashTable object . . . . . . . . . . . . . . . . . . . . .  98
             Add function  . . . . . . . . . . . . . . . . . . . . . . . . .  98
             Change function . . . . . . . . . . . . . . . . . . . . . . . .  99
             CreateItem procedure  . . . . . . . . . . . . . . . . . . . . . 100
             CurrCell field  . . . . . . . . . . . . . . . . . . . . . . . . 100
             CurrPos field . . . . . . . . . . . . . . . . . . . . . . . . . 100
             Delete procedure  . . . . . . . . . . . . . . . . . . . . . . . 101
             Done DESTRUCTOR . . . . . . . . . . . . . . . . . . . . . . . . 102
             EndCol field  . . . . . . . . . . . . . . . . . . . . . . . . . 102
             Found function  . . . . . . . . . . . . . . . . . . . . . . . . 103
             HashValue function  . . . . . . . . . . . . . . . . . . . . . . 103
             Init CONSTRUCTOR  . . . . . . . . . . . . . . . . . . . . . . . 103
             ItemSize function . . . . . . . . . . . . . . . . . . . . . . . 103
             Search function . . . . . . . . . . . . . . . . . . . . . . . . 104
        TRepeatCell object . . . . . . . . . . . . . . . . . . . . . . . . . 104
             CellType function . . . . . . . . . . . . . . . . . . . . . . . 105
             CopyString function . . . . . . . . . . . . . . . . . . . . . . 105
             CurrValue function  . . . . . . . . . . . . . . . . . . . . . . 105
             DisplayString function  . . . . . . . . . . . . . . . . . . . . 106
             EditString procedure  . . . . . . . . . . . . . . . . . . . . . 106
             Format function . . . . . . . . . . . . . . . . . . . . . . . . 106
             FormattedString function  . . . . . . . . . . . . . . . . . . . 106
             HasError function . . . . . . . . . . . . . . . . . . . . . . . 106
             Init CONSTRUCTOR  . . . . . . . . . . . . . . . . . . . . . . . 107
             LegalValue function . . . . . . . . . . . . . . . . . . . . . . 107
             Load CONSTRUCTOR  . . . . . . . . . . . . . . . . . . . . . . . 107
             Name function . . . . . . . . . . . . . . . . . . . . . . . . . 107
             OverwriteStart function . . . . . . . . . . . . . . . . . . . . 108
             Overwritten function  . . . . . . . . . . . . . . . . . . . . . 108
             RepeatChar field  . . . . . . . . . . . . . . . . . . . . . . . 108
             ShouldUpdate function . . . . . . . . . . . . . . . . . . . . . 108
             Store procedure . . . . . . . . . . . . . . . . . . . . . . . . 109
             Width function  . . . . . . . . . . . . . . . . . . . . . . . . 109
        TScreenArea object . . . . . . . . . . . . . . . . . . . . . . . . . 109
             Attrib field  . . . . . . . . . . . . . . . . . . . . . . . . . 110
             Init CONSTRUCTOR  . . . . . . . . . . . . . . . . . . . . . . . 110
             LowerRight field  . . . . . . . . . . . . . . . . . . . . . . . 110
             PointInArea function  . . . . . . . . . . . . . . . . . . . . . 111
             UpperLeft field . . . . . . . . . . . . . . . . . . . . . . . . 111
        TSheetInputLine object . . . . . . . . . . . . . . . . . . . . . . . 111
             EndModal procedure  . . . . . . . . . . . . . . . . . . . . . . 112
             EndState field  . . . . . . . . . . . . . . . . . . . . . . . . 112
             Execute function  . . . . . . . . . . . . . . . . . . . . . . . 113
             GetPalette function . . . . . . . . . . . . . . . . . . . . . . 113

                                         v








             HandleEvent procedure . . . . . . . . . . . . . . . . . . . . . 113
             Init CONSTRUCTOR  . . . . . . . . . . . . . . . . . . . . . . . 114
             SetState procedure  . . . . . . . . . . . . . . . . . . . . . . 114
        TSortObject object . . . . . . . . . . . . . . . . . . . . . . . . . 115
             CurrentKeyPosition function . . . . . . . . . . . . . . . . . . 115
             CurrentRowPosition function . . . . . . . . . . . . . . . . . . 116
             CurrKey field . . . . . . . . . . . . . . . . . . . . . . . . . 117
             FillKeyRec procedure  . . . . . . . . . . . . . . . . . . . . . 117
             Init CONSTRUCTOR  . . . . . . . . . . . . . . . . . . . . . . . 117
             KeyCols field . . . . . . . . . . . . . . . . . . . . . . . . . 118
             KeySortOrder field  . . . . . . . . . . . . . . . . . . . . . . 118
             LastKey field . . . . . . . . . . . . . . . . . . . . . . . . . 118
             PivotFirstKey field . . . . . . . . . . . . . . . . . . . . . . 119
             PivotSecondKey field  . . . . . . . . . . . . . . . . . . . . . 119
             PivotThirdKey field . . . . . . . . . . . . . . . . . . . . . . 119
             QuickSort procedure . . . . . . . . . . . . . . . . . . . . . . 120
             SetKeyArray function  . . . . . . . . . . . . . . . . . . . . . 120
             SetPivot procedure  . . . . . . . . . . . . . . . . . . . . . . 121
             Sort procedure  . . . . . . . . . . . . . . . . . . . . . . . . 121
             SortBlock field . . . . . . . . . . . . . . . . . . . . . . . . 122
             SourceCellHash field  . . . . . . . . . . . . . . . . . . . . . 122
             SplitSortBlock procedure  . . . . . . . . . . . . . . . . . . . 122
             SwapRows procedure  . . . . . . . . . . . . . . . . . . . . . . 123
        TSpreadSheet object  . . . . . . . . . . . . . . . . . . . . . . . . 123
             AddCell function  . . . . . . . . . . . . . . . . . . . . . . . 127
             AutoCalc field  . . . . . . . . . . . . . . . . . . . . . . . . 127
             BlankArea field . . . . . . . . . . . . . . . . . . . . . . . . 128
             BlockOn field . . . . . . . . . . . . . . . . . . . . . . . . . 128
             CellHash field  . . . . . . . . . . . . . . . . . . . . . . . . 128
             CellHashStart function  . . . . . . . . . . . . . . . . . . . . 129
             CellsProtected function . . . . . . . . . . . . . . . . . . . . 129
             CellToFString function  . . . . . . . . . . . . . . . . . . . . 129
             ChangeBounds procedure  . . . . . . . . . . . . . . . . . . . . 130
             ChangeColHeaders procedure  . . . . . . . . . . . . . . . . . . 130
             ChangeColWidth procedure  . . . . . . . . . . . . . . . . . . . 131
             CheckForDragging procedure  . . . . . . . . . . . . . . . . . . 131
             ClearCurrBlock procedure  . . . . . . . . . . . . . . . . . . . 131
             ClearScreenArea procedure . . . . . . . . . . . . . . . . . . . 132
             ColArea field . . . . . . . . . . . . . . . . . . . . . . . . . 132
             ColHeadersHash field  . . . . . . . . . . . . . . . . . . . . . 132
             ColHeadersHashStart function  . . . . . . . . . . . . . . . . . 133
             ColStart field  . . . . . . . . . . . . . . . . . . . . . . . . 133
             ColToX function . . . . . . . . . . . . . . . . . . . . . . . . 133
             ColumnToString function . . . . . . . . . . . . . . . . . . . . 134
             ColWidth function . . . . . . . . . . . . . . . . . . . . . . . 134
             ContentsArea field  . . . . . . . . . . . . . . . . . . . . . . 134
             CopyCellBlock procedure . . . . . . . . . . . . . . . . . . . . 135
             CurrBlock field . . . . . . . . . . . . . . . . . . . . . . . . 135
             CurrPos field . . . . . . . . . . . . . . . . . . . . . . . . . 135
             DataArea field  . . . . . . . . . . . . . . . . . . . . . . . . 136
             DefaultColWidth field . . . . . . . . . . . . . . . . . . . . . 136
             DefaultCurrency field . . . . . . . . . . . . . . . . . . . . . 136
             DefaultDecimalPlaces field  . . . . . . . . . . . . . . . . . . 137
             DeleteBlock procedure . . . . . . . . . . . . . . . . . . . . . 137
             DeleteCell procedure  . . . . . . . . . . . . . . . . . . . . . 137
             DeleteColFromHash procedure . . . . . . . . . . . . . . . . . . 138
             DeleteColHeaders procedure  . . . . . . . . . . . . . . . . . . 138
             DeleteColumns procedure . . . . . . . . . . . . . . . . . . . . 139

                                         vi








             DeleteRowFromHash procedure . . . . . . . . . . . . . . . . . . 139
             DeleteRows procedure  . . . . . . . . . . . . . . . . . . . . . 140
             DisplayAllCells procedure . . . . . . . . . . . . . . . . . . . 140
             DisplayArea field . . . . . . . . . . . . . . . . . . . . . . . 140
             DisplayBlankArea procedure  . . . . . . . . . . . . . . . . . . 141
             DisplayBlock procedure  . . . . . . . . . . . . . . . . . . . . 141
             DisplayBlockDiff procedure  . . . . . . . . . . . . . . . . . . 142
             DisplayCell procedure . . . . . . . . . . . . . . . . . . . . . 142
             DisplayCellBlock procedure  . . . . . . . . . . . . . . . . . . 142
             DisplayCellData procedure . . . . . . . . . . . . . . . . . . . 143
             DisplayCols procedure . . . . . . . . . . . . . . . . . . . . . 143
             DisplayFormulas field . . . . . . . . . . . . . . . . . . . . . 144
             DisplayHeaders field  . . . . . . . . . . . . . . . . . . . . . 144
             DisplayInfo procedure . . . . . . . . . . . . . . . . . . . . . 144
             DisplayRows procedure . . . . . . . . . . . . . . . . . . . . . 145
             DoAfterEndInput procedure . . . . . . . . . . . . . . . . . . . 145
             Done DESTRUCTOR . . . . . . . . . . . . . . . . . . . . . . . . 145
             DoneHashTables procedure  . . . . . . . . . . . . . . . . . . . 146
             DragCursorWithMouse procedure . . . . . . . . . . . . . . . . . 146
             Draw procedure  . . . . . . . . . . . . . . . . . . . . . . . . 146
             EmptyRowsAtBottom field . . . . . . . . . . . . . . . . . . . . 147
             EmptyRowsAtTop field  . . . . . . . . . . . . . . . . . . . . . 147
             EraseCellBlock procedure  . . . . . . . . . . . . . . . . . . . 148
             ExtendCurrBlock procedure . . . . . . . . . . . . . . . . . . . 148
             FindLastPos procedure . . . . . . . . . . . . . . . . . . . . . 148
             FindScreenColStart procedure  . . . . . . . . . . . . . . . . . 149
             FindScreenColStop procedure . . . . . . . . . . . . . . . . . . 149
             FindScreenRowStop procedure . . . . . . . . . . . . . . . . . . 150
             FindScreenRowStart procedure  . . . . . . . . . . . . . . . . . 150
             FixBlockOverWrite procedure . . . . . . . . . . . . . . . . . . 150
             FixOverWrite function . . . . . . . . . . . . . . . . . . . . . 151
             FormatDefault procedure . . . . . . . . . . . . . . . . . . . . 151
             FormulaHash field . . . . . . . . . . . . . . . . . . . . . . . 152
             FStringSituationColor function  . . . . . . . . . . . . . . . . 152
             GetFormat procedure . . . . . . . . . . . . . . . . . . . . . . 152
             GetPalette function . . . . . . . . . . . . . . . . . . . . . . 153
             GoToCell procedure  . . . . . . . . . . . . . . . . . . . . . . 153
             GoToEnd field . . . . . . . . . . . . . . . . . . . . . . . . . 153
             HandleEvent procedure . . . . . . . . . . . . . . . . . . . . . 154
             HandleInput procedure . . . . . . . . . . . . . . . . . . . . . 154
             InfoArea field  . . . . . . . . . . . . . . . . . . . . . . . . 155
             Init CONSTRUCTOR  . . . . . . . . . . . . . . . . . . . . . . . 155
             InitCurrPos procedure . . . . . . . . . . . . . . . . . . . . . 156
             InsertColumns procedure . . . . . . . . . . . . . . . . . . . . 157
             InsertRows procedure  . . . . . . . . . . . . . . . . . . . . . 157
             InsertRowToHash procedure . . . . . . . . . . . . . . . . . . . 157
             KeyPressed field  . . . . . . . . . . . . . . . . . . . . . . . 158
             LastPos field . . . . . . . . . . . . . . . . . . . . . . . . . 158
             Load CONSTRUCTOR  . . . . . . . . . . . . . . . . . . . . . . . 159
             LoadDelimited procedure . . . . . . . . . . . . . . . . . . . . 159
             LoadHashTables procedure  . . . . . . . . . . . . . . . . . . . 159
             LoadTablesFromTempFile procedure  . . . . . . . . . . . . . . . 160
             LocateCursorWithMouse procedure . . . . . . . . . . . . . . . . 161
             MaxCols field . . . . . . . . . . . . . . . . . . . . . . . . . 161
             MaxColWidth field . . . . . . . . . . . . . . . . . . . . . . . 161
             MaxDecimalPlaces field  . . . . . . . . . . . . . . . . . . . . 162
             MaxRows field . . . . . . . . . . . . . . . . . . . . . . . . . 162
             MaxScreenCols field . . . . . . . . . . . . . . . . . . . . . . 162

                                        vii








             Modified field  . . . . . . . . . . . . . . . . . . . . . . . . 163
             MoveCell procedure  . . . . . . . . . . . . . . . . . . . . . . 163
             MoveCellBlock procedure . . . . . . . . . . . . . . . . . . . . 163
             MoveDown procedure  . . . . . . . . . . . . . . . . . . . . . . 164
             MoveHome procedure  . . . . . . . . . . . . . . . . . . . . . . 164
             MoveLeft procedure  . . . . . . . . . . . . . . . . . . . . . . 164
             MovePgDown procedure  . . . . . . . . . . . . . . . . . . . . . 165
             MovePgLeft procedure  . . . . . . . . . . . . . . . . . . . . . 165
             MovePgRight procedure . . . . . . . . . . . . . . . . . . . . . 165
             MovePgUp procedure  . . . . . . . . . . . . . . . . . . . . . . 165
             MoveRight procedure . . . . . . . . . . . . . . . . . . . . . . 166
             MoveUp procedure  . . . . . . . . . . . . . . . . . . . . . . . 166
             NoBlankArea field . . . . . . . . . . . . . . . . . . . . . . . 166
             Number field  . . . . . . . . . . . . . . . . . . . . . . . . . 167
             OldCurrPos field  . . . . . . . . . . . . . . . . . . . . . . . 167
             OverwriteHash field . . . . . . . . . . . . . . . . . . . . . . 167
             OverwriteHashStart function . . . . . . . . . . . . . . . . . . 168
             Parser function . . . . . . . . . . . . . . . . . . . . . . . . 168
             PasteBlock procedure  . . . . . . . . . . . . . . . . . . . . . 168
             PasteCellBlock procedure  . . . . . . . . . . . . . . . . . . . 169
             Print procedure . . . . . . . . . . . . . . . . . . . . . . . . 169
             Recalc procedure  . . . . . . . . . . . . . . . . . . . . . . . 169
             RowArea field . . . . . . . . . . . . . . . . . . . . . . . . . 170
             RowNumberSpace field  . . . . . . . . . . . . . . . . . . . . . 170
             RowToY function . . . . . . . . . . . . . . . . . . . . . . . . 171
             SameCellPos function  . . . . . . . . . . . . . . . . . . . . . 171
             ScrollDraw procedure  . . . . . . . . . . . . . . . . . . . . . 171
             SelectColumn function . . . . . . . . . . . . . . . . . . . . . 172
             SetAreas procedure  . . . . . . . . . . . . . . . . . . . . . . 172
             SetBlankArea procedure  . . . . . . . . . . . . . . . . . . . . 172
             SetChanged procedure  . . . . . . . . . . . . . . . . . . . . . 173
             SetLimit procedure  . . . . . . . . . . . . . . . . . . . . . . 173
             SetLocked procedure . . . . . . . . . . . . . . . . . . . . . . 174
             SetNameWithMouse procedure  . . . . . . . . . . . . . . . . . . 174
             SetNumber procedure . . . . . . . . . . . . . . . . . . . . . . 174
             SetProtection procedure . . . . . . . . . . . . . . . . . . . . 175
             SetScreenColStop procedure  . . . . . . . . . . . . . . . . . . 175
             SetScreenColStart procedure . . . . . . . . . . . . . . . . . . 176
             SetScreenRowStop procedure  . . . . . . . . . . . . . . . . . . 176
             SetScreenRowStart procedure . . . . . . . . . . . . . . . . . . 176
             SetState procedure  . . . . . . . . . . . . . . . . . . . . . . 177
             SetUnlocked procedure . . . . . . . . . . . . . . . . . . . . . 177
             SheetProtected field  . . . . . . . . . . . . . . . . . . . . . 178
             SortData procedure  . . . . . . . . . . . . . . . . . . . . . . 178
             SortObject function . . . . . . . . . . . . . . . . . . . . . . 178
             Store procedure . . . . . . . . . . . . . . . . . . . . . . . . 179
             StoreHashTables procedure . . . . . . . . . . . . . . . . . . . 179
             StoreTablesToTempFile procedure . . . . . . . . . . . . . . . . 179
             ToggleAutoCalc procedure  . . . . . . . . . . . . . . . . . . . 180
             ToggleDisplayHeaders procedure  . . . . . . . . . . . . . . . . 180
             ToggleEnd procedure . . . . . . . . . . . . . . . . . . . . . . 180
             ToggleFormulaDisplay procedure  . . . . . . . . . . . . . . . . 181
             ToogleBlockOn procedure . . . . . . . . . . . . . . . . . . . . 181
             TotalRows field . . . . . . . . . . . . . . . . . . . . . . . . 181
             TrackCursor function  . . . . . . . . . . . . . . . . . . . . . 181
             UnlockedHash field  . . . . . . . . . . . . . . . . . . . . . . 182
             UpdateScreenBlockDisplay procedure  . . . . . . . . . . . . . . 182
             WidthHash field . . . . . . . . . . . . . . . . . . . . . . . . 182

                                        viii








             WidthHashStart function . . . . . . . . . . . . . . . . . . . . 183
             XToCol fuction  . . . . . . . . . . . . . . . . . . . . . . . . 183
             YToRow function . . . . . . . . . . . . . . . . . . . . . . . . 183
        TSpreadSheetWindow object  . . . . . . . . . . . . . . . . . . . . . 184
             GetPalette function . . . . . . . . . . . . . . . . . . . . . . 184
             Init CONSTRUCTOR  . . . . . . . . . . . . . . . . . . . . . . . 184
             SizeLimits procedure  . . . . . . . . . . . . . . . . . . . . . 185
             StandardScrollBar function  . . . . . . . . . . . . . . . . . . 185
        TTextCell object . . . . . . . . . . . . . . . . . . . . . . . . . . 186
             CellType function . . . . . . . . . . . . . . . . . . . . . . . 187
             CopyString function . . . . . . . . . . . . . . . . . . . . . . 187
             CurrValue function  . . . . . . . . . . . . . . . . . . . . . . 187
             DisplayString function  . . . . . . . . . . . . . . . . . . . . 187
             Done DESTRUCTOR . . . . . . . . . . . . . . . . . . . . . . . . 187
             EditString procedure  . . . . . . . . . . . . . . . . . . . . . 188
             Format function . . . . . . . . . . . . . . . . . . . . . . . . 188
             FormattedString function  . . . . . . . . . . . . . . . . . . . 188
             HasError function . . . . . . . . . . . . . . . . . . . . . . . 188
             Init CONSTRUCTOR  . . . . . . . . . . . . . . . . . . . . . . . 188
             LegalValue function . . . . . . . . . . . . . . . . . . . . . . 189
             Load CONSTRUCTOR  . . . . . . . . . . . . . . . . . . . . . . . 189
             Name function . . . . . . . . . . . . . . . . . . . . . . . . . 189
             OverwriteStart function . . . . . . . . . . . . . . . . . . . . 189
             Overwritten function  . . . . . . . . . . . . . . . . . . . . . 190
             ShouldUpdate function . . . . . . . . . . . . . . . . . . . . . 190
             Store procedure . . . . . . . . . . . . . . . . . . . . . . . . 190
             Txt field . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
             Width function  . . . . . . . . . . . . . . . . . . . . . . . . 191
        TUnlockedHashTable object  . . . . . . . . . . . . . . . . . . . . . 191
             Add function  . . . . . . . . . . . . . . . . . . . . . . . . . 192
             CreateItem procedure  . . . . . . . . . . . . . . . . . . . . . 192
             CurrStart field . . . . . . . . . . . . . . . . . . . . . . . . 192
             CurrStop field  . . . . . . . . . . . . . . . . . . . . . . . . 193
             Delete procedure  . . . . . . . . . . . . . . . . . . . . . . . 193
             Done DESTRUCTOR . . . . . . . . . . . . . . . . . . . . . . . . 193
             Found function  . . . . . . . . . . . . . . . . . . . . . . . . 194
             HashValue function  . . . . . . . . . . . . . . . . . . . . . . 194
             Init CONSTRUCTOR  . . . . . . . . . . . . . . . . . . . . . . . 194
             ItemSize function . . . . . . . . . . . . . . . . . . . . . . . 194
             Load CONSTRUCTOR  . . . . . . . . . . . . . . . . . . . . . . . 194
             Overwrite function  . . . . . . . . . . . . . . . . . . . . . . 195
             Search function . . . . . . . . . . . . . . . . . . . . . . . . 195
             Store procedure . . . . . . . . . . . . . . . . . . . . . . . . 195
        TValueCell object  . . . . . . . . . . . . . . . . . . . . . . . . . 196
             CellType function . . . . . . . . . . . . . . . . . . . . . . . 197
             CopyString function . . . . . . . . . . . . . . . . . . . . . . 197
             CurrValue function  . . . . . . . . . . . . . . . . . . . . . . 197
             DisplayString function  . . . . . . . . . . . . . . . . . . . . 197
             EditString procedure  . . . . . . . . . . . . . . . . . . . . . 197
             Error field . . . . . . . . . . . . . . . . . . . . . . . . . . 198
             Format function . . . . . . . . . . . . . . . . . . . . . . . . 198
             FormattedString function  . . . . . . . . . . . . . . . . . . . 198
             HasError function . . . . . . . . . . . . . . . . . . . . . . . 198
             Init CONSTRUCTOR  . . . . . . . . . . . . . . . . . . . . . . . 198
             LegalValue function . . . . . . . . . . . . . . . . . . . . . . 199
             Load CONSTRUCTOR  . . . . . . . . . . . . . . . . . . . . . . . 199
             Name function . . . . . . . . . . . . . . . . . . . . . . . . . 199
             OverwriteStart function . . . . . . . . . . . . . . . . . . . . 200

                                         ix








             Overwritten function  . . . . . . . . . . . . . . . . . . . . . 200
             ShouldUpdate function . . . . . . . . . . . . . . . . . . . . . 200
             Store procedure . . . . . . . . . . . . . . . . . . . . . . . . 200
             Value field . . . . . . . . . . . . . . . . . . . . . . . . . . 200
             Width function  . . . . . . . . . . . . . . . . . . . . . . . . 201
        TWidthHashTable object . . . . . . . . . . . . . . . . . . . . . . . 201
             Add function  . . . . . . . . . . . . . . . . . . . . . . . . . 202
             CreateItem function . . . . . . . . . . . . . . . . . . . . . . 202
             CurrCol field . . . . . . . . . . . . . . . . . . . . . . . . . 202
             CurrWidth field . . . . . . . . . . . . . . . . . . . . . . . . 203
             DefaultColWidth field . . . . . . . . . . . . . . . . . . . . . 203
             Delete procedure  . . . . . . . . . . . . . . . . . . . . . . . 203
             Done DESTRUCTOR . . . . . . . . . . . . . . . . . . . . . . . . 204
             Found function  . . . . . . . . . . . . . . . . . . . . . . . . 204
             GetDefaultColWidth function . . . . . . . . . . . . . . . . . . 204
             HashValue function  . . . . . . . . . . . . . . . . . . . . . . 205
             Init CONSTRUCTOR  . . . . . . . . . . . . . . . . . . . . . . . 205
             ItemSize function . . . . . . . . . . . . . . . . . . . . . . . 205
             Load procedure  . . . . . . . . . . . . . . . . . . . . . . . . 205
             Search function . . . . . . . . . . . . . . . . . . . . . . . . 206
             Store procedure . . . . . . . . . . . . . . . . . . . . . . . . 206
        UpdatingTablesDialog function  . . . . . . . . . . . . . . . . . . . 207

   INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209



































                                         x








   ABOUT THE DOCUMENTATION

   This documentation provides reference information about all the units and
   source code in OOGrid Library(TM) v1.0.  It is intended to be used as a
   reference - not as a tutorial.  If you are new to OOGrid Library(TM) v1.0,
   read the README.TXT file first; it provides general information about this
   library and how to use it in your applications, which you can complement by
   studying the source code of the demo programs.

   The documentation is organized in two sections:  UNITS DESCRIPTION and
   IDENTIFIERS DESCRIPTION.  In the units description section, there is a short
   description of almost eVery unit in this library (the units GLPARSER.PAS,
   GLLSTR.PAS, TCHASH.PAS and TCUTIL.PAS are not documented).  In the
   identifiers description section, there is a description -- in alphabetical
   order -- of all objects, variables, procedures, functions, types and
   constants declared in those units.  Each identifier description has the
   identifier declaration, the unit in which it is declared, its function, its
   parameters' description (if any) and important remarks about the identifier
   (if any).

   If you want to get a general overview of the objects in this library, read
   the description of each of the units in this library; then, try browsing the
   objects' descriptions and its attributes and methods's functions.

   However, the documentation becomes more useful when you actually begin
   working with the objects.  If you need to know what a method does, why a
   variable was declared, or what is the purpose of an object's attribute,
   simply read its description in this documentation.  The description should
   help you understand the function of an identifier and its relation with other
   identifiers.

   HOW TO CONTACT THE AUTHOR

   If you don't find the information you need in this documentation, or if you
   have any comments or suggestions about OOGrid Library(TM) v1.0 or its
   documentation, please feel free to contact the author at any of the addresses
   listed below:

    E-MAIL:
         INTERNET:          mongev@cariari.ucr.ac.cr
         CLEVELAND FREENET: fh441@freenet.cleveland.edu

    MAIL:
         Arturo J. Monge
         SJO 1684; POB 025216
         Miami, FL 33102-5216

   Sending correspondence via electronic mail is strongly preferred.











                                         1








   I. UNITS DESCRIPTION

   ************************************************************************
                                  GLCELL.PAS Unit
   ************************************************************************

   This unit implements the different types of cells and hash tables used by
   TSpreadsheet.  The hash tables are the objects used to store information in
   OOGrid Library(TM) v1.0 and are descendants of Borland's HashTable object. 
   For more information, see TCHASH.PAS (in Turbo Pascal 6.0).


   Basically, this unit is the same as Borland's TCCELL.PAS but with a larga
   amount of modifications which were necessary for adapting the unit's objects
   for use by TSpreadSheet.

   The hash tables implemented in this unit are:

        a) THashTable : A HashTable's descendant that checks the value of the
        LowMemory function before adding a cell to the hash table.  All hash
        tables in this unit are descendants of THashTable.

        b) TCellHashTable: Stores the cells in a spreadsheet.

        c) TWidthHashTable: Stores column widths that are different from the
        default column width.

        d) TFormatHashTable: Stores formatting information for blocks of cells
        in a spreadsheet.

        e) TOverWriteHashTable: Stores information about empty cells that are
        overwritten by the information in other cells.

        f) TColumnHeadersHashTable: Stores custom assigned column headers.

        g) TUnlockedCellHashTable: Stores the location of block of cells that
        are marked as 'unlocked' (see TSpreadSheet.SetUnlocked and
        TSpreadSheet.SetLocked )

   The cell objects implemented in this unit are:

        a) TCell : This is an abstract cell object.  All cell objects are
        descendants of TCell.

        b) TEmptyCell : Cell object used when working with empty cells in the
        spreadsheet.  Only one instance of TEmptyCell is constructed since all
        empty cells behave exactly the same way.

        b) TTextCell : Cell object that stores a string.

        c) TValueCell : Cell object that stores a value.

        d) TFormulaCell : Cell object that stores a formula and its result.

        e) TRepeatCell : Cell object that stores a character;  this character
        will be repeated when the cell is displayed.



                                         2








   GLCell also implements several functions for handling formulas and declares
   additional support variables, constants and types (used mostly by objects in
   this unit).

   ************************************************************************
                                 GLEQUATES.PAS Unit
   ************************************************************************

   The GLEQUATES unit defines all command and help context constants that are
   used by the TSpreadSheet object (the main object) and its resources.  The
   help context constants are only used when creating the resource file used by
   TSpreadSheet; the command constants are used too when creating the resource
   file, but are also used by TSpreadSheet's HandleEvent method.

   The constants in the GLEQUATES units are organized in four groups:

        a) Standard Help Contexts: these are help context constants used by
        standard buttons in all dialogs in OOGrid Library(TM) v1.0.  These
        standard buttons include 'YES', 'NO', 'OK', 'CANCEL', which are assigned
        the help context values hcYes, hcNo, hcOk and hcCancel, respectively.

        b) Help contexts: these are help context constants used by all dialogs
        and views in OOGrid Library(TM) v1.0.  Some of these constants are
        organized in groups of two or three to indicate that they are part of a
        cluster and therefore, all constants in the group must have consecutive
        values.

        c) Commands: these are command constants used by all dialogs in OOGrid
        Library(TM) v1.0;  they are also used by TSpreadSheet's HandleEvent
        method.

        d) Object Type ID's: these are the object type ID's used in the stream
        registration records in OOGrid Library(TM) v1.0.

   There are four particular constants that let you easily change the values of
   all the constants in the GLEQUATES units:

        a) InitStandardContextNumber: indicates the starting number of the
        sequence of values that will be assigned to the standard help contexts.

        b) InitHelpContextNumber: indicates the starting number of the sequence
        of values that will be assigned to the help contexts used by the dialogs
        and views in OOGrid Library(TM) v1.0.

        c) InitCommandNumber:  indicates the starting number of the sequence of
        values that will be assigned to the commands used by the dialogs in
        OOGrid Library(TM) v1.0 and by the TSpreadSheet object.

        d) InitObjectTypeID: indicates the starting number of the sequence of
        values that will be assigned to the list of object types ID's (used in
        the stream registration records in OOGrid Library(TM) v1.0). 

   ************************************************************************
                                  GLSORT.PAS Unit
   ************************************************************************

   The GLSORT unit implements an object (TSortObject) that can sort the rows of
   a block of cells in a THashTable object (see GLCELL.PAS), using three

                                         3








   different sort keys in either ascending or descending order.  The list is
   sorted using the QuickSort algorithm.

   The unit also declares the StandardSortObject variable.  This variable is
   initialized with a pointer to an instance of TSortObject.  When TSpreadSheet
   needs a service from TSortObject, it calls its SortObject function, which
   returns the value stored in the StandardSortObject variable.  If you need to
   use a different sort object, simply override TSpreadSheet's SortObject
   function to return a pointer to the new object (the new object must be a
   TSortObject's descendant).


   ************************************************************************
                                 GLSUPPRT.PAS Unit
   ************************************************************************

   The GLSUPPRT unit declares additional constants, variables, types and
   objects.

   It implements the resource support needed by TSpreadSheet, by declaring the
   GLResFile and GLStringList variables (which indicate TSpreadSheet where to
   find its resources) and the string list index constants.  It declares
   additional stream status constants, default constants that can be used when
   constructing a new instance of TSpreadSheet, and a PrinterConfigRec variable
   -- initialized with printer default values also declared in this unit -- that
   is used by TSpreadSheet's Print method.

   The CellPos record, used throughout OOGrid Library(TM) v1.0, is also declared
   in this unit, along with the TBlock and TScreenArea objects, and some other
   screen related constants, records and types.


   ************************************************************************
                                 GLTSHEET.PAS Unit
   ************************************************************************

   This is the main unit in OOGrid Library(TM) v1.0.  The GLTSHEET unit
   implements the TSpreadSheet object.

   To add spreadsheet capabilities to your applications, you will need to
   construct an instance of TSpreadSheet or a descendant.


   ************************************************************************
                                 GLTVR_US.PAS Unit
   ************************************************************************

   The GLTVR_US unit exports to functions that are are used to create
   TSpreadsheet's resources: CreateOOGLDialogs and CreateOOGLStrings.


   It implements several functions that create the dialogs, which are called by
   the CreateOOGLDialogs function.  If you need to change any of the dialogs,
   you will need to modify one or more of this functions.  If you need to change
   the text in the spreadsheet, you will need to modify the CreateOOGLStrings
   function.  



                                         4








   ************************************************************************
                                  GLVIEWS.PAS Unit
   ************************************************************************

   The GLVIEWS unit implements three TView's descendants and defines the record
   variables used by the SetData and GetData methods of all the dialogs in
   OOGrid Library(TM) v1.0.

   The implemented views are:

        a) TSheetInputLine: a TInputLine's descendant that can be inserted in a
        TSpreadSheetWindow (see GLWINDOW.PAS) and in modal state.

        b) TLimScrollBar: a TScrollBar's decendant that can be used to scroll
        over a large area, while display the scrolling over a smaller area.

        c) TMessageLine: A TView's descendat that is used to display messages at
        the status line.  TMessageLine is used by the DisplayMessage and
        EraseMessage functions also implemented in this unit.

   ************************************************************************
                                 GLWINDOW.PAS Unit
   ************************************************************************

   The GLWINDOW unit implements a TWindow's descendant, TSpreadSheetWindow, 
   that can own a TSpreadSheet object.

   This unit also declares the additional palette entries that must be added to
   Turbo Vision's standard application palette

   ************************************************************************




























                                         5








   II. IDENTIFIERS DESCRIPTION

   ************************************************************************
   BlockOperation type
   ************************************************************************
   DECLARATION:

        BlockOperation = (opCopy, opMove);

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Used by the clipboard record to indicate what kind of operation was
        requested.

   ************************************************************************
   CellPos type
   ************************************************************************
   DECLARATION:

        CellPos = record
          Col : Word;
          Row : Word;
        end; {...CellPos }

   UNIT:

        GLSUPPRT.PAS

   DESCRIPTION:

        Stores the position of a cell in the spreadsheet.

   ************************************************************************
   CellTypes type
   ************************************************************************
   DECLARATION:

        CellTypes = (ClEmpty, ClValue, ClText, ClFormula, ClRepeat);

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Enumerates all the available cell types in OOGrid Library(TM) v1.0.

   ************************************************************************
   ChangeHeaderDialog function
   ************************************************************************
   DECLARATION:

        function ChangeHeaderDialog : PDialog;


                                         6








   UNIT:

        GLTVR_US.PAS

   DESCRIPTION:

        (see CreateOOGLDialogs)

   ************************************************************************
   ChangeXXXX constants
   ************************************************************************
   DECLARATION:

        ChangeYes = True;
        ChangeNo = False;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Used with TOverwriteHashTable's Add and Delete methods to indicate if
        overwrite information for surrounding cells should be changed if
        necessary.

   ************************************************************************
   ClipBoard variable
   ************************************************************************
   DECLARATION:

        Clipboard : ClipBoardRecord;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        This variable is used to store the information necessary for copy and
        move operations.

        (see ClipBoardRecord, TSpreadSheet.CopyCellBlock,
        TSpreadSheet.MoveCellBlock)

   ************************************************************************
   ClipBoardRecord type
   ************************************************************************
   DECLARATION:

        ClipBoardRecord = RECORD
          Active            : Boolean;
          SourceSpreadSheet : PSpreadSheet;
          SourceCellHash    : PCellHashTable;
          BlockToCopy       : PBlock;
          CopyBlock         : Boolean;
          Operation         : BlockOperation;
        end; {...ClipBoardRecord }

                                            7








   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        This record is used to store information necessary for copy and move
        operations.

   REMARKS:

        (see TSpreadSheet.CopyCellBlock, TSpreadSheet.MoveCellBlock)


   ************************************************************************
   cmXXXX constants
   ************************************************************************

   UNIT:

        GLEQUATES.PAS

   DESCRIPTION:

        The following is a description of all commands in Grid Library(TM) v1.0. 
        The values of this constants depend on the value assigned to the
        InitCommandNumber constant.

        Constant                 Description
        ----------------------------------------------------------------- 
        cmChangeColHeaders       Change the header of the selected columns
          cmChangeColWidth            Change the width of the selected columns
          cmDeleteColHeaders          Delete the header of the selected columns
          cmDeleteColumns             Delete the selected columns 
          cmDeleteRows                Delete the selected rows
          cmEditCell                  Edit the contents of the selected cell
          cmFormatCells               Format the selected cells
          cmFormatDefault             Erase all format information about the
                                      selected cells
          cmGoToCell                  Go to a new cell in the spreadsheet
          cmInsertColumns             Insert a column(s) in the selected area
          cmInsertRows                Insert a row(s) in the selected area
          cmNewSheet                  Should be used by your application if you
                                      want to be able to create new spreadsheets
                                      without cancelling a copy or move
                                      operation
          cmPrintSheet                Prints a spreadsheet
          cmRecalc                    Recalculates the values of the cells in
                                      the spreadsheet
          cmToggleAutoCalc            Turns on/off the automatic recaculation of
                                      cells
          cmToggleFormulas            Display/Hides formulas
          cmToggleHeaders             Display/Hides custom assigned headers
          cmToggleProtection          Protects/Unprotects the contents of a
                                      spreadsheet
          cmSetLocked                 Mark the selected cells as locked (the
                                      default state)
          cmSetUnlocked               Mark the selected cells as unlocked

                                            8








          cmSortData                  Sorts by rows the selected cells

   ************************************************************************
   ColStartArray type
   ************************************************************************
   DECLARATION:

        ColStartArray = array[0..ScreenCols] of Byte;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Array used to store the screen columns where the columns of the
        spreadsheet will be displayed.

   ************************************************************************
   CommasPart constant
   ************************************************************************
   DECLARATION:

        CommasPart = $80;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Bits in a cell's format value that indicate if a number should be
        displayed with commas.

   REMARKS:

        (see FormatType)


   ************************************************************************
   CreateOOGLDialogs procedure
   ************************************************************************
   DECLARATION:

        procedure CreateOOGLDialogs(ResourceFile: PResourceFile);

   UNIT:

        GLTVR_US.PAS

   DESCRIPTION:

        Creates and adds each of the dialogs used in OOGrid Library(TM) v1.0 to
        the given resource file.

   PARAMETERS' DESCRIPTION:

        ResourceFile   :    the resource file where the views will be stored.

                                            9








   REMARKS:

        This procedure calls several private functions. Each of these functions
        returns a pointer to a dialog (with the exception of the InputLine
        function, which returns a pointer to a TSheetInputLine object).  The
        following is a list of all the functions and string indexes used to add
        each view to the resource file:

        Private Function              String Index
        -------------------------------------------------------
          FormatDialog                'FormatDialog'
          PasteDialog                 'FormulasDialog'
          GoToDialog                  'GoToDialog'
          ChangeHeaderDialog          'ChangeHeaderDialog'
          PrintDialog                 'PrintDialog'
          SortDialog                  'SortDialog'
          GetWidthDialog              'GetWidthDialog'
          InputLine                   'InputLine'
          PrintToDialog               'PrintToDialog'
          PrintingDialog              'PrintingDialog'
          SortingDialog               'SortingDialog'
          UpdatingTablesDialog        'UpdatingTablesDialog'

        **The dialogs were created using David Baldwin's Dialog Design program.

        (see GLResFile)


   ************************************************************************
   CreateOOGLStrings procedure
   ************************************************************************
   DECLARATION:

        procedure CreateOOGLStrings(ResourceFile: PResourceFile);

   UNIT:

        GLTVR_US.PAS

   DESCRIPTION:

        Creates the string list used by objects in OOGrid Library(TM) v1.0 and
        adds it to the given resource file.

   PARAMETERS' DESCRIPTION:

        ResourceFile   :    the resource file where the string list will be
                            stored.

   REMARKS:

        (see GLStringList)







                                         10








   ************************************************************************
   CSheetInputLine constant
   ************************************************************************
   DECLARATION:

        CSheetInputLine = #9#9#10#11;

   UNIT:

        GLVIEWS.PAS

   DESCRIPTION:

        TSheetInputLine's palette.

   REMARKS:

        CSheetInputLine palette layout:
           1 = Passive
           2 = Active 
           3 = Arrow
           4 = Selected


   ************************************************************************
   CSpreadSheet constant
   ************************************************************************
   DECLARATION:

        CSpreadSheet =
             #12#13#14#15#16#17#18#19#20#21#22#23#24#25#26#27#28#29#30+
             #31#32#33#34#35#36;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Color palette of the TSpreadSheet object.

   REMARKS:

        CSpreadSheet palette layout:

            1 = Empty Cell  
            2 = Value Cell  
            3 = Text Cell  
            4 = Repeat Cell  
            5 = Formula Cell  
            6 = Column headers  
            7 = Row numbers  
            8 = Cell Data Area  
            9 = Cell Contents Area  
            10 = Spreadsheet Info Area  
            11 = Cell In Block  
            12 = Cell Highlighted  
            13 = Cell Highlighted in Block  

                                           11








            14 = Unlocked Cell  
            15 = Unlocked Cell in Block  
            16 = Unlocked Cell Highlighted  
            17 = Unlocked Cell Highlighted in Block  
            18 = Cell Error  
            19 = Cell Error in Block  
            20 = Cell Error Highlighted  
            21 = Cell Error Highlighted in Block  
            22 = Unlocked Cell Error  
            23 = Unlocked Cell Error in Block  
            24 = Unlocked Cell Error Highlighted  
            25 = Unlocked Cell Error Highlighted in Block


   ************************************************************************
   CSpreadSheetWindow1 constant
   ************************************************************************
   DECLARATION:

        CSpreadSheetWindow1 =
                  #50#51#52#64#65#66#67#68#69#70#71#72#73#74#75#76+
                  #77#78#79#80#81#82#83#84#85#86#87#88;

   UNIT:

        GLWINDOW.PAS

   DESCRIPTION:

        Color palette that should be used by a TSpreadSheetWindow object when
        the CSpreadSheetXXXX constants where added to the standard application
        palettes (no color entries from the help system's color palettes).

   REMARKS:

        This is the palette used by the TSpreadSheetWindow object.

        TSpreadSheetWindow palette layout:

            1..8 = Blue Window palette  
            9 = Inputline Normal  
            10 = Inputline Selected  
            11 = Inputline Arrows  
            12 = Empty Cell  
            13 = Value Cell  
            14 = Text Cell  
            15 = Repeat Cell  
            16 = Formula Cell  
            17 = Column headers  
            18 = Row numbers  
            19 = Cell Data Area  
            20 = Cell Contents Area  
            21 = Spreadsheet Info Area  
            22 = Cell in Block  
            23 = Cell Highlighted  
            24 = Cell Highlighted in Block  
            25 = Unlocked Cell  
            26 = Unlocked Cell in Block  

                                           12








            27 = Unlocked Cell Highlighted  
            28 = Unlocked Cell Highlighted in Block  
            29 = Cell Error  
            30 = Cell Error in Block  
            31 = Cell Error Highlighted  
            32 = Cell Error Highlighted in Block  
            33 = Unlocked Cell Error  
            34 = Unlocked Cell Error in Block  
            35 = Unlocked Cell Error Highlighted  
            36 = Unlocked Cell Error Highlighted in Block   

        (see CSpreadSheetWindow2)


   ************************************************************************
   CSpreadSheetWindow2 constant
   ************************************************************************
   DECLARATION:

        CSpreadSheetWindow2 =
                  #50#51#52#72#73#74#75#76#77#78#79#80#81#82#83#84+
                  #85#86#87#88#89#90#91#92#93#94#95#96;

   UNIT:

        GLWINDOW.PAS

   DESCRIPTION:

        Color palette that should be used by a TSpreadSheetWindow object when
        the CSpreadSheetXXXX constants where added to the standard application
        palettes next to the color entries from the help system's color
        palettes.

   REMARKS:

        A TSpreadSheetWindow should use this palette when OOGrid Library(TM)
        v1.0 is used simultaneously with Turbo Vision's help system.

        TSpreadSheetWindow palette layout:

            1..8 = Blue Window palette  
            9 = Inputline Normal  
            10 = Inputline Selected  
            11 = Inputline Arrows  
            12 = Empty Cell  
            13 = Value Cell  
            14 = Text Cell  
            15 = Repeat Cell  
            16 = Formula Cell  
            17 = Column headers  
            18 = Row numbers  
            19 = Cell Data Area  
            20 = Cell Contents Area  
            21 = Spreadsheet Info Area  
            22 = Cell in Block  
            23 = Cell Highlighted  
            24 = Cell Highlighted in Block  

                                           13








            25 = Unlocked Cell  
            26 = Unlocked Cell in Block  
            27 = Unlocked Cell Highlighted  
            28 = Unlocked Cell Highlighted in Block  
            29 = Cell Error  
            30 = Cell Error in Block  
            31 = Cell Error Highlighted  
            32 = Cell Error Highlighted in Block  
            33 = Unlocked Cell Error  
            34 = Unlocked Cell Error in Block  
            35 = Unlocked Cell Error Highlighted  
            36 = Unlocked Cell Error Highlighted in Block   

        (see CSpreadSheetWindow1)


   ************************************************************************
   CSpreadSheetXXXX constants
   ************************************************************************
   DECLARATION:

        CSpreadSheetColor =
                  #$1F#$1F#$1F#$1F#$1E#$3F#$3F#$17#$1F#$7F#$7F#$7F#$2F+
                  #$3F#$70#$7F#$2F#$4F#$74#$7F#$2F#$BF#$F0#$FF#$AF;

        CSpreadSheetBlackWhite =
                  #$0F#$0F#$0F#$0F#$07#$0F#$0F#$07#$0F#$7F#$7F#$7F#$0F+
                  #$0F#$70#$7F#$0F#$7F#$7F#$7F#$0F#$8F#$F0#$FF#$8F;

        CSpreadSheetMonochrome =
                  #$0F#$0F#$0F#$0F#$07#$0F#$0F#$07#$0F#$70#$70#$70#$0F+
                  #$0F#$07#$70#$0F#$70#$0F#$80#$0F#$8F#$8F#$F0#$8F;

   UNIT:

        GLWINDOW.PAS

   DESCRIPTION:

        Color palettes that must be added to the standard application palettes
        when using a TSpreadSheet object.

   ************************************************************************
   CurrencyCharPart constant
   ************************************************************************
   DECLARATION:

        CurrencyCharPart = $FF00;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Bits in a cell's format value that indicate the currency character that
        will be added to a number.


                                         14








   REMARKS:

        (see CurrencyChar, CurrencyShift, FormatType)


   ************************************************************************
   CurrencyPart constant
   ************************************************************************
   DECLARATION:

        CurrencyPart = $40;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Bits in a cell's format value that indicate if a currency character
        should be added to a number.

   REMARKS:

        (see CurrencyCharPart, FormatType)


   ************************************************************************
   CurrencyShift constant
   ************************************************************************
   DECLARATION:

        CurrencyShift = 8;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Number of places a format value should be left shifted to determine the
        currency character.

   REMARKS:

        To determine the currency character from a format value, assign the
        result of the operation Chr(FormatValue shl CurrencyShift) to a
        character or string type variable.

        (see CurrencyCharPart, CurrencyPart, FormatType)


   ************************************************************************
   CurrencyStr type
   ************************************************************************
   DECLARATION:

        CurrencyStr = Str[3];


                                         15








   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Variables of this type are used to store the currency string that a
        number will be displayed with.

   REMARKS:

        A currency string is made up of an empty space, a currency character and
        another empty space (e.g. ' $ ').  If a cell's contents should be
        displayed with a currency character, a currency string is returned by
        the cell's FormattedString function .

        (see TCell.FormattedString)


   ************************************************************************
   DecPlacesPart constant
   ************************************************************************
   DECLARATION:

        DecPlacesPart = $0F;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Bits in a cell's format value that indicate the number of decimals a
        number should be displayed with.

   REMARKS:

        (see FormatType)


   ************************************************************************
   DefaultXXXX constants
   ************************************************************************

   UNIT:

        GLSUPPRT.PAS

   DESCRIPTION:

        Default values that can be used when initializing the TSpreadSheet and
        TLimScrollBar objects and by TSpreadSheet's Print method. 

        Constant                           Value
        ------------------------------------------------  DefaultCurrencyString
                       ' $ '
        DefaultDefaultColWidth             10
        DefaultDefaultDecimalPlaces        2

                                           16








        DefaultEmptyRowsAtBottom           0
        DefaultEmptyRowsAtTop              0
        DefaultHScrollBarLimit             27
        DefaultVScrollBarLimit             104
        DefaultMaxDecimalPlaces            8
        DefaultMaxCols                     MaxInt
        DefaultMaxRows                     MaxInt
        DefaultMinColWidth                 1
        DefaultPrinterName                 'PRN';
        DefaultTopMargin                   '0';
        DefaultBottomMargin                '0';
        DefaultLeftMargin                  '0';
        DefaultRightMargin                 '0';
        DefaultPageRows                    '60';
        DefaultNormalCols                  '80';
        DefaultCondensedCols               '132';
        DefaultPrinterCondensedOnCode      #15;
        DefaultPrinterCondensedOffCode     #18;
        DefaultPrinterUnderlineOnCode      Chr(27)+Chr(45)+Chr(49);
        DefaultPrinterUnderlineOffCode     Chr(27)+Chr(45)+Chr(48);
        DefaultPrinterBoldOnCode           Chr(27)+Chr(69);
        DefaultPrinterBoldOffCode          Chr(27)+Chr(70);


   ************************************************************************
   DisplayMessage function
   ************************************************************************
   DECLARATION:

        function DisplayMessage (AMessage:String): Boolean;

   UNIT:

        GLVIEWS.PAS

   DESCRIPTION:

        Displays a message in the status line.

   PARAMETERS' DESCRIPTION:

        AMessage  :    the message that will be displayed.

   REMARKS:

        This function creates an instance of TMessageLine and assigns a pointer
        to it to the MessageLine variable.  If an instance of TMessageLine
        already exists, the its StatusMessage field is changed to the new
        message and redisplayed.

        (see TMessageLine, TMessageLine.StatusMessage, MessageLine,
        EraseMessage).







                                         17








   ************************************************************************
   DisplayXXXX constants
   ************************************************************************
   DECLARATION:

        DisplayYes = True;
        DisplayNo = False;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Used with TSpreadSheet's Recalc method to indicate if each cell that is
        updated should be redisplayed or not.

   ************************************************************************
   EditXXXX constants
   ************************************************************************
   DECLARATION:

        EditYes = True;
        EditNo = False;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Used with TSpreadSheet's HandleInput method to indicate if the the data
        in the cell being modified should be edited or replaced with new data.

   ************************************************************************
   Empty variable
   ************************************************************************
   DECLARATION:

        Empty : PCell;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        This is a special cell.  It is used as the return value if a cell cannot
        be found so that the TEmptyCell methods can be executed instead of
        having special routines that act differently depending on whether a cell
        is found ot not.

   REMARKS:

        This is the only instance of TEmptyCell used.  It is constructed in the
        initialization section.



                                         18








   ************************************************************************
   EraseMessage procedure
   ************************************************************************
   DECLARATION:

        procedure EraseMessage;

   UNIT:

        GLVIEWS.PAS

   DESCRIPTION:

        Erases a message that was displayed using DisplayMessage.

   REMARKS:

        If the MessageLine variable is not NIL, then the TMessageLine object
        pointed by it is disposed and MessageLine is set to NIL.

        (see DisplayMessage, MessageLine, TMessageLine)


   ************************************************************************
   FixFormulaCol procedure
   ************************************************************************
   DECLARATION:

        procedure FixFormulaCol(CP : PCell; Operation: FormulaOps; After:
          Word; Diff : Longint; MaxCols, MaxRows : Word);

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Modify the column references of cell addresses in a formula, to reflect
        a change in position.

   PARAMETERS' DESCRIPTION:

        CP        :    formula cell that contains the formula string to be
                       modified.

        Operation :    the operation that caused the cell addresses in the
                       formula to change.

        After     :    a column number;  only column numbers after this column
                       will be modified.

        Diff      :    the value by which a column reference in a cell address
                       should be modified.

        MaxCols   :    maximum number of columns in the spreadsheet.

        MaxRows   :    maximum number of rows in the spreadsheet.


                                         19








   REMARKS:

        (see FormulaOps)


   ************************************************************************
   FixFormulaRow procedure
   ************************************************************************
   DECLARATION:

        procedure FixFormulaRow(CP : PCell; Operation: FormulaOps; After:
          Word; Diff : Longint; MaxCols, MaxRows : Word);

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Modify the row references of cell addresses in a formula, to reflect a
        change in position.

   PARAMETERS' DESCRIPTION:

        CP        :    formula cell that contains the formula string to be
                       modified.

        Operation :    the operation that caused the cell addresses in the
                       formula to change.

        After     :    a row number;  only row numbers after this row will be
                       modified.

        Diff      :    the value by which a row reference in a cell address
                       should be modified.

        MaxCols   :    maximum number of columns in the spreadsheet.

        MaxRows   :    maximum number of rows in the spreadsheet.

   REMARKS:

        (see FormulaOps)


   ************************************************************************
   FormatDialog function
   ************************************************************************
   DECLARATION:

        function FormatDialog : PDialog;

   UNIT:

        GLTVR_US.PAS




                                         20








   DESCRIPTION:

        (see CreateOOGLDialogs)

   ************************************************************************
   FormatType type
   ************************************************************************
   DECLARATION:

        FormatType = Word;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Variables of this type are used to store format values.

   REMARKS:
        Format Bits:
        Ŀ
                                                        
        
                      
                                                             
                Currency Character                           
                    = $FF00                                  
                                                             
                Add commas to numbers                    
                              = $80                           
             Add a currency character                 
                              = $40                            
                        Justification            
                              = $30                             
             Number of decimal places 
                              = $0F

   ************************************************************************
   FormulaOps type
   ************************************************************************
   DECLARATION:

        FormulaOps = (opInsert, opDelete);

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Used to indicate the operation that caused a cell address in a formula
        to change.




                                         21








   REMARKS:

        If a column or a row was inserted then the column or row values in
        affected cell addresses must be increased to reflect the change; if a
        column or a row was deleted then the column or row values in affected
        cell addresses must be decreased to reflect the change.
        (see FixFormulaCol, FixFormulaRow)


   ************************************************************************
   FormulaStart function
   ************************************************************************
   DECLARATION:

        function FormulaStart(Inp : String; Start, MaxCols, MaxRows :
          Word; var P : CellPos; var FormLen : Word) : Boolean;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Checks to see if a place in a string is the beggining of a formula.

   PARAMETERS' DESCRIPTION:

        Inp     : the string to be checked.

        Start   : the place in the string that will be checked.

        MaxCols : the maximum number of columns in the spreadsheet.

        MaxRows : the maximum number of rows in the spreadsheet.

        P       : if the given place in the string is the beggining of a
                  formula, the cell address that begins the formula will be
                  returned in this parameter.

        FormLen : the length of the beggining of the formula (the length of the
                  cell address) will be returned in this parameter.

   REMARKS:

        The function will return TRUE if the place in the string was the
        beggining of a formula; FALSE otherwise.


   ************************************************************************
   GetColWidth function
   ************************************************************************
   DECLARATION:

        function GetColWidth(var WHash : TWidthHashTable; C : Word) :
          Byte;




                                         22








   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Searches for a column's width in a width hash table.

   PARAMETERS' DESCRIPTION:

        WHash :   the TWidthHashTable object that will be used to determine the
                  column's width
        C     :   the column's number; the width of this column will be the
                  width returned by the function.

   ************************************************************************
   GetColWidthFunc type
   ************************************************************************
   DECLARATION:

        GetColWidthFunc = function(var WHash: TWidthHashTable;
          C: Word): Byte;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        (see GetColWidth)

   ************************************************************************
   GetWidthDialog function
   ************************************************************************
   DECLARATION:

        function GetWidthDialog : PDialog;

   UNIT:

        GLTVR_US.PAS

   DESCRIPTION:

        (see CreateOOGLDialogs)

   ************************************************************************
   GLResFile variable
   ************************************************************************
   DECLARATION:

        GLResFile : PResourceFile;

   UNIT:

        GLSUPPRT.PAS



                                         23








   DESCRIPTION:

        Pointer to the resource file to be used by the TSpreadSheet object.

   REMARKS:

        This variable must be initialized before creating the first instance of
        TSpreadSheet; failure to do so, may cause the system to crash.  Also,
        allways remember to close the resource file associated to this variable.



   ************************************************************************
   GLSortExit procedure
   ************************************************************************
   DECLARATION:

        procedure GLSortExit;

   UNIT:

        GLSORT.PAS

   DESCRIPTION:

        Exit procedure of the GLSORT unit.  It disposes the TSortObject created
        in the initalization section.

   ************************************************************************
   GLStringList variable
   ************************************************************************
   DECLARATION:

        GLStringList : PStringList;

   UNIT:

        GLSUPPRT.PAS

   DESCRIPTION:

        Pointer to the string list used by the TSpreadSheet object.

   REMARKS:

        This variable must be initialized before creating the first instance of
        TSpreadSheet; failure to do so, may cause the system to crash.  Also,
        allways remember to dispose the TStringList object associated to this
        variable.


   ************************************************************************
   GoToDialog function
   ************************************************************************
   DECLARATION:

        function GoToDialog : PDialog;


                                         24








   UNIT:

        GLTVR_US.PAS

   DESCRIPTION:

        (see CreateOOGLDialogs)

   ************************************************************************
   hcXXXX constants
   ************************************************************************

   UNIT:

        GLEQUATES.PAS

   DESCRIPTION:

        The following is a description of all help contexts in OOGrid
        Library(TM) v1.0.  The values of this constants depend on the values
        assigned to the InitStandardContextNumber and InitHelpContextNumber
        constants.

         Constant                Description
        -----------------------------------------------------------------
          hcYes                  'Yes' button in a dialog
          hcNo                   'No' button in a dialog
          hcOk                   'OK' button in a dialog
          hcCancel               'Cancel' button in a dialog
          hcBottomMargin         Input line in the 'Print' dialog for the bottom
                                 margin
          hcChangeHeaderInput    Input line in the 'Change header' dialog for
                                 the header
          hcCondensedCols        Input line in the 'Print' dialog for the number
                                 of condensed columns (in a page)
          hcCurrencyChar         Input line in the 'Format cells' dialog for the
                                 currency character
          hcDecimalPlaces        Input line in the 'Format cells' dialog for the
                                 number of decimal places of a number
          hcFirstKey             Input line in the 'Sort' dialog for the first
                                 sort key
          hcGetWidthInput        Input line in the 'Change width' dialog for a
                                 column's new width
          hcGoToCellInput        Input line in the 'Go to' dialog for the
                                 destination cell
          hcInputLine            Input line where spreadsheet data is entered
          hcLeftMargin           Input line in the 'Print' dialog for the left
                                 margin
          hcNormalCols           Input line in the 'Print' dialog for the number
                                 of normal columns (in a page)
          hcPageRows             Input line in the 'Print' dialog for the number
                                 of rows (in a page)
          hcPleaseWait           Dialogs that indicate the user to wait
          hcRightMargin          Input line in the 'Print' dialog for the right
                                 margin
          hcSecondKey            Input line in the 'Sort' dialog for the second
                                 sort key
          hcThirdKey             Input line in the 'Sort' dialog for the third

                                           25








                                 sort key
          hcTopMargin            Input line in the 'Print' dialog for the top
                                 margin

        Cluster:
          hcCopyColLiteral       Checkbox in the 'Paste' dialog to copy columns
                                 literally
          hcCopyRowLiteral       Checkbox in the 'Paste' dialog to copy rows
                                 literally
        Cluster:
          hcCurrencyFormat       Checkbox in the 'Format cells' dialog to
                                 display numbers with a currency character
          hcPutCommasInNumbers   Checkbox in the 'Format cells' dialog to
                                 display numbers with commas

        Cluster:
          hcJustLeft             Radio button in the 'Format cells' dialog to
                                 left justify a cell
          hcJustCenter           Radio button in the 'Format cells' dialog to
                                 center justify a cell
          hcJustRight            Radion button in the 'Format cells' dialog to
                                 right justify a cell

        Cluster:
          hcPrintToPrinter       Radio button in the 'Print' dialog to print a
                                 spreadsheet to the printer 
          hcPrintToFile          Radion button in the 'Print' dialog to print a
                                 spreadsheet to a file

        Cluster:
          hcPrintNormal          Radio button in the 'Print' dialog to print a
                                 spreadsheet in normal characters
          hcPrintCondensed       Radio button in the 'Print' dialog to print a
                                 spreadsheet in condensed character

        Cluster:
          hcPrintRowsNo          Radio button in the 'Print' dialog to not print
                                 row numbers
          hcPrintRowsLeft        Radio button in the 'Print' dialog to print row
                                 numbers (only in left pages)
          hcPrintRowsAlways      Radio button in the 'Print' dialog to always
                                 print row numbers 

        Cluster:
          hcPrintColsNo          Radio button in the 'Print' dialog to not print
                                 column headers
          hcPrintColsTop         Radio button in the 'Print' dialog to print
                                 column headers(only in upper pages)
          hcPrintColsAlways      Radio button in the 'Print' dialog to print
                                 column headers always

        Cluster:
          hcLineOutline          Checkbox in the 'Print' dialog to print row
                                 outlines
          hcBoldBorders          Checkbox in the 'Print' dialog to print row
                                 numbers and column headers in bold characters

        Cluster:

                                           26








          hcAscending            Radio button in the 'Sort' dialog to sort a
                                 list in ascending order
          hcDescending           Radio button in the 'Sort' dialog to sort a
                                 list in descending order

   ************************************************************************
   InitClipboard procedure
   ************************************************************************
   DECLARATION:

        procedure InitClipboard;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Resets the clipboard fields.

   ************************************************************************
   InitCommandNumber constant
   ************************************************************************
   DECLARATION:

        InitCommandNumber = 200;

   UNIT:

        GLEQUATES.PAS

   DESCRIPTION:

        The starting number of the sequence of values that will be assigned to
        the list of command values used by the dialogs in OOGrid Library(TM)
        v1.0 and by the TSpreadSheet object.

   REMARKS:

        (see the description of GLEQUATES.PAS)


   ************************************************************************
   InitHelpContextNumber constant
   ************************************************************************
   DECLARATION:

        InitHelpContextNumber = 100;

   UNIT:

        GLEQUATES.PAS

   DESCRIPTION:

        The starting number of the sequence of values that will be assigned to
        the list of help contexts used by all the dialogs and views in OOGrid
        Library(TM) v.1.0.

                                           27








   REMARKS:

        (see the description of GLEQUATES.PAS)


   ************************************************************************
   InitObjectTypeID constant
   ************************************************************************
   DECLARATION:

        InitObjectTypeID = 20000;

   UNIT:

        GLEQUATES.PAS

   DESCRIPTION:

        The starting number of the sequence of values that will be assigned to
        the list of type ID's of the objects that will be registered for stream
        access.

   REMARKS:

        (see the description of GLEQUATES.PAS)


   ************************************************************************
   InitStandardContextNumber constant
   ************************************************************************
   DECLARATION:

        InitStandardContextNumber = 2;

   UNIT:

        GLEQUATES.PAS

   DESCRIPTION:

        The starting number of the sequence of values that will be assigned to
        the list of standard help contexts (hcYes, hcNo, hcOk and hcCancel) used
        by the dialogs in OOGrid Library(TM) v1.0.

   REMARKS:

        (see the description of GLEQUATES.PAS)


   ************************************************************************
   InputLine function
   ************************************************************************
   DECLARATION:

        function InputLine : PSheetInputLine;




                                         28








   UNIT:

        GLTVR_US.PAS

   DESCRIPTION:

        Creates a TSheetInputLine object and returns a pointer to it

   REMARKS:

        The TSheetInputLine object is added to the resource file to avoid
        referring to a help context value in the TSpreadSheet object.  All help
        context values are then used only by the GLTVR_US unit.


   ************************************************************************
   Justification type
   ************************************************************************
   DECLARATION:

        Justification = (JLeft, JCenter, JRight);

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Enumerates all the different ways the contents of a cell can be
        justified.

   REMARKS:

        (see JustPart)


   ************************************************************************
   JustPart constant
   ************************************************************************
   DECLARATION:

        JustPart = $03;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Bits in a cell's format (after being left shifted JustShift spaces) that
        indicate the justification (left, center or right) of a cell's contents.

   REMARKS:

        Possible results of the operation '(FormatValue shl JustShift) and
        JustPart' and their meanings:

             0 : left justification

                                           29








             1 : center justification
             2 : right justification

        (see JustShift, FormatType)


   ************************************************************************
   Keyposition type
   ************************************************************************
   DECLARATION:

        KeyPosition = (BeforePivot, SameAsPivot, AfterPivot);

   UNIT:

        GLSORT.PAS

   DESCRIPTION:

        Enumerates the different results of a comparision.

   REMARKS:

        The results in the KeyPosition enumerated type indicate the position of
        the key being compared with the pivot (or reference) used by the
        QuickSort algorithm when sorting a list.

        (see TSortObject.CurrRowPosition, TSortObject.CurrKeyPosition)


   ************************************************************************
   KeyValue type
   ************************************************************************
   DECLARATION:

        KeyValue = record
          Error : Boolean;
          case CellType : CellTypes of
            ClText,
            ClRepeat : (StrValue: String);
            ClValue,
            ClFormula : (Value: Extended);
        end; {...KeyValue }

   UNIT:

        GLSORT.PAS

   DESCRIPTION:

        This record is used to store information about the cells being compared. 
        The result of comparing two cells depends of the error status, the
        cells' type and the cells' contents.

   REMARKS:

        (see TSortObject.FillKeyRec)


                                         30








   ************************************************************************
   MessageLine variable
   ************************************************************************
   DECLARATION:

        MessageLine : PMessageLine

   UNIT:

        GLVIEWS.PAS

   DESCRIPTION:

        Global variable used to create an instance of a TMessageLine object.

   REMARKS:

        The DisplayMessage function and the EraseMessage procedure use this
        variable to determine if an instance of TMessageLine already exists and
        where to find it.

        (see DisplayMessage, EraseMessage)


   ************************************************************************
   ModifiedXXXX constants
   ************************************************************************
   DECLARATION:

        ModifiedYes = True;
        ModifiedNo = False;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Used with TSpreadSheet's SetChanged method to indicate if the
        spreadsheet has been modified or not.

   ************************************************************************
   NumberFormatShift constant
   ************************************************************************
   DECLARATION:

        NumberFormatShift = 6;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Number of spaces a format value should be left shifted to determine the
        format for numbers.



                                         31








   REMARKS:

        After left shifting a format value by NumberFormatShift spaces, the
        first two bits of the resulting value indicate how numbers should be
        formatted.

             Bit 1 = 1: Add commas to numbers
             Bit 2 = 1: Add a currency character to numbers

        (see CommasPart, CurrencyPart, FormatType)


   ************************************************************************
   OOGridFileHeader constant
   ************************************************************************
   DECLARATION:

        OOGridFileHeader = 'OOGridLv1.00';

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        All TSpreadSheet objects stored in a stream will be identified by this
        file header.

   ************************************************************************
   PasteDialog function
   ************************************************************************
   DECLARATION:

        function PasteDialog : PDialog;

   UNIT:

        GLTVR_US.PAS

   DESCRIPTION:

        (see CreateOOGLDialogs)

   ************************************************************************
   PrintDialog function
   ************************************************************************
   DECLARATION:

        function PrintDialog : PDialog;

   UNIT:

        GLTVR_US.PAS

   DESCRIPTION:

        (see CreateOOGLDialogs)


                                         32








   ************************************************************************
   PrinterConfigRec variable
   ************************************************************************
   DECLARATION:

        PrinterConfigRec : record
          PrinterCondensedOnCode : String;
          PrinterCondensedOffCode : String;
          PrinterUnderlineOnCode : String;
          PrinterUnderlineOffCode : String;
          PrinterBoldOnCode : String;
          PrinterBoldOffCode : String;
        end; {...PrinterConfigRec }

   UNIT:

        GLSUPPRT.PAS

   DESCRIPTION:

        Stores printer codes used when printing a spreadsheet.

   REMARKS:

        This record is always initialized with the default values.


   ************************************************************************
   PrintingDialog function
   ************************************************************************
   DECLARATION:

        function PrintingDialog : PDialog;

   UNIT:

        GLTVR_US.PAS

   DESCRIPTION:

        (see CreateOOGLDialogs)

   ************************************************************************
   PrintToDialog function
   ************************************************************************
   DECLARATION:

        function PrintToDialog : PDialog;

   UNIT:

        GLTVR_US.PAS

   DESCRIPTION:

        (see CreateOOGLDialogs)



                                         33








   ************************************************************************
   RBlock constant
   ************************************************************************
   DECLARATION:

        RBlock : TStreamRec = (
           ObjType : stRBlock;
           VmtLink : Ofs(TypeOf(TBlock)^);
           Load    : @TBlock.Load;
           Store   : @TBlock.Store
        );

   UNIT:

        GLSUPPRT.PAS

   DESCRIPTION:

        Registration record used to register the TBlock object for stream
        access.

   REMARKS:

        (see stRXXXX, RegisterGLSupprt)


   ************************************************************************
   RChangeHeader variable
   ************************************************************************
   DECLARATION:

        RChangeHeader : record
          NewHeader : String[80]; {Inputline}
        end; {...RChangeHeader }

   UNIT:

        GLVIEWS.PAS

   DESCRIPTION:

        Global record-type variable used with the GetData and SetData methods of
        the 'Change Header' dialog.

   ************************************************************************
   RChangeWidth variable
   ************************************************************************
   DECLARATION:

        RChangeWidth : record
          NewWidth : String[10]; {Inputline}
        end; {...RChangeWidth }

   UNIT:

        GLVIEWS.PAS



                                         34








   DESCRIPTION:

        Global record-type variable used with the GetData and SetData methods of
        the 'Change width' dialog.

   ************************************************************************
   RCopyFormulas variable
   ************************************************************************
   DECLARATION:

        RCopyFormulas : record
          CopyFormulas : Word; {Checkboxes}
        end; {...RCopyFormulas }

   UNIT:

        GLVIEWS.PAS

   DESCRIPTION:

        Global record-type variable used with the GetData and SetData methods of
        the 'Paste' dialog.

   ************************************************************************
   RedrawXXXX constants
   ************************************************************************
   DECLARATION:

        RedrawYes = True;
        RedrawNo  = False;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Used with TSpreadSheet's ExtendCurrBlock method to indicate if the new
        block should be redrawn or not.

   ************************************************************************
   RegisterGLCell procedure
   ************************************************************************
   DECLARATION:

        procedure RegisterGLCell;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Register GLCELL.PAS's objects for stream access.

   REMARKS:

        It registers the TValueCell, TTextCell, TFormulaCell and TRepeatCell

                                           35








        objects.


   ************************************************************************
   RegisterGLSupprt procedure
   ************************************************************************
   DECLARATION:

        procedure RegisterGLSupprt;

   UNIT:

        GLSUPPRT.PAS

   DESCRIPTION:

        Register the unit's objects for stream access.

   REMARKS:

        It registers the TBlock object.


   ************************************************************************
   RegisterGLTSheetInputLine procedure
   ************************************************************************
   DECLARATION:

        procedure RegisterGLTSheetInputLine;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Registers all the objects in the GLTSHEET unit for stream access.

   ************************************************************************
   RegisterGLViews procedure
   ************************************************************************
   DECLARATION:

        procedure RegisterGLViews;

   UNIT:

        GLVIEWS.PAS

   DESCRIPTION:

        Registers the unit's objects for stream access.

   REMARKS:

        It registers the TLimScrollBar and TSheetInputLine objects.



                                         36








   ************************************************************************
   RegisterSpreadSheet procedure
   ************************************************************************
   DECLARATION:

        procedure RegisterSpreadSheet;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Registers all the objects in OOGrid Library(TM) v1.0 for stream access.

   ************************************************************************
   RemoveXXXX constants
   ************************************************************************
   DECLARATION:

        RemoveBlock = True;
        RemoveSingleCell = False;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Used with TSpreadSheet's EraseCellBlock method to indicate if a block of
        cells or only the highlighted cell is being erased.

   ************************************************************************
   RepeatFirstChar constant
   ************************************************************************
   DECLARATION:

        RepeatFirstChar = '\';

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Character used to determine when the information entered by the user is
        a repeat character.

   REMARKS:

        This character is never displayed in the spreadsheet; it is only
        displayed when editing the contents of a repeat cell.

        (see TRepeatCell)





                                         37








   ************************************************************************
   RepeatTextChar constant
   ************************************************************************
   DECLARATION:

        RepeatTextChar = ' ';

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Character used to determine when the information entered by the user is
        a string.

   REMARKS:

        This character is never displayed in the spreadsheet; it is only
        displayed when editing the contents of a text cell.

        (see TTextCell)


   ************************************************************************
   RFormat variable
   ************************************************************************
   DECLARATION:

        RFormat : record
          Justification : Word; {RadioButtons}
          DecimalPlaces : String[1]; {Inputline}
          CurrencyChar : String[1]; {Inputline}
          NumberFormat : Word; {Checkboxes}
        end; {...RFormat }

   UNIT:

        GLVIEWS.PAS

   DESCRIPTION:

        Global record-type variable used with the GetData and SetData methods of
        the 'Format cell' dialog.

   ************************************************************************
   RFormulaCell constant
   ************************************************************************
   DECLARATION:

        RFormulaCell: TStreamRec = (
          ObjType: stRFormulaCell;
          VmtLink: Ofs(TypeOf(TFormulaCell)^);
          Load: @TFormulaCell.Load;
          Store: @TFormulaCell.Store
        );



                                         38








   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Registration record used to register the TFormulaCell object for stream
        access.

   REMARKS:

        (see stRXXXX, RegisterGLCell)


   ************************************************************************
   RGoToCell variable
   ************************************************************************
   DECLARATION:

        RGoToCell : record
          NewCell : String[10]; {Inputline}
        end; {...RGoToCell }

   UNIT:

        GLVIEWS.PAS

   DESCRIPTION:

        Global record-type variable used with the GetData and SetData methods of
        the 'Go To' dialog.

   ************************************************************************
   RLimScrollBar constant
   ************************************************************************
   DECLARATION:

        RLimScrollBar : TStreamRec = (
           ObjType : stRLimScrollBar;
           VmtLink : Ofs(TypeOf(TLimScrollBar)^);
           Load    : @TLimScrollBar.Load;
           Store   : @TLimScrollBar.Store
        );

   UNIT:

        GLVIEWS.PAS

   DESCRIPTION:

        Registration record used to register the TLimScrollBar object for stream
        access.

   REMARKS:

        (see stRXXXX, RegisterGLViews)



                                         39








   ************************************************************************
   RPrint variable
   ************************************************************************
   DECLARATION:

        RPrint : record
          PrintTo : Word; {RadioButtons}
          PrintSize : Word; {RadioButtons}
          PrintRows : Word; {RadioButtons}
          PrintColumns : Word; {RadioButtons}
          TopMargin : String[3]; {Inputline}
          BottomMargin : String[3]; {Inputline}
          LeftMargin : String[3]; {Inputline}
          RightMargin : String[3]; {Inputline}
          Other : Word; {Checkboxes}
          PageRows : String[3]; {Inputline}
          NormalCols : String[3]; {Inputline}
          CondensedCols : String[3]; {Inputline}
        end; {...RPrint }

   UNIT:

        GLVIEWS.PAS

   DESCRIPTION:

        Global record-type variable used with the GetData and SetData methods of
        the 'Print' dialog.

   ************************************************************************
   RRepeatCell constant
   ************************************************************************
   DECLARATION:

        RRepeatCell: TStreamRec = (
          ObjType: stRRepeatCell;
          VmtLink: Ofs(TypeOf(TRepeatCell)^);
          Load: @TRepeatCell.Load;
          Store: @TRepeatCell.Store
        );

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Registration record used to register the TRepeatCell object for stream
        access.

   REMARKS:

        (see stRXXXX, RegisterGLCell)






                                         40








   ************************************************************************
   RSheetInputLine constant
   ************************************************************************
   DECLARATION:

        RSheetInputLine : TStreamRec = (
           ObjType : stRSheetInputLine;
           VmtLink : Ofs(TypeOf(TSheetInputLine)^);
           Load    : @TSheetInputLine.Load;
           Store   : @TSheetInputLine.Store
        );

   UNIT:

        GLVIEWS.PAS

   DESCRIPTION:

        Registration record used to register the TSheetInputLine object for
        stream access.

   REMARKS:

        (see stRXXXX, RegisterGLViews)


   ************************************************************************
   RSortInfo variable
   ************************************************************************
   DECLARATION:

        RSortInfo : record
          FirstKey : String[80]; {Inputline}
          FirstKeyOrder : Word; {RadioButtons}
          SecondKey : String[80]; {Inputline}
          SecondKeyOrder : Word; {RadioButtons}
          ThirdKey : String[80]; {Inputline}
          ThirdKeyOrder : Word; {RadioButtons}
        end; {...RSortInfo }

   UNIT:

        GLVIEWS.PAS

   DESCRIPTION:

        Global record-type variable used with the GetData and SetData methods of
        the 'Sort' dialog.

   ************************************************************************
   RSpreadSheet constant
   ************************************************************************
   DECLARATION:

        RSpreadSheet : TStreamRec = (
           ObjType : stRSpreadSheet;
           VmtLink : Ofs(TypeOf(TSpreadSheet)^);
           Load    : @TSpreadSheet.Load;

                                           41








           Store   : @TSpreadSheet.Store
        );

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Registration record used to register the TSpreadSheet object for stream
        access.

   REMARKS:

        (see stRXXXX)


   ************************************************************************
   RTextCell constant
   ************************************************************************
   DECLARATION:

        RTextCell: TStreamRec = (
          ObjType: stRTextCell;
          VmtLink: Ofs(TypeOf(TTextCell)^);
          Load: @TTextCell.Load;
          Store: @TTextCell.Store
        );

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Registration record used to register the TTextCell object for stream
        access.

   REMARKS:

        (see stRXXXX, RegisterGLCell)


   ************************************************************************
   RValueCell constant
   ************************************************************************
   DECLARATION:

        RValueCell: TStreamRec = (
          ObjType: stRValueCell;
          VmtLink: Ofs(TypeOf(TValueCell)^);
          Load: @TValueCell.Load;
          Store: @TValueCell.Store
        );

   UNIT:

        GLCELL.PAS

                                         42








   DESCRIPTION:

        Registration record used to register the TValueCell object for stream
        access.

   REMARKS:

        (see stRXXXX, RegisterGLCell)


   ************************************************************************
   ScreenColRange type
   ************************************************************************
   DECLARATION:

        ScreenColRange = 0..ScreenCols;

   UNIT:

        GLSUPPRT.PAS

   DESCRIPTION:

        Variables of this type are used to store the position of a column in the
        screen.

   REMARKS:

        Values that represent positions outside of the valid display area can be
        easily detected with Range Checking.


   ************************************************************************
   ScreenCols constant
   ************************************************************************
   DECLARATION:

        ScreenCols = 77;

   UNIT:

        GLSUPPRT.PAS

   DESCRIPTION:

        Max number of columns that can be used to display the spreadsheet.

   REMARKS:

        All the 80 columns of the screen cannot be used since the spreadsheet is
        displayed within a window.








                                         43








   ************************************************************************
   ScreenPos type
   ************************************************************************
   DECLARATION:

        ScreenPos = record
           Col : ScreenColRange;
           Row : ScreenRowRange;
        end; {...ScreenPos }

   UNIT:

        GLSUPPRT.PAS

   DESCRIPTION:

        Stores the position of a point in the screen.

   ************************************************************************
   ScreenRowRange type
   ************************************************************************
   DECLARATION:

        ScreenRowRange = 0..ScreenRows;

   UNIT:

        GLSUPPRT.PAS

   DESCRIPTION:

        Variables of this type are used to store the position of a row in the
        screen.

   REMARKS:

        Values that represent positions outside of the valid display area can be
        easily detected with Range Checking.


   ************************************************************************
   ScreenRows constant
   ************************************************************************
   DECLARATION:

        ScreenRows = 46;

   UNIT:

        GLSUPPRT.PAS

   DESCRIPTION:

        Max numbers of rows that can be used to display the spreadsheet (in any
        screen mode)




                                         44








   REMARKS:

        All the 50 columns of a 43/50 lines display cannot be used since the
        spreadsheet is displayed within a window.


   ************************************************************************
   SortDialog function
   ************************************************************************
   DECLARATION:

        function SortDialog : PDialog;

   UNIT:

        GLTVR_US.PAS

   DESCRIPTION:

        (see CreateOOGLDialogs)

   ************************************************************************
   SortingDialog function
   ************************************************************************
   DECLARATION:

        function SortingDialog : PDialog;

   UNIT:

        GLTVR_US.PAS

   DESCRIPTION:

        (see CreateOOGLDialogs)

   ************************************************************************
   SortTypes type
   ************************************************************************
   DECLARATION:

        SortTypes = (Ascending, Descending);

   UNIT:

        GLSORT.PAS

   DESCRIPTION:

        Enumerates the two types of orders that you can use to sort a list using
        the sort function.

   ************************************************************************
   StandardSortObject variable
   ************************************************************************
   DECLARATION:

        StandardSortObject : PSortObject;

                                           45








   UNIT:

        GLSORT.PAS

   DESCRIPTION:

        This variable points to the sort object used in OOGrid Library(TM) v1.0.

   REMARKS:

        (see TSpreadSheet.SortObject)


   ************************************************************************
   stRXXXX constants
   ************************************************************************

   UNIT:

        GLEQUATES.PAS

   DESCRIPTION:

        The following is a description of all object type ID constants (used in
        the respective stream registration record) in Grid Library(TM) v1.0. 
        The values of this constants depend on the value assigned to the
        InitObjectTypeID constant.

         Constant                Description
        -----------------------------------------------------------------
          stRValueCell           ID of the TValueCell object
          stRTextCell            ID of the TTextCell object
          stRFormulaCell         ID of the TFormulaCell object
          stRRepeatCell          ID of the TRepeatCelleCell object
          stRBlock               ID of the TBlock object
          stRLimScrollBar        ID of the TLimScrollBar object
          stRSheetInputLine      ID of the TSheetInputLine object
          stRSpreadSheet         ID of the TSpreadSheet object

   ************************************************************************
   stXXXX constants
   ************************************************************************

   UNIT:

        GLSUPPRT.PAS

   DESCRIPTION:

        Additional stream status constants returned by TSpreadSheet when using
        streams.

         Constant               Value Description
        -----------------------------------------------------------------
         stNoMemoryError         -7   Returned when an object could not be
                                      created because of low memory, and the
                                      stream access operation was not completed
                                      for that reason

                                           46








         stInvalidFormatError    -8   Returned when the file header (see
                                      OOGridFileHeader) was not found in a file

   ************************************************************************
   sXXXX constants
   ************************************************************************

   UNIT:

        GLSUPPRT.PAS

   DESCRIPTION:

        Key constants of all the strings in the TStringList object used by
        TSpreadSheet (see GLStringList).

           Constant             Value Description
        -----------------------------------------------------------------
          sAutoCalcLetter        1    Displayed in the info area when AutoCalc
                                      mode is on
          sBlockDeleteMsg        2    Displayed when deleting a block of cells
          sBlockName             3    Name of a block
          sCancelPrintJob        4    Used to prompt the user whether or not to
                                      cancel a print job
          sCellError             5    String displayed in a cell when there is a
                                      numeric error
          sCellLockedInfo        6    String displayed in the contents line
                                      (above the input line) when a cell is
                                      protected
          sCellsProtectedMsg     7    Indicate the user that the selected cells
                                      are protected
          sCellUnlockedInfo      8    String displayed in the contents line
                                      (above the input line)when a cell is
                                      unlocked
          sColumnEntryIndicator  9    Prefix added to column letters in the sort
                                      and change header dialogs
          sCopyCellsMsg          10   Displayed when copying a block of cells
          sDisplayFormulasLetter 11   Displayed in the info area when
                                      DisplayFormulas mode is on
          sDisplayHeadersLetter  12   Displayed in the info area when
                                      DisplayHeaders mode is on
          sEmptyCellName         13   Name of an empty cell
          sEndKeyPressedLetter   14   Displayed in the info area when the END
                                      key was pressed
          sFilePrintErrorMsg     15   Displayed when there was an error printing
                                      a spreadsheet to a file
          sFormatErrorMsg        16   Indicates the user there is an error in
                                      the format specified
          sFormatError1Msg       17   Number of decimals out of place
          sFormatError2Msg       18   Currency character not valid
          sFormulaCellName       19   Name of a formula cell
          sInvalidCellMsg        20   Cell address is not valid
          sInvalidWidthMsg       21   Specified column width not within range
          sMoveCellsMsg          22   Displayed when moving a block of cells
          sParseError1           23   Parse stack overflow
          sParseError2           24   Bad cell range
          sParseError3           25   Expected expression
          sParseError4           26   Expected operation

                                           47








          sParseError5           27   Expected opening parenthesis
          sParseError6           28   Expected cell
          sParseError7           29   Expected operator or closing parenthesis
          sPrinterPrintErrorMsg  30   Indicates the user there was an error when
                                      printing to the printer
          sPrintInitErrorMsg     31   Indicates the user there was an error when
                                      initializating the printer or file
          sPrintToWildCard       32   wildcard used to list the files that can
                                      be used when printing to a file
          sRecalcMsg             33   Displayed when recalculating the values of
                                      all the cells in the spreadsheet
          sRepeatCellName        34   Name of a repeat cell
          sTempFileName          35   Name of the file that will be used for
                                      temporary storage
          sTextCellName          36   Name of a text cell
          sValueCellName         37   Name of a value cell
          sWidthLetter           38   Displayed in the contents area, next to
                                      the current column's width

   ************************************************************************
   TBlock object
   ************************************************************************
   DECLARATION:

        TBlock = object(TObject)
            AnchorColShifted,
            AnchorRowShifted : Boolean;
            Anchor,
            Start,
            Stop : CellPos;
          constructor Init(InitStart : CellPos);
          function CellInBlock(CheckCell : CellPos) : Boolean;
          function ExtendTo(NewLoc : CellPos) : Boolean; virtual;
          constructor Load(var S: TStream);
          procedure Store(var S: TStream);
        end; {...TBlock }

   UNIT:

        GLSUPPRT.PAS

   DESCRIPTION:

        Stores the starting and ending position of a block of cells.  It can
        extend the block of cells in any direction.

   ************************************************************************
   TBlock.Anchor field
   ************************************************************************
   DECLARATION:

        Anchor : CellPos;

   UNIT:

        GLSUPPRT.PAS



                                         48








   DESCRIPTION:

        It is a position in the block that will never move when resizing the
        block.

   REMARKS:

        The anchor of a block is the cell position where the block was created. 
        It can be either the upper left corner or the lower right corner of the
        block.


   ************************************************************************
   TBlock.AnchorColShifted field
   ************************************************************************
   DECLARATION:

        AnchorColShifted : Boolean;

   UNIT:

        GLSUPPRT.PAS

   DESCRIPTION:

        Indicates the position of the anchor (see TBlock.Anchor) relative to the
        position of the stop column.  If FALSE, it means the stop column of the
        block is located after the column of the anchor (the normal position);
        if TRUE, it means the stop column of the block is located before the
        column of the anchor (the shifted position).

   REMARKS:

        You will never need to access this field directly.


   ************************************************************************
   TBlock.AnchorRowShifted field
   ************************************************************************
   DECLARATION:

        AnchorRowShifted : Boolean;

   UNIT:

        GLSUPPRT.PAS

   DESCRIPTION:

        Indicates the position of the anchor (see TBlock.Anchor) relative to the
        position of the stop row.  If FALSE, it means the stop row of the block
        is located after the row of the anchor (the normal position); if TRUE,
        it means the stop row of the block is located before the column of the
        anchor (the shifted position).





                                         49








   ************************************************************************
   TBlock.CellInBlock function
   ************************************************************************
   DECLARATION:

        function CellInBlock(CheckCell : CellPos) : Boolean;

   UNIT:

        GLSUPPRT.PAS

   DESCRIPTION:

        Checks if a given cell is inside the block.

   PARAMETERS' DESCRIPTION:

        CheckCell : the position of the cell that is being checked

   ************************************************************************
   TBlock.ExtendTo funcition
   ************************************************************************
   DECLARATION:

        function ExtendTo(NewLoc : CellPos) : Boolean; virtual;

   UNIT:

        GLSUPPRT.PAS

   DESCRIPTION:

        Extends the block to the given position.

   PARAMETERS' DESCRIPTION:

        NewLoc :  the position where the block will be extended to;  it can be
                  any position in the spreadsheet

   ************************************************************************
   TBlock.Init CONSTRUCTOR
   ************************************************************************
   DECLARATION:

        constructor Init(InitStart : CellPos);

   UNIT:

        GLSUPPRT.PAS

   DESCRIPTION:

        Creates and initializes the TBlock object.

   PARAMETERS' DESCRIPTION:

        InitStart : the position where the block will be created.


                                         50








   REMARKS:

        The Start and Stop field will be set to the cell position passed in the
        InitStart parameter.


   ************************************************************************
   TBlock.Load CONSTRUCTOR
   ************************************************************************
   DECLARATION:

        constructor Load(var S: TStream);

   UNIT:

        GLSUPPRT.PAS

   DESCRIPTION:

        Loads a block from disk.

   PARAMETERS' DESCRIPTION:

        S : the stream from which the block will be loaded.

   ************************************************************************
   TBlock.Start field
   ************************************************************************
   DECLARATION:

        Start : CellPos;

   UNIT:

        GLSUPPRT.PAS

   DESCRIPTION:

        The upper left corner of the block.

   ************************************************************************
   TBlock.Stop field
   ************************************************************************
   DECLARATION:

        Stop : CellPos;

   UNIT:

        GLSUPPRT.PAS

   DESCRIPTION:

        The lower right corner of the block.





                                         51








   ************************************************************************
   TBlock.Store procedure
   ************************************************************************
   DECLARATION:

        procedure Store(var S: TStream);

   UNIT:

        GLSUPPRT.PAS

   DESCRIPTION:

        Writes a block to disk.

   PARAMETERS' DESCRIPTION:

        S : the stream to which the block will be written.

   ************************************************************************
   TCell object
   ************************************************************************
   DECLARATION:

        TCell = OBJECT(TObject)
            Loc : CellPos;
          constructor Init(InitLoc : CellPos);
          destructor Done; virtual;
          function CellType : CellTypes; virtual;
          function LegalValue : Boolean; virtual;
          function Name : String; virtual;
          function Format(var FHash : TFormatHashTable;
            FormulasDisplayed : Boolean) : FormatType; virtual;
          function Width(var FHash : TFormatHashTable;
            FormulasDisplayed : Boolean) : Word; virtual;
          function Overwritten(var CHash : TCellHashTable;
            var FHash : TFormatHashTable; var WHash : TWidthHashTable;
            var LastPos : CellPos; MaxCols : Word;
            GetColWidth : GetColWidthFunc;
            FormulasDisplayed : Boolean) : Word; virtual;
          function ShouldUpdate : Boolean; virtual;
          function HasError : Boolean; virtual;
          function CurrValue : Extended; virtual;
          function OverwriteStart(var FHash : TFormatHashTable;
            var WHash : TWidthHashTable; GetColWidth : GetColWidthFunc;
            EndCol : Word; DisplayFormulas : Boolean) : Word; virtual;
          procedure EditString(MaxDecPlaces : Byte; var Input : String);      
        virtual;
          function DisplayString(FormulasDisplayed : Boolean;
            MaxDecPlaces : Byte) : String; virtual;
          function FormattedString(var OHash : TOverwriteHashTable;
            var FHash : TFormatHashTable; var WHash : TWidthHashTable;
            GetColWidth : GetColWidthFunc; CPos : CellPos;
            FormulasDisplayed : Boolean; Start : Word; ColWidth : Byte;
            var CurrencyString : CurrencyStr; var ClType: CellTypes):
            String; virtual;
          function CopyString : String; virtual;
        end; {...TCell }

                                           52








   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        This the main cell object.  You will never construct an instance of
        TCell itself;  rather you will use one or more of TCell's derived object
        types: TEmptyCell, TTextCell, TValueCell, TFormulaCell, TRepeatCell or
        create new derived object types.

   REMARKS:

        Most of TCell's methods are abstract methods.


   ************************************************************************
   TCell.CellType function
   ************************************************************************
   DECLARATION:

        function CellType : CellTypes; virtual;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Returns the type of the cell.  ABSTRACT METHOD.

   REMARKS:

        This function is used to determine what type of cell you are working
        with.  Each derived object type must override this method to return the
        aproppiate cell type when this function is called.

        (see CellTypes)


   ************************************************************************
   TCell.CopyString function
   ************************************************************************
   DECLARATION:

        function CopyString : String; virtual;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Returns a cell's string information.

   REMARKS:

        Every derived object type must override this method to return any string

                                           53








        information the cell stores.

        (see TCell.CurrValue)


   ************************************************************************
   TCell.CurrValue function
   ************************************************************************
   DECLARATION:

        function CurrValue : Extended; virtual;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Returns the current numeric value of a cell.  ABSTRACT METHOD.

   REMARKS:

        Every derived object type must override this method to return the
        correct current value of the cell when this function is called.

        (see TCell.CopyString)


   ************************************************************************
   TCell.DisplayString function
   ************************************************************************
   DECLARATION:

        function DisplayString(FormulasDisplayed : Boolean;
          MaxDecPlaces : Byte) : String; virtual;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Returns the string that will be displayed just above the input line. 
        ABSTRACT METHOD.

   PARAMETERS' DESCRIPTION:

        FormulasDisplayed : indicates if formulas (not their result) are being
                            displayed.

        MaxDecPlaces      : maximum number of decimal places that a number can
                            be displayed with.

   REMARKS:

        Every derived object type must override this method to create and return
        the string will the cell's contents, that will be displayed just above
        the input line.

                                           54









   ************************************************************************
   TCell.Done DESTRUCTOR
   ************************************************************************
   DECLARATION:

        destructor Done; virtual;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Performs the necessary cleanup and disposal of the cell object.

   ************************************************************************
   TCell.EditString procedure
   ************************************************************************
   DECLARATION:

        procedure EditString(MaxDecPlaces : Byte; var Input :
          String);  virtual;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Returns a string with the cell's contents.  ABSTRACT METHOD.

   PARAMETERS' DESCRIPTION:

        MaxDecPlaces : maximum number of decimal places that numbers can be
                       displayed with.

        Input        : parameter that will contain the string returned by this
                       procedure.

   REMARKS:

        Every derived object type must override this method to create and return
        a string with the cell's contents.


   ************************************************************************
   TCell.Format function
   ************************************************************************
   DECLARATION:

        function Format(var FHash : TFormatHashTable;
          FormulasDisplayed : Boolean) : FormatType; virtual;

   UNIT:

        GLCELL.PAS


                                         55








   DESCRIPTION:

        Returns the format value for the cell.  ABSTRACT METHOD.

   PARAMETERS' DESCRIPTION:

        FHash             :      a format hash table.

        FormulasDisplayed :      indicates if formulas (not their results) are
                                 being displayed, which affects the default
                                 format value for formula cells.

   REMARKS:

        Each derived object type must override this method to return the
        appropiate default format value for the cell, in case there is not a
        format value for the cell in the format hash table.


   ************************************************************************
   TCell.FormattedString function
   ************************************************************************
   DECLARATION:

        function FormattedString(var OHash : TOverwriteHashTable;
          var FHash : TFormatHashTable; var WHash : TWidthHashTable;
          GetColWidth : GetColWidthFunc; CPos : CellPos;
          FormulasDisplayed : Boolean; Start : Word; ColWidth : Byte;
          var CurrencyString : CurrencyStr; var ClType: CellTypes):
          String; virtual;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Returns the formatted string that will be used to display the cell's
        contents in the spreadsheet.

   PARAMETERS' DESCRIPTION:

        OHash     :    an overwrite hash table; if an overwritten empty cell is
                       being displayed, the overwrite hash table is used to
                       determine which cell is overwriting the empty cell.

        FHash     :    a format hash table; used to determine the cell's format.

        WHash     :    a width hash table; used to determine the width of the of
                       the columns where the string will be displayed.

        GetColWidth :  function used to determine the width of a column.

        CPos        :  the position of the cell being displayed (used when
                       displaying overwritten empty cells).

        FormulasDisplayed : indicate if formulas (not their result) are being
                            displayed.

                                           56








        Start             : place in the cell's contents where the displayed
                            string must start (used when displaying overwritten
                            empty cells).

        ColWidth          : width of the column where the cell is being
                            displayed (used when displaying overwritten empty
                            cells).

        CurrencyString    : if the cell's contents should be displayed with a
                            currency character, it is returned in this
                            parameter.

        ClType            : used to determine the type of the cell being
                            displayed (used when displaying overwritten empty
                            cells).

   REMARKS:

        Every derived object type must override this method to create, format
        and return the appropiate string that will be used to display the cell's
        contents in the spreadsheet.


   ************************************************************************
   TCell.HashError function
   ************************************************************************
   DECLARATION:

        function HasError : Boolean; virtual;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Returns TRUE if the cell has a numeric error in it.  ABSTRACT METHOD.

   REMARKS:

        Every derived object type must override this method to return the
        appropiate boolean value when this function is called.


   ************************************************************************
   TCell.Init CONSTRUCTOR
   ************************************************************************
   DECLARATION:

        constructor Init(InitLoc : CellPos);

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Creates and initializes the TCell object.

                                           57








   PARAMETERS' DESCRIPTION:

        InitLoc : the position the cell has in the spreadsheet.

   ************************************************************************
   TCell.LegalValue function
   ************************************************************************
   DECLARATION:

        function LegalValue : Boolean; virtual;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Returns TRUE if the cell has a legal numeric value.  ABSTRACT METHOD.

   REMARKS:

        Each derived object type must override this method to return the
        appropiate value when this function is called.


   ************************************************************************
   TCell.Loc field
   ************************************************************************
   DECLARATION:

        Loc : CellPos;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        This is the position of the cell in the spreadsheet.

   ************************************************************************
   TCell.Name function
   ************************************************************************
   DECLARATION:

        function Name : String; virtual;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Returns a string with the name of the cell.  ABSTRACT METHOD.

   REMARKS:

        Each derived object type must override this method to return the

                                           58








        appropiate name for the cell when this function is called.


   ************************************************************************
   TCell.OverwriteStart function
   ************************************************************************
   DECLARATION:

        function OverwriteStart(var FHash : TFormatHashTable;
          var WHash : TWidthHashTable;  GetColWidth : GetColWidthFunc;
          EndCol : Word; DisplayFormulas : Boolean) : Word; virtual;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Determines, for overwritten empty cells, where in the overwriten data
        they 
        they will start to display a value.  ABSTRACT METHOD.

   PARAMETERS' DESCRIPTION:

        FHash     :    a format hash table; used to determine the format of the
                       cell and therefore, the size of the cell's contents.

        WHash     :    a width hash table; used to determine the width of the
                       columns where the data is being displayed.

        GetColWidth :  function used to determine the width of a column (see
                       GetColWidth).

        EndCol      :  column where the overwritten data will be displayed.

        DisplayFormulas :   indicates if formulas (not their results) are being
                            displayed.

   REMARKS:

        Every derived object type must override this method to return the
        correct place of the overwriting data where empty overwritten cells will
        start displaying the data.


   ************************************************************************
   TCell.Overwritten function
   ************************************************************************
   DECLARATION:

        function Overwritten(var CHash : TCellHashTable;
          var FHash : TFormatHashTable; var WHash : TWidthHashTable;
          var LastPos : CellPos; MaxCols : Word;
          GetColWidth : GetColWidthFunc; FormulasDisplayed : Boolean) :
          Word; virtual;

   UNIT:

        GLCELL.PAS

                                         59








   DESCRIPTION:

        Calculates how many empty cells the cell will overwrite.  ABSTRACT
        METHOD.

   PARAMETERS' DESCRIPTION:

        CHash       :  a cell hash table; used to determine if there is a non-
                       empty cell near, which may affect the number of cells the
                       cell will overwrite.

        WHash       :  a width hash table; used to determine the width of the
                       columns where the cell is being displayed, which affects
                       how many cells the cell will overwrite.

        FHash       :  a format hash table; used to determine the format of the
                       cell, which may affect how many cells it will overwrite.

        LastPos     :  the lower right corner of the block of cells in the
                       spreadsheet actually used.

        MaxCols     :  maximum number of columns in the spreadsheet.

        GetColWidth :  a function used to determine the width of a column (see
                       GetColWidth).

        FormulasDisplayed : indicates if formulas (not their results) are being
                            displayed, which affects how many cells a formula
                            cell may overwrite.

   REMARKS:

        Each derived object type must override this method to return the correct
        number of cells the cell will overwrite.


   ************************************************************************
   TCell.ShouldUpdate function
   ************************************************************************
   DECLARATION:

        function ShouldUpdate : Boolean; virtual;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Returns TRUE if the cell needs to be udpated when the spreadsheet
        changes.  ABSTRACT METHOD.

   REMARKS:

        Every derived object type must override this method to return the
        appropiate boolean value according to the nature of the cell's contents.



                                         60








   ************************************************************************
   TCell.Width function
   ************************************************************************
   DECLARATION:

        function Width(var FHash : TFormatHashTable;
          FormulasDisplayed : Boolean) : Word; virtual;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Returns the width of a cell (including the cells it will overwrite). 
        ABSTRACT METHOD.

   PARAMETERS' DESCRIPTION:

        FHash             :      a format hash table.

        FormulasDisplayed :      indicates if formulas (not their results) are
                                 being displayed, which affects the the width of
                                 formula cells.

   REMARKS:

        Each derived object type must override this method to return the correct
        width of the cell.


   ************************************************************************
   TCellHashTable object
   ************************************************************************
   DECLARATION:

        TCellHashTable = OBJECT(THashTable)
            CurrCell : PCell;
            CurrLoc : CellPos;
          constructor Init(InitBuckets : BucketRange);
          destructor Done;
          function Add(ACell : PCell) : Boolean;
          procedure Delete(DelLoc : CellPos; var DeletedCell : PCell);
          function Search(SPos : CellPos) : PCell;
          function HashValue : LongInt; virtual;
          function Found(Item : HashItemPtr) : Boolean; virtual;
          procedure CreateItem(var Item : HashItemPtr); virtual;
          function ItemSize : HashItemSizeRange; virtual;
          procedure Load(var S : TStream; Total : Longint;
            AdjustAfter: CellPos; RowAdjustment, ColAdjustment: Integer);
          procedure Store(var S : TStream);
          function FirstItem : PCell;
          function NextItem : PCell;
        end; {...TCellHashTable }

   UNIT:

        GLCELL.PAS

                                         61








   DESCRIPTION:

        TCellHashTable stores pointers to all the cells in a spreadsheet.

   ************************************************************************
   TCellHashTable.Add function
   ************************************************************************
   DECLARATION:

        function Add(ACell : PCell) : Boolean;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Adds a cell to the hash table.

   PARAMETERS' DESCRIPTION:

        ACell : cell pointer that will be added to the hash table.

   ************************************************************************
   TCellHashTable.CreateItem procedure
   ************************************************************************
   DECLARATION:

        procedure CreateItem(var Item : HashItemPtr); virtual;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Creates a HashItem and puts in it the information to be stored (in this
        case, a cell pointer).

   PARAMETERS' DESCRIPTION:

        Item : pointer to the HashItem created. 

   REMARKS:

        You will never need to call this method directly.

        (see TCellHashTable.Init)


   ************************************************************************
   TCellHashTable.CurrCell field
   ************************************************************************
   DECLARATION:

        CurrCell : PCell;



                                         62








   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Stores a pointer to the cell being added, searched for or deleted from
        the hash table.

   REMARKS:

        You will never need to access this field directly.


   ************************************************************************
   TCellHashTable.CurrLoc field
   ************************************************************************
   DECLARATION:

        CurrLoc : CellPos;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Stores the location of the cell being added, searched for or deleted
        from the hash table.

   REMARKS:

        You will never need to access this field directly.


   ************************************************************************
   TCellHashTable.Delete procedure
   ************************************************************************
   DECLARATION:

        procedure Delete(DelLoc : CellPos; var DeletedCell : PCell);

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Deletes a cell from the hash table.

   PARAMETERS' DESCRIPTION:

        DelLoc         :    It is the position in the spreadsheet of the cell to
                            be deleted.

        DeletedCell    :    After deleting the cell from the hash table, a
                            pointer to cell object is returned in the
                            DeletedCell parameter (or NIL if the item is not

                                           63








                            found).

   REMARKS:


        If you call TCellHashTable.Delete directly, be sure to dispose the
        deleted cell object when you no longer need it.


   ************************************************************************
   TCellHashTable.Done DESTRUCTOR
   ************************************************************************
   DECLARATION:

        destructor Done;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Performs the necessary cleanup and disposal of the cell hash table.

   ************************************************************************
   TCellHashTable.FirstItem function
   ************************************************************************
   DECLARATION:

        function FirstItem : PCell;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Returns the first HashItem (cell pointer) in a cell hash table.

   REMARKS:

        To find all the items in a hash table, call FirstItem to get the first
        one and then call NextItem to get the rest.


   ************************************************************************
   TCellHashTable.Found function
   ************************************************************************
   DECLARATION:

        function Found(Item : HashItemPtr) : Boolean; virtual;

   UNIT:

        GLCELL.PAS




                                         64








   DESCRIPTION:

        This function is called by TCellHashTable.Search.  It returns a Boolean
        value indicating whether the current HashItem is the one being searched
        for.


   PARAMETERS' DESCRIPTION:

        Item : is a pointer to a HashItem in the hash table.

   REMARKS:

        You will never need to call this method directly.


   ************************************************************************
   TCellHashTable.HashValue function
   ************************************************************************
   DECLARATION:

        function HashValue : LongInt; virtual;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Returns a number that is used to determine the number of the bucket a
        HashItem should be put in.

   REMARKS:

        This function is also used to search for a HashItem a hash table.  The
        linked list (bucket) in which a HashItem is located is determined using
        the value returned by the HashValue function; then a sequential search
        is performed in the list until TCellHashTable.Found returns TRUE.

        All cells with the same HashValue are placed in the same bucket.


   ************************************************************************
   TCellHashTable.Init CONSTRUCTOR
   ************************************************************************
   DECLARATION:

        constructor Init(InitBuckets: BucketRange);

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Creates and initializes the TCellHashTable object.



                                         65








   PARAMETERS' DESCRIPTION:

        InitBuckets: The number of buckets the hash table will have.

   REMARKS:

        DEFINITION: A bucket is a linked list of HashItems that have the same
        hash value.

        DEFINITION: A HashItem is a data structure used to store information in
        the hash table.  A HashItem is created by the CreateItem procedure.

        (see TCHASH.INT, THashTable.Add, TCellHashTable,
        TCellHashTable.HashValue)


   ************************************************************************
   TCellHashTable.ItemSize function
   ************************************************************************
   DECLARATION:

        function ItemSize : HashItemSizeRange; virtual;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Returns the size of a HashItem.

   REMARKS:

        The size of the HashItem depends on the information to be stored.

        You will never need to call this method directly.


   ************************************************************************
   TCellHashTable.Load procedure
   ************************************************************************
   DECLARATION:

        procedure Load(var S : TStream; Total : Longint;
          AdjustAfter: CellPos; RowAdjustment, ColAdjustment: Integer);

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Loads a cell hash table from disk.

   PARAMETERS' DESCRIPTION:

        S              :    the stream from which the cell hash table will be
                            loaded.

                                           66









        Total          :    the total number of HashItems (cell pointers) that
                            will be loaded from the stream.

        AdjustAfter    :    The location of all cells below and to the left of
                            this position, will be increased by RowAdjustment
                            and ColAdjustment respectively.

        RowAdjustment  :    the row location of all cells below AdjustAfter will
                            be increased by this amount.

        ColAdjustment  :    the column location of all cells to the left of
                            AdjustAfter will be increased by this amount.

   REMARKS:

        The AdjustAfter, RowAdjustment and ColAdjustment parameters are used to
        relocate the cells in the cell hash table, when adding or deleting rows
        or columns.

        (see TSpreadSheet.InsertColumns, TSpreadSheet.InsertRows,
        TSpreadSheet.DeleteColumns, TSpreadSheet.DeleteRows)


   ************************************************************************
   TCellHashTable.NextItem function
   ************************************************************************
   DECLARATION:

        function NextItem : PCell;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Returns the second and subsequent HashItems in a cell hash table.

   REMARKS:

        (see TCellHashTable.FirstItem)


   ************************************************************************
   TCellHashTable.Search function
   ************************************************************************
   DECLARATION:

        function Search(SPos : CellPos) : PCell;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Searches for a cell in the spreadsheet; it returns a pointer to the cell

                                           67








        if it was found, or a pointer to an empty cell otherwise.

   PARAMETERS' DESCRIPTION:

        SPos : the cell's position in the spreadsheet.

   REMARKS:

        (see TCellHashTable.Found)


   ************************************************************************
   TCellHashTable.Store procedure
   ************************************************************************
   DECLARATION:

        procedure Store(var S : TStream);

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Writes a cell hash table to disk.

   PARAMETERS' DESCRIPTION:

        S : the stream to which the cell hash table will be written.

   ************************************************************************
   TEmptyCell object
   ************************************************************************
   DECLARATION:

        TEmptyCell = object(TCell)
          constructor Init;
          function CellType : CellTypes; virtual;
          function LegalValue : Boolean; virtual;
          function Name : String; virtual;
          function Format(var FHash : TFormatHashTable;
            FormulasDisplayed : Boolean) : FormatType; virtual;
          function Width(var FHash : TFormatHashTable;
            FormulasDisplayed : Boolean) : Word; virtual;
          function Overwritten(var CHash : TCellHashTable;
            var FHash : TFormatHashTable; var WHash : TWidthHashTable;
            var LastPos : CellPos; MaxCols : Word;
            GetColWidth : GetColWidthFunc; FormulasDisplayed : Boolean) :
            Word; virtual;
          function ShouldUpdate : Boolean; virtual;
          function HasError : Boolean; virtual;
          function CurrValue : Extended; virtual;
          function OverwriteStart(var FHash : TFormatHashTable;
            var WHash : TWidthHashTable; GetColWidth : GetColWidthFunc;
            EndCol : Word; DisplayFormulas : Boolean) : Word; virtual;
          procedure EditString(MaxDecPlaces : Byte; var Input : String);
            virtual;
          function DisplayString(FormulasDisplayed : Boolean;

                                           68








            MaxDecPlaces : Byte) : String; virtual;
          function FormattedString(var OHash : TOverwriteHashTable;
            var FHash : TFormatHashTable; var WHash : TWidthHashTable;
            GetColWidth : GetColWidthFunc; CPos : CellPos;
            FormulasDisplayed : Boolean; Start : Word; ColWidth : Byte;
            var CurrencyString : CurrencyStr; var ClType: CellTypes):
            String; virtual;
          function CopyString : String; virtual;
        end; {..TEmptyCell }

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        A TCell's descendant that is used to display all empty and/or
        overwritten cells.  Only one instance is TEmptyCell needs to be
        constructed.

   REMARKS:

        (see Empty, TCell)


   ************************************************************************
   TEmptyCell.CellType function
   ************************************************************************
   DECLARATION:

        (see TCell.CellType)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TEmptyCell.CopyString function
   ************************************************************************
   DECLARATION:

        (see TCell.CopyString)

   UNIT:

        GLCELL.PAS

   REMARKS:

        This function always returns an empty string.


   ************************************************************************
   TEmptyCell.CurrValue function
   ************************************************************************
   DECLARATION:

        (see TCell.CurrValue)

                                           69








   UNIT:

        GLCELL.PAS

   REMARKS:

        This function always returns 0.


   ************************************************************************
   TEmptyCell.DisplayString function
   ************************************************************************
   DECLARATION:

        (see TCell.DisplayString)

   UNIT:

        GLCELL.PAS

   REMARKS:

        This function always returns an empty string.


   ************************************************************************
   TEmptyCell.EditString procedure
   ************************************************************************
   DECLARATION:

        (see TCell.EditString)

   UNIT:

        GLCELL.PAS

   REMARKS:

        This procedure always returns an empty string in the input parameter.


   ************************************************************************
   TEmptyCell.Format function
   ************************************************************************
   DECLARATION:

        (see TCell.Format)

   UNIT:

        GLCELL.PAS

   REMARKS:

        This function always returns 0 since there is no point in formatting an
        empty cell.



                                         70








   ************************************************************************
   TEmptyCell.FormattedString function
   ************************************************************************
   DECLARATION:

        (see TCell.FormattedString)

   UNIT:

        GLCELL.PAS

   REMARKS:

        This functions checks if the cell is overwritten by another cell.  If
        true, it returns the portion of the other cell's data that overwrites
        the empty cell.  If the empty cell is not overwritten by another cell,
        it returns an empty string.


   ************************************************************************
   TEmptyCell.HasError function
   ************************************************************************
   DECLARATION:

        (see TCell.HasError)

   UNIT:

        GLCELL.PAS

   REMARKS:

        This function always returns FALSE.


   ************************************************************************
   TEmptyCell.Init CONSTRUCTOR
   ************************************************************************
   DECLARATION:

        constructor Init;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Creates and initializes the TEmptyCell object.

   ************************************************************************
   TEmptyCell.LegalValue function
   ************************************************************************
   DECLARATION:

        (see TCell.LegalValue)



                                         71








   UNIT:

        GLCELL.PAS

   REMARKS:

        This function always returns TRUE.


   ************************************************************************
   TEmptyCell.Name function
   ************************************************************************
   DECLARATION:

        (see TCell.Name)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TEmptyCell.OverwriteStart function
   ************************************************************************
   DECLARATION:

        (see TCell.OverwriteStart)

   UNIT:

        GLCELL.PAS

   REMARKS:

        This function always returns 1.


   ************************************************************************
   TEmptyCell.Overwritten function
   ************************************************************************
   DECLARATION:

        (see TCell.Overwritten)

   UNIT:

        GLCELL.PAS

   REMARKS:

        This function always returns 0.


   ************************************************************************
   TEmptyCell.ShouldUpdate function
   ************************************************************************
   DECLARATION:

        (see TCell.ShouldUpdate)

                                           72








   UNIT:

        GLCELL.PAS

   REMARKS:

        This function always returns FALSE.


   ************************************************************************
   TEmptyCell.Width function
   ************************************************************************
   DECLARATION:

        (see TCell.Width)

   UNIT:

        GLCELL.PAS

   REMARKS:

        This function always returns 0.


   ************************************************************************
   TFormatHashTable object
   ************************************************************************
   DECLARATION:

        TFormatHashTable = OBJECT(THashTable)
            CurrStart,
            CurrStop : CellPos;
            CurrFormat : FormatType;
          constructor Init;
          destructor Done;
          function Overwrite(NewStart, NewStop : CellPos) : Boolean;
          function Add(NewStart, NewStop : CellPos;
            NewFormat : FormatType) : Boolean;
          function Delete(DStart, DStop : CellPos) : Boolean;
          function Search(SPos : CellPos; var F : FormatType) : Boolean;
          function HashValue : LongInt; virtual;
          function Found(Item : HashItemPtr) : Boolean; virtual;
          procedure CreateItem(var Item : HashItemPtr); virtual;
          function ItemSize : HashItemSizeRange; virtual;
          procedure Load(var S : TStream; Total : Longint);
          procedure Store(var S : TStream);
        end; {...TFormatHashTable }

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Used to store information about areas formatted with a format that
        differs from the default.


                                         73








   REMARKS:

        The area and the format are stored in the hash table.


   ************************************************************************
   TFormatHashTable.Add function
   ************************************************************************
   DECLARATION:

        function Add(NewStart, NewStop : CellPos;
          NewFormat : FormatType) : Boolean;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Adds a new formatted area to the format hash table.

   PARAMETERS' DESCRIPTION:

        NewStart  :    Upper left corner of the area being added to the format
                       hash table.

        NewStop   :    Lower right corner of the area being added to the format
                       hash table.

        NewFormat :    Format value assigned to the area being added to the
                       format hash table.

   REMARKS:

        Add will return TRUE if the cell was successfully added; FALSE
        otherwise.

        (see TFormatHashTable.Overwrite, THashTable.Add)


   ************************************************************************
   TFormatHashTable.CreateItem procedure
   ************************************************************************
   DECLARATION:

        (see TCellHashTable.CreateItem)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TFormatHashTable.CurrFormat field
   ************************************************************************
   DECLARATION:

        CurrFormat : FormatType;


                                         74








   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Stores the format value being added or searched for -- if found --.

   REMARKS:

        You will never need to access this field directly.


   ************************************************************************
   TFormatHashTable.CurrStart field
   ************************************************************************
   DECLARATION:

        CurrStart : CellPos;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Stores the location in the spreadsheet of the upper left corner of the
        block (area) of cells that is being added to the hash table;  also used
        by the Search function to store the position of the cell for which a
        format is being searched.

   REMARKS:

        You will never need to access this field directly.

        (see TFormatHashTable.CurrStop, TFormatHashTable.CurrFormat,
        TFormatHashTable.Search)


   ************************************************************************
   TFormatHashTable.CurrStop field
   ************************************************************************
   DECLARATION:

        CurrStop : CellPos;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Stores the location in the spreadsheet of the lower right corner of the
        block (area) of cells being added to the hash table. 

   REMARKS:

        You will never need to access this field directly.

                                           75








        (see TFormatHashTable.CurrStart, TFormatHashTable.CurrFormat)


   ************************************************************************
   TFormatHashTable.Delete function
   ************************************************************************
   DECLARATION:

        function Delete(DStart, DStop : CellPos) : Boolean;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Deletes an area from the hash table.

   PARAMETERS' DESCRIPTION:

        DStart    :    Upper left corner of the area to be deleted.

        DStop     :    Lower right corner of the area to be deleted.

   REMARKS:

        This function returns TRUE if the operation was completed successfully. 
        However, this does not mean that the area actually existed in the hash
        table.

        The area that is being deleted can be any area; it does not have to be
        exactly one of the areas added to the hash table with the Add function.


   ************************************************************************
   TFormatHashTable.Done DESTRUCTOR
   ************************************************************************
   DECLARATION:

        destructor Done;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Performs the necessary cleanup and disposal of the format hash table.

   ************************************************************************
   TFormatHashTable.Found function
   ************************************************************************
   DECLARATION:

        (see TCellHashTable.Found)




                                         76








   UNIT:

        GLCELL.PAS

   ************************************************************************
   TFormatHashTable.HashValue function
   ************************************************************************
   DECLARATION:

        (see TCellHashTable.HashValue)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TFormatHashTable.Init CONSTRUCTOR
   ************************************************************************
   DECLARATION:

        constructor Init;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Creates and initializes the TFormatHashTable object.

   REMARKS:

        (see TFormatHashTable)


   ************************************************************************
   TFormatHashTable.ItemSize function
   ************************************************************************
   DECLARATION:

        (see TCellHashTable.ItemSize)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TFormatHashTable.Load procedure
   ************************************************************************
   DECLARATION:

        procedure Load(var S : TStream; Total : Longint);

   UNIT:

        GLCELL.PAS



                                         77








   DESCRIPTION:

        Loads a format hash table from disk.

   PARAMETERS' DESCRIPTION:

        S     :   the stream from which the format hash table will be loaded.

        Total :   the total number of HashItems that will be loaded from the
                  stream.

   ************************************************************************
   TFormatHashTable.Overwrite function
   ************************************************************************
   DECLARATION:

        function Overwrite(NewStart, NewStop : CellPos) : Boolean;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Checks to see if a new area has overwritten an old one, requiring the
        old area to be completely overwritten or broken into parts.

   PARAMETERS' DESCRIPTION:

        NewStart :     Upper left corner of the new area being added to the hash
                       table.

        NewStop  :     Lower right corner of the new area being added to the
                       hash table.

   REMARKS:

        You will never need to call this method directly.

        (see TFormatHashTable.Add)


   ************************************************************************
   TFormatHashTable.Search function
   ************************************************************************
   DECLARATION:

        function Search(SPos : CellPos; var F : FormatType) : Boolean;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Determines if a cell is part of a formatted area and if true, returns
        the appropriate format value for the cell.


                                         78








   PARAMETERS' DESCRIPTION:

        SPos :    The position in the spreadsheet of the cell whose format value
                  is being determined.

        F    :    The appropriate format value for the cell.

   REMARKS:

        If the cell is not a formatted cell, the Search returns FALSE.


   ************************************************************************
   TFormatHashTable.Store procedure
   ************************************************************************
   DECLARATION:

        procedure Store(var S : TStream);

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Writes a format hash table to disk.

   PARAMETERS' DESCRIPTION:

        S : the stream to which the format hash table will be written.

   ************************************************************************
   TFormulaCell object
   ************************************************************************
   DECLARATION:

        TFormulaCell = object(TCell)
            Error : Boolean;
            Value : Extended;
            Formula : LString;
          constructor Init(InitLoc : CellPos; InitError : Boolean;
            InitValue : Extended; InitFormula : String);
          function CellType : CellTypes; virtual;
          function LegalValue : Boolean; virtual;
          function Name : String; virtual;
          function Format(var FHash : TFormatHashTable;
            FormulasDisplayed : Boolean) : FormatType; virtual;
          function Width(var FHash : TFormatHashTable;
            FormulasDisplayed : Boolean) : Word; virtual;
          function Overwritten(var CHash : TCellHashTable;
            var FHash : TFormatHashTable; var WHash : TWidthHashTable;
            var LastPos : CellPos; MaxCols : Word;
            GetColWidth : GetColWidthFunc; FormulasDisplayed : Boolean) :
            Word; virtual;
          function ShouldUpdate : Boolean; virtual;
          function HasError : Boolean; virtual;
          function CurrValue : Extended; virtual;
          function OverwriteStart(var FHash : TFormatHashTable;

                                           79








            var WHash : TWidthHashTable; GetColWidth : GetColWidthFunc;
            EndCol : Word; DisplayFormulas : Boolean) : Word; virtual;
          procedure EditString(MaxDecPlaces : Byte; var Input : String);
            virtual;
          function DisplayString(FormulasDisplayed : Boolean;
            MaxDecPlaces : Byte) : String; virtual;
          function FormattedString(var OHash : TOverwriteHashTable;
            var FHash : TFormatHashTable; var WHash : TWidthHashTable;
            GetColWidth : GetColWidthFunc; CPos : CellPos;
            FormulasDisplayed : Boolean; Start : Word; ColWidth : Byte;
            var CurrencyString : CurrencyStr; var ClType: CellTypes):
            String; virtual;
          function CopyString : String; virtual;
          constructor Load(var S : TStream);
          procedure Store(var S : TStream);
          function GetFormula : String;
          destructor Done; virtual;
        end; {...TFormulaCell }

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        A TCell's descendant that stores a formula its result.

   ************************************************************************
   TFormulaCell.CellType function
   ************************************************************************
   DECLARATION:

        (see TCell.CellType)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TFormulaCell.CopyString function
   ************************************************************************
   DECLARATION:

        (see TCell.CopyString)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TFormulaCell.CurrValue function
   ************************************************************************
   DECLARATION:

        (see TCell.CurrValue)




                                         80








   UNIT:

        GLCELL.PAS

   ************************************************************************
   TFormulaCell.DisplayString function
   ************************************************************************
   DECLARATION:

        (see TCell.DisplayString)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TFormulaCell.Done DESTRUCTOR
   ************************************************************************
   DECLARATION:

        destructor Done; virtual;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Performs all the necessary cleanup and disposal of the TFormulaCell
        object.

   ************************************************************************
   TFormulaCell.EditString procedure
   ************************************************************************
   DECLARATION:

        (see TCell.EditString)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TFormulaCell.Error field
   ************************************************************************
   DECLARATION:

        Error : Boolean;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Indicates if there is a numeric error in the value stored by the cell.



                                         81








   ************************************************************************
   TFormulaCell.Format function
   ************************************************************************
   DECLARATION:

        (see TCell.Format)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TFormulaCell.FormattedString function
   ************************************************************************
   DECLARATION:

        (see TCell.FormattedString)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TFormulaCell.Formula field
   ************************************************************************
   DECLARATION:

        Formula : LString;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Used to store the formula string.

   REMARKS:

        (see TTextCell.Txt)


   ************************************************************************
   TFormulaCell.GetFormula function
   ************************************************************************
   DECLARATION:

        function GetFormula : String;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Returns the formula string stored by the cell.



                                         82








   ************************************************************************
   TFormulaCell.HasError function
   ************************************************************************
   DECLARATION:

        (see TCell.HasError)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TFormulaCell.Init CONSTRUCTOR
   ************************************************************************
   DECLARATION:

        constructor Init(InitLoc : CellPos; InitError : Boolean;
          InitValue : Extended; InitFormula : String);

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Creates and initializes the TFormulaCell object.

   PARAMETERS' DESCRIPTION:

        InitLoc   :    the position of the cell in the spreadsheet.

        InitError :    indicates if there is a numerical error in the cell's
                       value (the formula's result).

        InitValue :    the value of the cell (the formula's result).

        InitFormula :  the formula that the cell will store.

   ************************************************************************
   TFormulaCell.LegalValue function
   ************************************************************************
   DECLARATION:

        (see TCell.LegalValue)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TFormulaCell.Load CONSTRUCTOR
   ************************************************************************
   DECLARATION:

        constructor Load(var S: TStream);




                                         83








   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Loads the cell's contents from disk.

   PARAMETERS' DESCRIPTION:

        S : the stream from which will be read the cell's contents.

   ************************************************************************
   TFormulaCell.Name function
   ************************************************************************
   DECLARATION:

        (see TCell.Name)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TFormulaCell.OverwriteStart function
   ************************************************************************
   DECLARATION:

        (see TCell.OverwriteStart)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TFormulaCell.Overwritten function
   ************************************************************************
   DECLARATION:

        (see TCell.Overwritten)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TFormulaCell.ShouldUpdate function
   ************************************************************************
   DECLARATION:

        (see TCell.ShouldUpdate)

   UNIT:

        GLCELL.PAS




                                         84








   ************************************************************************
   TFormulaCell.Store procedure
   ************************************************************************
   DECLARATION:

        procedure Store(var S: TStream);

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Writes the cell's contents to disk.

   PARAMETERS' DESCRIPTION:

        S : the stream to which the cell's contents will be written.

   ************************************************************************
   TFormulaCell.Value field
   ************************************************************************
   DECLARATION:

        Value : Extended;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        The numeric value of the formula.

   REMARKS:

        (see TFormulaCell.Formula)


   ************************************************************************
   TFormulaCell.Width function
   ************************************************************************
   DECLARATION:

        (see TCell.Width)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   THashTable object
   ************************************************************************
   DECLARATION:

        THashTable = OBJECT(HashTable)
          function Add: Boolean;
        end; {...THashTable }

                                           85








   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Extends Borland's HashTable object;  it checks the value of the
        LowMemory function before adding any data to the hash table.

   REMARKS:

        All the hash tables used in OOGrid Library(TM) v1.0 are descendants of
        THashTable.

        (see TCHASH.INT)


   ************************************************************************
   THashTable.Add function
   ************************************************************************
   DECLARATION:

        function Add: Boolean;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Adds data to the hash table by calling HashTable.Add.

   REMARKS:

        Add checks the value of the LowMemory function before calling
        HashTable.Add.  If it returns FALSE, no data is added to the hash table
        and Add returns FALSE; otherwise, the data is added and Add returns
        TRUE.

        The HashTable.Add method adds data to the hash table by calling the
        CreateItem method.  Since HashTable.CreateItem is an abstract method,
        this method must be overridden in a HashTable's descendant to actually
        add any data.

        (see TCHASH.INT)


   ************************************************************************
   THeadersHashTable object
   ************************************************************************
   DECLARATION:

        THeadersHashTable = OBJECT(THashTable)
            CurrCol : Word;
            CurrName : String[80];
          constructor Init(InitBuckets : BucketRange);
          function Add(SCol : Word; NewName: String) : Boolean;
          procedure CreateItem(var Item : HashItemPtr); virtual;

                                           86








          procedure Delete(Col : Word);
          function Found(Item : HashItemPtr) : Boolean; virtual;
          function HashValue : LongInt; virtual;
          function ItemSize : HashItemSizeRange; virtual;
          procedure Load(var S : TStream; Total : Longint);
          function Search(Col : Word; var Name: String) : Boolean;
          function SearchName(Name: String; var Col: Word) : Boolean;
          procedure Store(var S : TStream);
          destructor Done;
        end; {...THeadersHashTable }

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Stores custom assigned column headers.

   REMARKS:

        Stores the column number and the column's header.


   ************************************************************************
   THeadersHashTable.Add function
   ************************************************************************
   DECLARATION:

        function Add(SCol : Word; NewName: String) : Boolean;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Adds a new header to the headers hash table.

   PARAMETERS' DESCRIPTION:

        SCol : number of the column whose header is being added.

        NewName : the new header for the column.

   ************************************************************************
   THeadersHashTable.CreateItem procedure
   ************************************************************************
   DECLARATION:

        (see TCellHashTable.CreateItem)

   UNIT:

        GLCELL.PAS




                                         87








   ************************************************************************
   THeadersHashTable.CurrCol field
   ************************************************************************
   DECLARATION:

        CurrCol : Word

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Stores the column for which a header is being added, searched for or
        deleted from the headers hash table.

   REMARKS:

        You will never need to access this field directly.


   ************************************************************************
   THeadersHashTable.CurrName field
   ************************************************************************
   DECLARATION:

        CurrName : String[80];

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Stores the header that is being added, searched for -- if found -- or
        deleted from the headers hash table.

   REMARKS:

        You will never need to access this field directly.


   ************************************************************************
   THeadersHashTable.Delete procedure
   ************************************************************************
   DECLARATION:

        procedure Delete(Col : Word);

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Deletes a header from the headers hash table.



                                         88








   PARAMETERS' DESCRIPTION:

        Col : number of the column whose header will be deleted.

   ************************************************************************
   THeadersHashTable.Done DESTRUCTOR
   ************************************************************************
   DECLARATION:

        destructor Done;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Performs the necessary cleanup and disposal of the headers hash table.

   ************************************************************************
   THeadersHashTable.Found function
   ************************************************************************
   DECLARATION:

        (see TCellHashTable.Found)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   THeadersHashTable.HashValue function
   ************************************************************************
   DECLARATION:

        (see TCellHashTable.HashValue)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   THeadersHashTable.Init CONSTRUCTOR
   ************************************************************************
   DECLARATION:

        constructor Init(InitBuckets : BucketRange);

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Creates and initializes the THeadersHashTable object.




                                         89








   PARAMETERS' DESCRIPTION:

        InitBuckets :  number of buckets (linked lists) the headers hash  table
                       will have.

   ************************************************************************
   THeadersHashTable.ItemSize function
   ************************************************************************
   DECLARATION:

        (see TCellHashTableashValue.ItemSize)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   THeadersHashTable.Load procedure
   ************************************************************************
   DECLARATION:

        procedure Load(var S : TStream; Total : Longint);

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Loads a headers hash table from disk.

   PARAMETERS' DESCRIPTION:

        S     :   stream from which the headers hash table will be loaded.

        Total :   total number of items that will be loaded from the stream.

   ************************************************************************
   THeadersHashTable.Search function
   ************************************************************************
   DECLARATION:

        function Search(Col : Word; var Name: String) : Boolean;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Searches for a header given the column number.

   PARAMETERS' DESCRIPTION:

        Col  :    the number of the column whose header is being searched.

        Name :    this parameter will be set to the column's header, if found.


                                         90








   REMARKS:

        Search will return TRUE if the header was found; FALSE otherwise.


   ************************************************************************
   THeadersHashTable.SearchName function
   ************************************************************************
   DECLARATION:

        function SearchName(Name: String; var Col: Word) : Boolean;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Searches for a column number, given the header.

   PARAMETERS' DESCRIPTION:

        Name :    the header of the column whose is being searched.

        Col  :    this parameter will be set to the column number, if found.

   REMARKS:

        SearchName will return TRUE if the header was found; FALSE otherwise.


   ************************************************************************
   THeadersHashTable.Store procedure
   ************************************************************************
   DECLARATION:

        procedure Store(var S : TStream);

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Writes a headers hash table to disk.

   PARAMETERS' DESCRIPTION:

        S : stream to which the headers hash table will be written.

   ************************************************************************
   TLimScrollBar object
   ************************************************************************
   DECLARATION:

        TLimScrollBar = object(TScrollBar)
            OldValue     : Word;
            DisplayLimit : Word;

                                           91








          constructor Init(var Bounds: TRect; ADisplayLimit: Integer);
          function Change: Integer;
          procedure Draw; virtual;
          procedure HandleEvent(var Event: TEvent); virtual;
          constructor Load(var S: TStream);
          procedure Store(var S: TStream);
        end; {...TLimScrollBar }

   UNIT:

        GLVIEWS.PAS

   DESCRIPTION:

        A TScrollBar's descendant that allows the definition of a display
        subrange.

   REMARKS:

        This object is particularly useful if the TScroller object that owns the
        scrollbar has a very broad scrolling range (for example, 32767 columns,
        like the spreadsheet).  In this case, a normal TScrollBar object would
        be of no use at all,  since one click in an arrow would move the
        scroller more than 1000 columns. TLimScrollBar lets you define a smaller
        scrolling range, making it more useful than a TScrollBar in this
        situations.


   ************************************************************************
   TLimScrollBar.Change function
   ************************************************************************
   DECLARATION:

        function Change: Integer;

   UNIT:

        GLVIEWS.PAS

   DESCRIPTION:

        Returns the amount the scrollbar value changed when last moved (the
        difference between its current value and its old value).

   REMARKS:

        (see TLimScrollBar.OldValue)


   ************************************************************************
   TLimScrollBar.DisplayLimit field
   ************************************************************************
   DECLARATION:

        DisplayLimit : Word;




                                         92








   UNIT:

        GLVIEWS.PAS

   DESCRIPTION:

        This is the relative maximum value that is used to display the
        scrollbar.

   REMARKS:

        No matter what the position of the scrollbar is, this will always be the
        maximum value when displaying the scrollbar.  For example, if
        DisplayLimit is 100 and the value of the scrollbar is 32767, the
        scrollbar would still be displayed as if the scrollbar's maximum value
        were 100.

        Since the relative maximum value is DisplayLimit, the scrollbar
        indicator will not move unless the scrollbar has a value equal to or
        smaller than DisplayLimit.  Movement outside this range will not be
        displayed by the scrollbar.


   ************************************************************************
   TLimScrollBar.Draw procedure
   ************************************************************************
   DECLARATION:

        procedure Draw; virtual;

   UNIT:

        GLVIEWS.PAS

   DESCRIPTION:

        Draws the TLimScrollBar object.

   REMARKS:

        Before drawing the scrollbar object, TScrollBar's Max field is
        temporarily set to DisplayLimit;  TScrollBar's Draw method is then
        called.  After the call to TScrollBar.Draw, TScrollBar.Max is set to its
        original value.


   ************************************************************************
   TLimScrollBar.HandleEvent procedure
   ************************************************************************
   DECLARATION:

        procedure HandleEvent(var Event: TEvent); virtual;

   UNIT:

        GLVIEWS.PAS



                                         93








   DESCRIPTION:

        Implements the object's event handling.

   PARAMETERS' DESCRIPTION:

        Event     :    the event that will be evaluated and, if possible,
                       handled by this method

   REMARKS:

        It handles mouse clicks inside the scrollbar, in the case that the
        scrollbar's value is outside the display limit.


   ************************************************************************
   TLimScrollBar.Init CONSTRUCTOR
   ************************************************************************
   DECLARATION:

        constructor Init(var Bounds: TRect; ADisplayLimit: Integer);

   UNIT:

        GLVIEWS.PAS

   DESCRIPTION:

        Creates and initializes the TLimScrollBar object.

   PARAMETERS' DESCRIPTION:

        Bounds    :    the area where the scrollbar will be displayed

        ADisplayLimit  :    the scrollbar's relative maximum value

   REMARKS:

        (see TLimScrollBar, TLimScrollBar.DisplayLimit)


   ************************************************************************
   TLimScrollBar.Load CONSTRUCTOR
   ************************************************************************
   DECLARATION:

        constructor Load(var S: TStream);

   UNIT:

        GLVIEWS.PAS

   DESCRIPTION:

        Loads the scrollbar from disk.




                                         94








   PARAMETERS' DESCRIPTION:

        S    :    the stream from which the scrollbar will be loaded.

   ************************************************************************
   TLimScrollBar.OldValue field
   ************************************************************************
   DECLARATION:

        OldValue : Word;

   UNIT:

        GLVIEWS.PAS

   DESCRIPTION:

        Stores the last position of the scrollbar.

   REMARKS:

        (see TLimScrollBar.Change)


   ************************************************************************
   TLimScrollBar.Store procedure
   ************************************************************************
   DECLARATION:

        procedure Store(var S: TStream);

   UNIT:

        GLVIEWS.PAS

   DESCRIPTION:

        Writes the scrollbar to disk.

   PARAMETERS' DESCRIPTION:

        S    :    the stream to which the scrollbar will be written.

   ************************************************************************
   TMessageLine object
   ************************************************************************
   DECLARATION:

        TMessageLine = object(TView)
            StatusMessage : String[79];
          constructor Init (Bounds:TRect; AMessage:String);
          procedure Draw; virtual;
        end; {...TMessageLine }

   UNIT:

        GLVIEWS.PAS


                                         95








   DESCRIPTION:

        Displays a string.

   REMARKS:

        This object is used to display messages in the status line.


   ************************************************************************
   TMessageLine.Draw procedure
   ************************************************************************
   DECLARATION:

        procedure Draw; virtual;

   UNIT:

        GLVIEWS.PAS

   DESCRIPTION:

        Displays the message in the screen.

   REMARKS:

        (see TMessageLine.StatusMessage)


   ************************************************************************
   TMessageLine.Init CONSTRUCTOR
   ************************************************************************
   DECLARATION:

        constructor Init (Bounds:TRect; AMessage:String);

   UNIT:

        GLVIEWS.PAS

   DESCRIPTION:

        Creates and initializes the TMessageLine object and displays it in the
        screen.

   PARAMETERS' DESCRIPTION:

        Bounds    :    the area where the TMessageLine object will be displayed

        AMessage  :    the message that will be displayed

   ************************************************************************
   TMessageLine.StatusMessage field
   ************************************************************************
   DECLARATION:

        StatusMessage : String[79];


                                         96








   UNIT:

        GLVIEWS.PAS

   DESCRIPTION:

        The message that will be displayed inside the object's bounds.

   ************************************************************************
   ToggleClipBoardOff procedure
   ************************************************************************
   DECLARATION:

        procedure ToggleClipBoardOff;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Resets the clipboard.

   REMARKS:

        (see Clipboard, ToggleClipBoardOn)


   ************************************************************************
   ToggleClipBoardOn procedure
   ************************************************************************
   DECLARATION:

        procedure ToggleClipBoardOn(SpreadSheet: PSpreadSheet; Block:
          PBlock; ABlockOn: Boolean; Op: BlockOperation);

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Sets the Clipboard fields with the information necessary for a copy or
        move operation.

   PARAMETERS' DESCRIPTION:

        SpreadSheet    :    the spreadsheet where the cells to be copied or
                            moved are stored

        Block     :    the block of cells to be copied or moved

        ABlockOn  :    indicates if a block of cells or only a single cell is
                       being copied or moved

        Op   :    the operation (copy or move) requested



                                         97








   REMARKS:

        (see Clipboard, ToggleClipBoardOff)


   ************************************************************************
   TOverwriteHashTable object
   ************************************************************************
   DECLARATION:

        TOverwriteHashTable = OBJECT(THashTable)
              CurrCell : PCell;
              CurrPos : CellPos;
              EndCol : Word;
          constructor Init(InitBuckets : BucketRange);
          destructor Done;
          function Add(SCell : PCell; var CHash: TCellHashTable;
            var FHash: TFormatHashTable; var WHash: TWidthHashTable;
            LastPos: CellPos; MaxCols: Word; GetColWidth: GetColWidthFunc;
            FormulasDisplayed, ChangeYes: Boolean) : Boolean;
          procedure Delete(SPos : CellPos; var CHash: TCellHashTable;
            var FHash: TFormatHashTable; var WHash: TWidthHashTable;
            LastPos: CellPos; MaxCols: Word;
            GetColWidth: GetColWidthFunc; FormulasDisplayed,
            ChangeYes: Boolean);
          function Change(SCell : PCell; Overwritten : Word) : Boolean;
          function Search(SPos : CellPos) : PCell;
          function HashValue : LongInt; virtual;
          function Found(Item : HashItemPtr) : Boolean; virtual;
          procedure CreateItem(var Item : HashItemPtr); virtual;
          function ItemSize : HashItemSizeRange; virtual;
        end; {...TOverwriteHashTable }

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Keeps track of which empty cells are overwritten (in the screen) by
        other cells.

   REMARKS:

        A cell overwrites an empty cell when the cell's contents do not fit in
        the cell.


   ************************************************************************
   TOverwriteHashTable.Add function
   ************************************************************************
   DECLARATION:

        function Add(SCell : PCell; var CHash: TCellHashTable;
          var FHash: TFormatHashTable; var WHash: TWidthHashTable;
          LastPos: CellPos; MaxCols: Word; GetColWidth: GetColWidthFunc;
          FormulasDisplayed, ChangeYes: Boolean) : Boolean;


                                         98








   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Adds a cell and the number of empty cells it overwrites to the overwrite
        hash table.

   PARAMETERS' DESCRIPTION:

        SCell       :  The cell being added to the overwrite hash table.

        CHash       :  A cell hash table.  Used to determine the number of empty
                       cells the given cell; this number depends on whether or
                       not there is a non-empty cell near the given cell.

        FHash       :  A format hash table.  Used to determine the format of the
                       cell; the size of the contents of a cell depends on its
                       format.

        WHash       :  A width hash table.  Used to determine column widths; the
                       number of cells a given cell overwrites, also depends on
                       the width of the column it finds in its way.

        LastPos     :  the lower right corner of the block of used cells in the
                       spreadsheet.

        MaxCols     :  the maximum number of columns available in the
                       spreadsheet.

        GetColWidth :  a function used to determine the width of a column (see
                       GetColWidth).

        FormulasDisplayed : indicates if the spreadsheet is in Display Formulas
                            mode, which also affects the number of empty-cells a
                            formula cell may overwrite.

        ChangeYes         : when a cell is added to the overwrite hash table,
                            overwrite information for cells at the left may
                            change; this parameter indicates if overwrite
                            information for those cells should be modified if
                            necessary.

   REMARKS:

        If the given cell does not overwrite any empty cells, it will not be
        added to the overwrite hash table.


   ************************************************************************
   TOverwriteHashTable.Change function
   ************************************************************************
   DECLARATION:

        function Change(SCell : PCell; Overwritten : Word) : Boolean;



                                         99








   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Changes the overwrite information of the given cell.

   PARAMETERS' DESCRIPTION:

        SCell       :  The cell whose overwrite information is being changed.

        Overwritten :  the new number of empty cells overwritten by the given
                       cell.

   REMARKS:

        It returns TRUE if the information has been sucessfully changed.


   ************************************************************************
   TOverwriteHashTable.CreateItem procedure
   ************************************************************************
   DECLARATION:

        (see TCellHashTable.CreateItem)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TOverwriteHashTable.CurrCell field
   ************************************************************************
   DECLARATION:

        CurrCell : PCell;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Stores the cell pointer that is being added, searched for or deleted
        from the overwrite hash table.

   REMARKS:

        You will never need to access this field directly.


   ************************************************************************
   TOverwriteHashTable.CurrPos field
   ************************************************************************
   DECLARATION:

        CurrPos : CellPos;

                                           100








   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Stores the location of the cell that is being added, searched for or
        deleted from the overwrite hash table.

   REMARKS:

        You will never need to access this field directly.


   ************************************************************************
   TOverwriteHashTable.Delete procedure
   ************************************************************************
   DECLARATION:

        procedure Delete(SPos : CellPos; var CHash: TCellHashTable;
          var FHash: TFormatHashTable; var WHash: TWidthHashTable;
          LastPos: CellPos; MaxCols: Word; GetColWidth: GetColWidthFunc;
          FormulasDisplayed, ChangeYes: Boolean);

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Deletes a cell and its overwrite information from the overwrite hash
        table.

   PARAMETERS' DESCRIPTION:

        SPos        :  The position of the cell being deleted from the overwrite
                       hash table.

        CHash       :  A cell hash table.  Used to determine the number of empty
                       cells the given cell; this number depends on whether or
                       not there is a non-empty cell near the given cell.  Used
                       when ChangeYes (see below) is TRUE.

        FHash       :  A format hash table.  Used to determine the format of the
                       cell; the size of the contents of a cell depends on its
                       format.  Used when ChangeYes (see below) is TRUE.

        WHash       :  A width hash table.  Used to determine column widths; the
                       number of cells a given cell overwrites, also depends on
                       the width of the column it finds in its way.  Used when
                       ChangeYes (see below) is TRUE.

        LastPos     :  the lower right corner of the block of used cells in the
                       spreadsheet.

        MaxCols     :  the maximum number of columns available in the
                       spreadsheet.


                                           101








        GetColWidth :  a function used to determine the width of a column (see
                       GetColWidth).

        FormulasDisplayed : indicates if the spreadsheet is in Display Formulas
                            mode, which also affects the number of empty-cells a
                            formula cell may overwrite.

        ChangeYes         : when a cell is deleted from the overwrite hash
                            table, overwrite information of cells at the left
                            may change; this parameter indicates the overwrite
                            information for those cells should be modified if
                            necessary.

   REMARKS:

        Nothing happens if the cell does not exist in the overwrite hash table.

        (see TOverwriteHashTable.Add)


   ************************************************************************
   TOverwriteHashTable.Done DESTRUCTOR
   ************************************************************************
   DECLARATION:

        destructor Done;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Performs the necessary cleanup and disposal of the overwrite hash table.

   ************************************************************************
   TOverwriteHashTable.EndCol field
   ************************************************************************
   DECLARATION:

        EndCol : Word;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        The number of the last column overwritten by the cell being added,
        searched for or deleted from the overwrite hash table.

   REMARKS:

        You will never need to access this field directly.





                                        102








   ************************************************************************
   TOverwriteHashTable.Found function
   ************************************************************************
   DECLARATION:

        (see TCellHashTable.Found)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TOverwriteHashTable.HashValue function
   ************************************************************************
   DECLARATION:

        (see TCellHashTable.HashValue)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TOverwriteHashTable.Init CONSTRUCTOR
   ************************************************************************
   DECLARATION:

        constructor Init(InitBuckets : BucketRange);

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Creates and initializes the TOverwriteHashTable object.

   PARAMETERS' DESCRIPTION:

        InitBuckets :  the number of buckets (linked lists) the overwrite hash
                       table will have.

   ************************************************************************
   TOverwriteHashTable.ItemSize function
   ************************************************************************
   DECLARATION:

        (see TCellHashTable.ItemSize)

   UNIT:

        GLCELL.PAS







                                        103








   ************************************************************************
   TOverwriteHashTable.Search function
   ************************************************************************
   DECLARATION:

        function Search(SPos : CellPos) : PCell;

   UNIT:

        Returns a pointer to the cell that overwrites the empty cell at the
        given position.

   DESCRIPTION:

        GLCELL.PAS

   PARAMETERS' DESCRIPTION:

        SPos      :    Search checks if the empty cell at this position is
                       overwritten by another cell.

   REMARKS:

        If the empty cell is not overwritten by another cell, Search returns a
        pointer to an empty cell.


   ************************************************************************
   TRepeatCell object
   ************************************************************************
   DECLARATION:

        TRepeatCell = OBJECT(TCell)
            RepeatChar : Char;
          constructor Init(InitLoc : CellPos; InitChar : Char);
          function CellType : CellTypes; virtual;
          function LegalValue : Boolean; virtual;
          function Name : String; virtual;
          function Format(var FHash : TFormatHashTable;
            FormulasDisplayed : Boolean) : FormatType; virtual;
          function Width(var FHash : TFormatHashTable;
            FormulasDisplayed : Boolean) : Word; virtual;
          function Overwritten(var CHash : TCellHashTable;
            var FHash : TFormatHashTable; var WHash : TWidthHashTable;
            var LastPos : CellPos; MaxCols : Word;
            GetColWidth : GetColWidthFunc; FormulasDisplayed : Boolean) :
            Word; virtual;
          function ShouldUpdate : Boolean; virtual;
          function HasError : Boolean; virtual;
          function CurrValue : Extended; virtual;
          function OverwriteStart(var FHash : TFormatHashTable;
            var WHash : TWidthHashTable; GetColWidth : GetColWidthFunc;
            EndCol : Word; DisplayFormulas : Boolean) : Word; virtual;
          procedure EditString(MaxDecPlaces : Byte; var Input : String);
            virtual;
          function DisplayString(FormulasDisplayed : Boolean;
            MaxDecPlaces : Byte) : String; virtual;
          function FormattedString(var OHash : TOverwriteHashTable;

                                           104








            var FHash : TFormatHashTable; var WHash : TWidthHashTable;
            GetColWidth : GetColWidthFunc; CPos : CellPos;
            FormulasDisplayed : Boolean; Start : Word; ColWidth : Byte;
            var CurrencyString : CurrencyStr; var ClType: CellTypes):
            String; virtual;
          function CopyString : String; virtual;
          constructor Load(var S : TStream);
          procedure Store(var S : TStream);
        end; {...TRepeatCell }

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Stores a character that will be repeated in all the cell when displayed.

   REMARKS:

        A repeat cell will overwrite all empty cells to its left, until it
        reaches the end of the spreadsheet or finds a non-empty cell in its way.


   ************************************************************************
   TRepeatCell.CellType function
   ************************************************************************
   DECLARATION:

        (see TCell.CellType)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TRepeatCell.CopyString function
   ************************************************************************
   DECLARATION:

        (see TCell.CopyString)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TRepeatCell.CurrValue function
   ************************************************************************
   DECLARATION:

        (see TCell.CurrValue)

   UNIT:

        GLCELL.PAS



                                        105








   ************************************************************************
   TRepeatCell.DisplayString function
   ************************************************************************
   DECLARATION:

        (see TCell.DisplayString)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TRepeatCell.EditString procedure
   ************************************************************************
   DECLARATION:

        (see TCell.EditString)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TRepeatCell.Format function
   ************************************************************************
   DECLARATION:

        (see TCell.Format)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TRepeatCell.FormattedString function
   ************************************************************************
   DECLARATION:

        (see TCell.FormattedString)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TRepeatCell.HasError function
   ************************************************************************
   DECLARATION:

        (see TCell.HasError)

   UNIT:

        GLCELL.PAS





                                        106








   ************************************************************************
   TRepeatCell.Init CONSTRUCTOR
   ************************************************************************
   DECLARATION:

        constructor Init(InitLoc : CellPos; InitChar : Char);

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Creates and initializes the TRepeatCell object.

   PARAMETERS' DESCRIPTION:

        InitLoc   :    the position of the cell in the spreadsheet.

        InitChar  :    the character that will be repeated.

   ************************************************************************
   TRepeatCell.LegalValue function
   ************************************************************************
   DECLARATION:

        (see TCell.LegalValue)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TRepeatCell.Load CONSTRUCTOR
   ************************************************************************
   DECLARATION:

        constructor Load(var S: TStream);

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Loads the cell's contents from disk.

   PARAMETERS' DESCRIPTION:

        S : the stream from which will be read the cell's contents.

   ************************************************************************
   TRepeatCell.Name function
   ************************************************************************
   DECLARATION:

        (see TCell.Name)


                                        107








   UNIT:

        GLCELL.PAS

   ************************************************************************
   TRepeatCell.OverwriteStart function
   ************************************************************************
   DECLARATION:

        (see TCell.OverwriteStart)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TRepeatCell.Overwritten function
   ************************************************************************
   DECLARATION:

        (see TCell.Overwritten)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TRepeatCell.RepeatChar field
   ************************************************************************
   DECLARATION:

        RepeatChar : Char;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Used to store the character that will be repeated in the cell when
        displayed.

   ************************************************************************
   TRepeatCell.ShouldUpdate function
   ************************************************************************
   DECLARATION:

        (see TCell.ShouldUpdate)

   UNIT:

        GLCELL.PAS







                                        108








   ************************************************************************
   TRepeatCell.Store procedure
   ************************************************************************
   DECLARATION:

        procedure Store(var S: TStream);

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Writes the cell's contents to disk.

   PARAMETERS' DESCRIPTION:

        S : the stream to which the cell's contents will be written.

   ************************************************************************
   TRepeatCell.Width function
   ************************************************************************
   DECLARATION:

        (see TCell.Width)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TScreenArea object
   ************************************************************************
   DECLARATION:

        TScreenArea = object(TObject)
            UpperLeft,
            LowerRight : ScreenPos;
            Attrib     : Byte;
          constructor Init(InitX1 : ScreenColRange; InitY1 :
            ScreenRowRange;  InitX2 : ScreenColRange; InitY2 :
            ScreenRowRange; InitAttrib : Word);
          function PointInArea(X, Y: Byte): Boolean;
        end; {...TScreenArea }

   UNIT:

        GLSUPPRT.PAS

   DESCRIPTION:

        Stores the position of an area in the screen and the value of the 
        attribute that should be used to display the the text in the area.






                                        109








   ************************************************************************
   TScreenArea.Attrib field
   ************************************************************************
   DECLARATION:

        Attrib : Byte;

   UNIT:

        GLSUPPRT.PAS

   DESCRIPTION:

        The attribute that should be used to display any text inside the defined
        area.

   ************************************************************************
   TScreenArea.Init CONSTRUCTOR
   ************************************************************************
   DECLARATION:

        constructor Init(InitX1 : ScreenColRange; InitY1 :
          ScreenRowRange;  InitX2 : ScreenColRange; InitY2 :
          ScreenRowRange; InitAttrib : Word);

   UNIT:

        GLSUPPRT.PAS

   DESCRIPTION:

        Creates and initializes the TScreenAreao object.

   PARAMETERS' DESCRIPTION:

        InitX1    :    the column of the upper left corner of the area

        InitY1    :    the row of the upper left corner of the area

        InitX2    :    the column of the lower right corner of the area

        InitY2    :    the row of the lower right corner of the area

        InitAttrib     :    the attribute that should be used to display any
                            text inside the area

   ************************************************************************
   TScreenArea.LowerRight field
   ************************************************************************
   DECLARATION:

        LowerRight : ScreenPos;

   UNIT:

        GLSUPPRT.PAS



                                        110








   DESCRIPTION:

        The location of the area's lower right corner.

   ************************************************************************
   TScreenArea.PointInArea function
   ************************************************************************
   DECLARATION:

        function PointInArea(X, Y: Byte): Boolean;

   UNIT:

        GLSUPPRT.PAS

   DESCRIPTION:

        Determines if the given point is in the area defined by the object.

   PARAMETERS' DESCRIPTION:

        X    :    column where the point is located

        Y    :    row where the point is located

   ************************************************************************
   TScreenArea.UpperLeft field
   ************************************************************************
   DECLARATION:

        UpperLeft : ScreenPos;

   UNIT:

        GLSUPPRT.PAS

   DESCRIPTION:

        The location of the area's upper left corner.

   ************************************************************************
   TSheetInputLine object
   ************************************************************************
   DECLARATION:

        TSheetInputLine = OBJECT(TInputLine)
            EndState : Word;
          constructor Init(AMaxLen: Integer);
          procedure EndModal(Command: Word); virtual;
          function Execute: Word; virtual;
          function GetPalette: PPalette; virtual;
          procedure HandleEvent(var Event: TEvent); virtual;
          procedure SetState(AState: Word; Enable: Boolean); virtual;
        end; {...TSheetInputLine }

   UNIT:

        GLVIEWS.PAS

                                        111








   DESCRIPTION:

        An input line that can be inserted in a TSpreadSheetWindow object in
        modal state.  It maps to the color palette of the TSpreadSheetWindow
        object and handles kbEnter, kbEsc, kbUp and kbDown by ending the modal
        state of the view.

   ************************************************************************
   TSheetInputLine.EndModal procedure
   ************************************************************************
   DECLARATION:

        procedure EndModal(Command: Word); virtual;

   UNIT:

        GLVIEWS.PAS

   DESCRIPTION:

        Ends the modal state of the view, by assigning a value to the EndState
        field.

   PARAMETERS' DESCRIPTION:

        Command   :    the command value that will be assigned to the EndState
                       field.

   REMARKS:

        (see TSheetInputLine.EndState)


   ************************************************************************
   TSheetInputLine.EndState field
   ************************************************************************
   DECLARATION:

        EndState : Word;

   UNIT:

        GLVIEWS.PAS

   DESCRIPTION:

        Stores the value of the command that will be returned by the ExecView
        function.

   REMARKS:

        As soon as this field is assigned a non-cero value, the view's modal
        state will end.

        You will never need to access this field directly.

        (see TSheetInputLine.EndModal)


                                        112








   ************************************************************************
   TSheetInputLine.Execute function
   ************************************************************************
   DECLARATION:

        function Execute: Word; virtual;

   UNIT:

        GLVIEWS.PAS

   DESCRIPTION:

        "Execute is called from TGroup.ExecView whenever a view becomes modal.
        If a view is to allow modal execution, it must override Execute to
        provide an event loop.

        The result of Execute becomes the value returned from ExecView."**

        **Taken from Borland Pascal's on-Line documentation.

   REMARKS:

        The view's modal state ends when a value is assigned to the EndState
        field.

        (see TSheetInputLine.EndState, TSheetInputLine.EndModal)


   ************************************************************************
   TSheetInputLine.GetPalette function
   ************************************************************************
   DECLARATION:

        function GetPalette: PPalette; virtual;

   UNIT:

        GLVIEWS.PAS

   DESCRIPTION:

        Returns a pointer to the object's new palette.

   ************************************************************************
   TSheetInputLine.HandleEvent procedure
   ************************************************************************
   DECLARATION:

        procedure HandleEvent(var Event: TEvent); virtual;

   UNIT:

        GLVIEWS.PAS

   DESCRIPTION:

        Implements the object's event handling.

                                           113








   PARAMETERS' DESCRIPTION:

        Event     :    the event that will be evaluated and, if possible,
                       handled by this method

   REMARKS:

        This method handles the kbEnter, kbUp, kbDown envents by ending the
        modal state of the view with the cmOk command; kbEsc by ending the modal
        state of the view with the cmCancel command.


   ************************************************************************
   TSheetInputLine.Init CONSTRUCTOR
   ************************************************************************
   DECLARATION:

        constructor Init(AMaxLen: Integer);

   UNIT:

        GLVIEWS.PAS

   DESCRIPTION:

        Creates and initializes the TSheetInputLine object.

   PARAMETERS' DESCRIPTION:

        AMaxLen   :    the maximum length of the string that can be entered in
                       the input line.

   ************************************************************************
   TSheetInputLine.SetState procedure
   ************************************************************************
   DECLARATION:

        procedure SetState(AState: Word; Enable: Boolean); virtual;

   UNIT:

        GLVIEWS.PAS

   DESCRIPTION:

        Redraws the view whenever the state of the view changes.

   PARAMETERS' DESCRIPTION:

        AState    :    the state flag that will be changed

        Enable    :    enable (TRUE) or disable (FALSE) the given state flag.







                                        114








   ************************************************************************
   TSortObject object
   ************************************************************************
   DECLARATION:

        TSortObject = object(TObject)
            KeySortOrder : array[1..3] of SortTypes;
            KeyCols : array[1..3] of Word;
            LastKey : Byte;
            SourceHash: PCellHashTable;
            CurrentKey, PivotFirstKey, PivotSecondKey,
            PivotThirdKey: KeyValue;
            SortBlock : TBlock;
          constructor Init(SourceCellHash: PCellHashTable);
          function CurrentKeyPosition(var ComparedRec, PivotRec:
            KeyValue; SortOrder: SortTypes): KeyPosition;
          function CurrentRowPosition(CurrRow: Word): KeyPosition;
          procedure FillKeyRec(SearchCell: CellPos; var KeyRecord:
            KeyValue);
          procedure QuickSort(FirstRow, LastRow: Word);
          function SetKeyArray(FirstKey, SecondKey, ThirdKey: Word;
            FirstOrder, SecondOrder, ThirdOrder: SortTypes) : Boolean;
          procedure SetPivot(Row: Word);
          procedure Sort(ASortBlock: TBlock;
            FirstKey: Word; AFirstKeySortOrder: SortTypes; SecondKey:
            Word; ASecondKeySortOrder: SortTypes; ThirdKey: Word;
            AThirdKeySortOrder: SortTypes);
          procedure SplitSortBlock(FirstRow, LastRow : Word; var
            LowFirstRow, LowLastRow, HighFirstRow, HighLastRow : Word);
          procedure SwapRows(Row1, Row2: Word);
        end; {...TSortObject }

   UNIT:

        GLSORT.PAS

   DESCRIPTION:

        Used to sort a list or block of cells in a cell hash table.  The list is
        sorted in ascending or descending order, given up to three sort keys,
        using the QuickSort algorithm.

   REMARKS:

        A sort key is the number of a column that contains the values that will
        be used to sort the rows in a list.

        An instance of this object is created in the initialization section. 
        See StandardSortObject.


   ************************************************************************
   TSortObject.CurrentKeyPosition function
   ************************************************************************
   DECLARATION:

        function CurrentKeyPosition(var ComparedRec, PivotRec: KeyValue;
          SortOrder: SortTypes): KeyPosition;

                                           115








   UNIT:

        GLSORT.PAS

   DESCRIPTION:

        Compares a key with the pivot and returns its position relative to the
        position of the pivot.

   PARAMETERS' DESCRIPTION:

        ComparedRec    :    record containing the key value of the row to be
                            compared; this value can be the value of the a row's
                            first, second or third key, depending on the key
                            being used for comparision.

        PivotRec       :    record containing the key value of the pivot row;
                            this value can be the value of the pivot row's
                            first, second or third key, depending on the key
                            being used for comparision.

        SortOrder      :    the order in which the list is being ordered; it can
                            be the sort order of the first, second or third key,
                            depending on the key being used for comparision.

   REMARKS:

        When the comparision is made, the sort order is taken into account to
        decide the position of a key relative to the pivot.

        (see TSortObject.CurrentRowPosition)


   ************************************************************************
   TSortObject.CurrentRowPosition function
   ************************************************************************
   DECLARATION:

        function CurrentRowPosition(CurrRow: Word): KeyPosition;

   UNIT:

        GLSORT.PAS

   DESCRIPTION:

        Compares the given row with the pivot row, and returns its position
        relative to the position of the pivot.

   PARAMETERS' DESCRIPTION:

        CurrRow   :    the row being compared with the pivot.

   REMARKS:

        The rows are compared by comparing each of the key values in the row,
        with the key values in the pivot row.  This is done with calls to
        CurrentKeyPosition using first key values, second key values -- if

                                           116








        necessary -- and third key values -- if necessary --.


   ************************************************************************
   TSortObject.CurrKey field
   ************************************************************************
   DECLARATION:

        CurrKey : KeyValue;

   UNIT:

        GLSORT.PAS

   DESCRIPTION:

        Stores the value of the key being compared with the pivot key.

   REMARKS:

        This value can be either a first key, second key or third key value.

        (see TSortObject.PivotFirstKey, TSortObject.PivotSecondKey,
        TSortObject.PivotThirdKey)


   ************************************************************************
   TSortObject.FillKeyRec procedure
   ************************************************************************
   DECLARATION:

        procedure FillKeyRec(SearchCell: CellPos; var KeyRecord:
          RKeyValue);

   UNIT:

        GLSORT.PAS

   DESCRIPTION:

        Fills a KeyValue record with the necessary information about a cell.

   PARAMETERS' DESCRIPTION:

        SearchCell     :    the cell being compared;  the information about this
                            cell will be put in the KeyRecord parameter.

        KeyRecord      :    will contain the cell's information.

   ************************************************************************
   TSortObject.Init CONSTRUCTOR
   ************************************************************************
   DECLARATION:

        constructor Init(SourceCellHash: PCellHashTable);




                                        117








   UNIT:

        GLSORT.PAS

   DESCRIPTION:

        Creates and initializes the TSortObject object.

   PARAMETERS' DESCRIPTION:

        SourceCellHash :    the cell hash table that contains the block of cells
                            to be sorted.

   ************************************************************************
   TSortObject.KeyCols field
   ************************************************************************
   DECLARATION:

        KeyCols : array[1..3] of Word;

   UNIT:

        GLSORT.PAS

   DESCRIPTION:

        Stores the column number of each of the sort keys.

   ************************************************************************
   TSortObject.KeySortOrder field
   ************************************************************************
   DECLARATION:

        KeySortOrder : array[1..3] of SortTypes;

   UNIT:

        GLSORT.PAS

   DESCRIPTION:

        Stores the order (ascending or descending) that will be used to sort the
        list.

   REMARKS:

        Each of the sort keys can be sorted in ascending or descending order
        independently.

        (see SortTypes)


   ************************************************************************
   TSortObject.LastKey field
   ************************************************************************
   DECLARATION:

        LastKey : Byte;

                                           118








   UNIT:

        GLSORT.PAS

   DESCRIPTION:

        The last valid sort key (can be either 1, 2 or 3).

   REMARKS:

        Used to indicate to the sort algorithm the number of keys it should use
        to sort the list.


   ************************************************************************
   TSortObject.PivotFirstKey field
   ************************************************************************
   DECLARATION:

        PivotFirstKey : KeyValue;

   UNIT:

        GLSORT.PAS

   DESCRIPTION:

        Stores the value of the first key of the pivot row.  The first key of
        all the other rows will be compared with this value to determine their
        position relative to the position of the pivot row.

   ************************************************************************
   TSortObject.PivotSecondKey field
   ************************************************************************
   DECLARATION:

        PivotSecondKey : KeyValue;

   UNIT:

        GLSORT.PAS

   DESCRIPTION:

        Stores the value of the second key of the pivot row.  When the first key
        of a row is equal to the first key of the pivot row, the row's second
        key will be compared with this value to determine its position relative
        to the position of the pivot row.

   ************************************************************************
   TSortObject.PivotThirdKey field
   ************************************************************************
   DECLARATION:

        PivotThirdKey : KeyValue;




                                        119








   UNIT:

        GLSORT.PAS

   DESCRIPTION:

        Stores the value of the third key of the pivot row.  When the second key
        of a row is equal to the second key of the pivot row, the row's third
        key will be compared with this value to determine its position relative
        to the position pivot row.

   ************************************************************************
   TSortObject.QuickSort procedure
   ************************************************************************
   DECLARATION:

        procedure QuickSort(FirstRow, LastRow: Word);

   UNIT:

        GLSORT.PAS

   DESCRIPTION:

        Sorts the cells between the firstrow and lastrow of a block of cells,
        using the quicksort algorithm.

   PARAMETERS' DESCRIPTION:

        FirstRow  :    the upper row of the block of cells to be sorted.

        LastRow   :    the bottom row of the block of cells to be sorted.

   REMARKS:

        The block that will be sorted by this procedure, is a sub-block of the
        original block of cells.  It will keep the same number of columns, but
        its number of rows will vary.

        (see TSortObject.Sort, TSortObject.SplitSortBlock)


   ************************************************************************
   TSortObject.SetKeyArray function
   ************************************************************************
   DECLARATION:

        function SetKeyArray(FirstKey, SecondKey, ThirdKey: Word;
          FirstOrder, SecondOrder, ThirdOrder: SortTypes) : Boolean;

   UNIT:

        GLSORT.PAS

   DESCRIPTION:

        Puts each key column's number and sort order in the KeyCols and
        KeySortOrder arrays respectively, and determines the number of valid

                                           120








        sort keys (see TSortObject.LastKey)

   PARAMETERS' DESCRIPTION:

        FirstKey  :    the first key's column number.

        SecondKey :    the second key's column number.

        ThirdKey  :    the third key's column number.

        FirstOrder     :    the first key's sort order.

        SecondOrder    :    the second key's sort order.

        ThirdOrder     :    the third key's sort order.

   ************************************************************************
   TSortObject.SetPivot procedure
   ************************************************************************
   DECLARATION:

        procedure SetPivot(Row: Word);

   UNIT:

        GLSORT.PAS

   DESCRIPTION:

        Fills each of the pivot keyvalue records.

   PARAMETERS' DESCRIPTION:

        Row  :    the number of the row that will be used as a pivot.

   ************************************************************************
   TSortObject.Sort procedure
   ************************************************************************
   DECLARATION:

        procedure Sort(ASortBlock: TBlock; FirstKey: Word;
          AFirstKeySortOrder: SortTypes; SecondKey: Word;
          ASecondKeySortOrder: SortTypes; ThirdKey: Word;
          AThirdKeySortOrder: SortTypes);

   UNIT:

        GLSORT.PAS

   DESCRIPTION:

        Sorts a list or block of cells in a cell hash table, using the QuickSort
        algorithm.

   PARAMETERS' DESCRIPTION:

        ASortBlock     :    the block of cells that will be sorted.


                                           121








        FirstKey  :    the first key's column number.

        AFirstKeySortOrder  :    the first key's sort order.

        SecondKey :    the Second key's column number.

        ASecondKeySortOrder :    the Second key's sort order.

        ThirdKey  :    the Third key's column number.

        AThirdKeySortOrder  :    the Third key's sort order.

   ************************************************************************
   TSortObject.SortBlock field
   ************************************************************************
   DECLARATION:

        SortBlock : TBlock;

   UNIT:

        GLSORT.PAS

   DESCRIPTION:

        The block of cells that will be sorted.

   ************************************************************************
   TSortObject.SourceCellHash field
   ************************************************************************
   DECLARATION:

        SourceHash: PCellHashTable;

   UNIT:

        GLSORT.PAS

   DESCRIPTION:

        The cell hash table that contains the list or block of cells to be
        sorted.

   ************************************************************************
   TSortObject.SplitSortBlock procedure
   ************************************************************************
   DECLARATION:

        procedure SplitSortBlock(FirstRow, LastRow : Word;
          var LowFirstRow, LowLastRow, HighFirstRow, HighLastRow : Word);

   UNIT:

        GLSORT.PAS

   DESCRIPTION:

        Splits the block into two sub-blocks: the first with rows that have key

                                           122








        values smaller than the pivot's value and the second, with rows that
        have key values bigger than the pivot's value;  the block is not really
        divided;  this fuction just returns the values of the first and last
        rows of each virtual sub-block.

   PARAMETERS' DESCRIPTION:

        FirstRow  :    the first row of the block of cells that will be divided.

        LastRow   :    the last row of the block of cells that will be divided.

        LowFirstRow    :    the first row of the first sub-block.

        LowLastRow     :    the last row of the first sub-block.

        HighFirstRow   :    the first row of the second sub-block.

        HighLastRow    :    the last row of the second sub-block.

   REMARKS:

        (see TSortObject.QuickSort)


   ************************************************************************
   TSortObject.SwapRows procedure
   ************************************************************************
   DECLARATION:

        procedure SwapRows(Row1, Row2 : Word);

   UNIT:

        GLSORT.PAS

   DESCRIPTION:

        Swaps the position of two rows in the spreadsheet.

   PARAMETERS' DESCRIPTION:

        Row1 :    the number of one of the rows to be swapped.

        Row2 :    the number of the other row to be swapped.

   ************************************************************************
   TSpreadSheet object
   ************************************************************************
   DECLARATION:

        TSpreadSheet = object(TScroller)
            Number               : Byte;
            Modified             : Boolean;
            MaxDecimalPlaces     : Byte;
            DefaultColWidth      : Byte;
            DefaultDecimalPlaces : Byte;
            DefaultCurrency      : CurrencyStr;
            MaxRows              : Integer;

                                           123








            MaxCols              : Integer;
            MaxColWidth          : Byte;
            MaxScreenCols        : Byte;
            TotalRows            : ScreenRowRange;
            RowNumberSpace       : Byte;
            OldCurrPos           : CellPos;
            CurrPos              : CellPos;
            LastPos              : CellPos;
            ScreenBlock          : PBlock;
            CurrBlock            : PBlock;
            BlockOn              : Boolean;
            ColArea              : TScreenArea;
            RowArea              : TScreenArea;
            InfoArea             : TScreenArea;
            DataArea             : TScreenArea;
            DisplayArea          : TScreenArea;
            ContentsArea         : TScreenArea;
            BlankArea            : TScreenArea;
            NoBlankArea          : Boolean;
            ColStart             : PColStart;
            CellHash             : TCellHashTable;
            WidthHash            : TWidthHashTable;
            OverwriteHash        : TOverwriteHashTable;
            FormatHash           : TFormatHashTable;
            DisplayFormulas      : Boolean;
            AutoCalc             : Boolean;
            GoToEnd              : Boolean;
            KeyPressed           : Boolean;
            EmptyRowsAtTop       : Byte;
            EmptyRowsAtBottom    : Byte;
            SheetProtected       : Boolean;
            DisplayHeaders         : Boolean;
            UnlockedHash         : TUnlockedHashTable;
            ColHeadersHash       : THeadersHashTable;
          constructor Init(var Bounds: TRect; InitCells: LongInt;
            AEmptyRowsAtTop, AEmptyRowsAtBottom: Byte; AHScrollBar,
            AVScrollBar: PLimScrollBar; AInitMaxCols, AInitMaxRows:
            Integer; InitDefaultColWidth, InitDefaultDecimalPlaces,
            InitMaxDecimalPlaces: Byte; InitDefaultCurrency:
            CurrencyStr);
          function  AddCell(CellType: CellTypes; Pos: CellPos; Error:
            Boolean; Value: Extended; Input: String): Boolean; virtual;
          function  CellHashStart(TotalCells: LongInt): BucketRange;
            virtual;
          function  CellsProtected(Block: TBlock): Boolean; virtual;
          function  CellToFString(P: CellPos; var AColor: Byte): String;
            virtual;
          procedure ChangeBounds(var Bounds: TRect); virtual;
          procedure ChangeColHeaders; virtual;
          procedure ChangeColWidth; virtual;
          procedure CheckForDragging; virtual;
          procedure ClearCurrBlock; virtual;
          procedure ClearScreenArea(AreaToClear: PScreenArea); virtual;
          function  ColHeadersHashStart : BucketRange; virtual;
          function  ColumnToString(Column: Word): String; virtual;
          function  ColToX(Col: Integer): Byte; virtual;
          function  ColWidth(Col: Integer): Byte; virtual;
          procedure CopyCellBlock; virtual;

                                           124








          procedure DeleteBlock(Block: TBlock; var Deleted: Boolean);
            virtual;
          procedure DeleteCell(Pos: CellPos; var Deleted: Boolean);
            virtual;
          procedure DeleteColFromHash(Block: TBlock; Columns, EndDelCol:
            Word; var Deleted: Boolean); virtual;
          procedure DeleteColHeaders(Block: PBlock); virtual;
          procedure DeleteColumns; virtual;
          procedure DeleteRowFromHash(Block: TBlock; Rows, EndDelRow:
            Word; var Deleted: Boolean); virtual;
          procedure DeleteRows; virtual;
          procedure DisplayAllCells; virtual;
          procedure DisplayBlankArea; virtual;
          procedure DisplayBlock(B: TBlock); virtual;
          procedure DisplayBlockDiff(B1, B2: TBlock); virtual;
          procedure DisplayCell(P: CellPos); virtual;
          procedure DisplayCellBlock(C1, R1, C2, R2: Word); virtual;
          procedure DisplayCellData; virtual;
          procedure DisplayCols; virtual;
          procedure DisplayInfo; virtual;
          procedure DisplayRows; virtual;
          procedure DoAfterEndInput; virtual;
          procedure DragCursorWithMouse(Event: TEvent); virtual;
          procedure Draw; virtual;
          procedure EraseCellBlock(EraseBlock: Boolean); virtual;
          procedure ExtendCurrBlock(Redraw : Boolean); virtual;
          procedure FindLastPos(DPos: CellPos); virtual;
          procedure FindScreenColStart; virtual;
          procedure FindScreenColStop; virtual;
          procedure FindScreenRowStart; virtual;
          procedure FindScreenRowStop; virtual;
          procedure FixBlockOverWrite(Block: TBlock); virtual;
          function  FixOverWrite: Boolean; virtual;
          procedure FormatDefault; virtual;
          function  FStringSituationColor(P: CellPos; var CP: PCell; var
            HasError, ColorFound: Boolean): Byte; virtual;
          procedure GetFormat; virtual;
          function  GetPalette: PPalette; virtual;
          procedure GoToCell; virtual;
          procedure HandleEvent(var Event: TEvent); virtual;
          procedure HandleInput(FirstChar: String; Editing: Boolean);
            virtual;
          procedure InitCurrPos; virtual;
          procedure InsertColToHash(Block: TBlock; Columns, StartInsCol:
            Word; var Deleted: Boolean); virtual;
          procedure InsertColumns; virtual;
          procedure InsertRowToHash(Block: TBlock; Rows, StartInsRow:
            Word; var Deleted: Boolean); virtual;
          procedure InsertRows; virtual;
          constructor Load(var S: TStream);
          procedure LoadDelimited(FileName: PathStr); virtual;
          procedure LoadHashTables(var S: TStream; AdjustAfter: CellPos;
            RowAdjustment, ColAdjustment: Integer); virtual;
          procedure LoadTablesFromTempFile(AdjustAfter: CellPos; 
            RowAdjustment, ColAdjustment: Integer); virtual;
          procedure LocateCursorWithMouse(Event: TEvent); virtual;
          procedure MoveCell(OldPos: CellPos); virtual;
          procedure MoveCellBlock; virtual;

                                           125








          procedure MoveDown; virtual;
          procedure MoveHome; virtual;
          procedure MoveLeft; virtual;
          procedure MovePgDown; virtual;
          procedure MovePgLeft; virtual;
          procedure MovePgRight; virtual;
          procedure MovePgUp; virtual;
          procedure MoveRight; virtual;
          procedure MoveUp; virtual;
          function  OverwriteHashStart: BucketRange; virtual;
          function  Parser: PParserObject; virtual;
          procedure PasteBlock(DestBlock: TBlock; Formulas: Word);
            virtual;
          procedure PasteCellBlock; virtual;
          procedure Print; virtual;
          procedure Recalc(Display: Boolean); virtual;
          function  RowToY(Row: Integer): Byte; virtual;
          function  SameCellPos(P1, P2 : CellPos) : Boolean; virtual;
          procedure ScrollDraw; virtual;
          function  SelectColumn(var Event: TEvent): Boolean; virtual;
          procedure SetAreas(ScrollArea: TRect); virtual;
          procedure SetBlankArea; virtual;
          procedure SetChanged(IsChanged: Boolean); virtual;
          procedure SetLimit(X, Y: Integer); virtual;
          procedure SetLocked; virtual;
          procedure SetNameWithMouse(var Event: TEvent); virtual;
          procedure SetNumber(ANumber: Byte); virtual;
          procedure SetProtection(Enable, Display: Boolean); virtual;
          procedure SetScreenColStart(NewCol: Integer); virtual;
          procedure SetScreenColStop(NewCol: Integer); virtual;
          procedure SetScreenRowStart(NewRow: Integer); virtual;
          procedure SetScreenRowStop(NewRow: Integer); virtual;
          procedure SetState(AState: Word; Enable: Boolean); virtual;
          procedure SetUnlocked; virtual;
          procedure SortData; virtual;
          function  SortObject : PSortObject; virtual;
          procedure Store(var S: TStream);
          procedure StoreHashTables(var S: TStream); virtual;
          procedure StoreTablesToTempFile; virtual;
          procedure ToggleAutoCalc; virtual;
          procedure ToggleBlockOn; virtual;
          procedure ToggleDisplayHeaders; virtual;
          procedure ToggleEnd; virtual;
          procedure ToggleFormulaDisplay; virtual;
          function  TrackCursor: Boolean; virtual;
          procedure UpdateScreenBlockDisplay; virtual;
          function  WidthHashStart:BucketRange; virtual;
          function  XToCol(X: Byte): Integer; virtual;
          function  YToRow(Y: Byte): Integer; virtual;
          procedure DoneHashTables; virtual;
          destructor Done; virtual;
        end; {...TSpreadSheet }

   UNIT:

        GLTSHEET.PAS



                                        126








   DESCRIPTION:

        This object implements a simple spreadsheet that you can use in your
        applications.  It is the main object in OOGrid Library(TM) v1.0.

   ************************************************************************
   TSpreadSheet.AddCell function
   ************************************************************************
   DECLARATION:

        function  AddCell(CellType: CellTypes; Pos: CellPos; Error:
          Boolean; Value: Extended; Input: String): Boolean; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Adds a cell to the cell hash table.

   PARAMETERS' DESCRIPTION:

        CellType  :    the type of the cell being added

        Pos  :    the position of the cell in the spreadsheet

        Error     :    indicates if the contents of the cell have a numeric
                       error

        Value     :    the numeric value of the cell

        Input     :    the string contents of the cell

   REMARKS:

        If the cell was succesfully added to the cell hash table, then Add
        returns TRUE; FALSE otherwise.


   ************************************************************************
   TSpreadSheet.AutoCalc field
   ************************************************************************
   DECLARATION:

        AutoCalc : Boolean;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Indicates if the values of the cells in the spreadsheet should be
        recalculated whenever a cell is modified (i.e. Indicates if the
        spreadsheet is in AutoCalc mode).



                                        127








   REMARKS:

        (see TSpreadSheet.ToggleAutoCalc)


   ************************************************************************
   TSpreadSheet.BlankArea field
   ************************************************************************
   DECLARATION:

        BlankArea : TScreenArea;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Area of the window that will be left blank when displaying the
        spreadsheet.

   REMARKS:

        A blank area is formed when a column won't fit in the window and will
        therefore not be displayed, leaving an empty (blank) area in the window.

        (see TSpreadSheet.DisplayBlankArea)


   ************************************************************************
   TSpreadSheet.BlockOn field
   ************************************************************************
   DECLARATION:

        BlockOn : Boolean;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Indicates if a block of cells is currently selected (block mode is on).

   REMARKS:

        (see TSpreadSheet.ToggleBlockOn)


   ************************************************************************
   TSpreadSheet.CellHash field
   ************************************************************************
   DECLARATION:

        CellHash : TCellHashTable;




                                        128








   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Cell hash table that will be used to store the data in the spreadsheet.

   ************************************************************************
   TSpreadSheet.CellHashStart function
   ************************************************************************
   DECLARATION:

        function  CellHashStart(TotalCells: LongInt): BucketRange;
          virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Returns the initial number of buckets the cell hash table will have.

   PARAMETERS' DESCRIPTION:

        TotalCells     :    the number of cells that cell hash table will have

   ************************************************************************
   TSpreadSheet.CellsProtected function
   ************************************************************************
   DECLARATION:

        function  CellsProtected(Block: TBlock): Boolean; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Determines if any cell in the given block cannot be modified.

   PARAMETERS' DESCRIPTION:

        Block     :    the block to be checked for cells that cannot be modified

   ************************************************************************
   TSpreadSheet.CellToFString function
   ************************************************************************
   DECLARATION:

        function  CellToFString(P: CellPos; var AColor: Byte): String;
          virtual;

   UNIT:

        GLTSHEET.PAS

                                        129








   DESCRIPTION:

        Returns the formatted contents of a cell to be displayed in the screen.

   PARAMETERS' DESCRIPTION:

        P    :    the position of the cell that will be displayed

        AColor    :    the color that the cell's contents should be displayed
                       with

   ************************************************************************
   TSpreadSheet.ChangeBounds procedure
   ************************************************************************
   DECLARATION:

        procedure ChangeBounds(var Bounds: TRect); virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Changes the size of the spreadsheet and resets the limits of the
        scroller.

   PARAMETERS' DESCRIPTION:

        Bounds    :    the new area where the spreadsheet will be displayed

   ************************************************************************
   TSpreadSheet.ChangeColHeaders procedure
   ************************************************************************
   DECLARATION:

        procedure ChangeColHeaders; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Assigns a custom header to a column or group of column.

   REMARKS:

        This procedure will present the user with a dialog prompting for the new
        header; if the user enters a valid custom header, it is added to the
        headers hash table.  If a custom assigned header for the selected column
        or group of columns already existed, it will be replaced by the new one.







                                        130








   ************************************************************************
   TSpreadSheet.ChangeColWidth procedure
   ************************************************************************
   DECLARATION:

        procedure ChangeColWidth; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Changes the width of a column or group of columns.

   REMARKS:

        This procedure will present the user with a dialog prompting for a new
        width; if the user enters a valid width, it is added to the width hash
        table.  If a non-default width already existed for the selected column
        or group of columns, it will be replaced.  If the user enters the
        default width for the column, the column will be erased from the width
        hash table.


   ************************************************************************
   TSpreadSheet.CheckForDragging procedure
   ************************************************************************
   DECLARATION:

        procedure CheckForDragging; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Checks if the cursor is being dragged (with the mouse or by holding the
        SHIFT key and using the cursor keys), and -- if necessary -- extends (or
        creates) the block of selected cells, until the cursor is not dragged
        anymore.

   ************************************************************************
   TSpreadSheet.ClearCurrBlock procedure
   ************************************************************************
   DECLARATION:

        procedure ClearCurrBlock; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Turns off the block mode and redisplays the affected cells.


                                        131








   ************************************************************************
   TSpreadSheet.ClearScreenArea procedure
   ************************************************************************
   DECLARATION:

        procedure ClearScreenArea(AreaToClear: PScreenArea); virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Clears an area of the screen (or window).

   PARAMETERS' DESCRIPTION:

        AreaToClear    :    area the will be cleared

   ************************************************************************
   TSpreadSheet.ColArea field
   ************************************************************************
   DECLARATION:

        ColArea : TScreenArea;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Area of the window where column headers will be displayed.

   REMARKS:

        (see TSpreadSheet.DisplayCols)


   ************************************************************************
   TSpreadSheet.ColHeadersHash field
   ************************************************************************
   DECLARATION:

        ColHeadersHash : THeadersHashTable;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Headers hash table that will store custom assigned headers of the
        columns in the spreadsheet.





                                        132








   ************************************************************************
   TSpreadSheet.ColHeadersHashStart function
   ************************************************************************
   DECLARATION:

        function  ColHeadersHashStart : BucketRange; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Returns the number of buckets the headers hash table will have.

   ************************************************************************
   TSpreadSheet.ColStart field
   ************************************************************************
   DECLARATION:

        ColStart : PColStart;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Pointer to the ColStartArray that will store the screen columns where
        the columns of the spreadsheet will be displayed.

   REMARKS:

        (see ColStartArray)


   ************************************************************************
   TSpreadSheet.ColToX function
   ************************************************************************
   DECLARATION:

        function  ColToX(Col: Integer): Byte; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Returns the position in the window where a given spreadsheet column will
        be displayed.

   PARAMETERS' DESCRIPTION:

        Col  :    the number of the column that will be display




                                        133








   REMARKS:

        The Col parameter should be the number of a column that is inside the
        screen block being displayed.


   ************************************************************************
   TSpreadSheet.ColumnToString function
   ************************************************************************
   DECLARATION:

        function  ColumnToString(Column: Word): String; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Converts a given column number to a column letter.

   PARAMETERS' DESCRIPTION:

        Column    :    the column number to be converted

   ************************************************************************
   TSpreadSheet.ColWidth function
   ************************************************************************
   DECLARATION:

        function  ColWidth(Col: Integer): Byte; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Returns the width of a given column.

   PARAMETERS' DESCRIPTION:

        Col  :    the number of the column whose width will be returned by the
                  function

   ************************************************************************
   TSpreadSheet.ContentsArea field
   ************************************************************************
   DECLARATION:

        ContentsArea : TScreenArea;

   UNIT:

        GLTSHEET.PAS




                                        134








   DESCRIPTION:

        Area of the window where the contents of the highlighted cell will be
        displayed.

   REMARKS:

        (see TSpreadSheet.DisplayCellData)


   ************************************************************************
   TSpreadSheet.CopyCellBlock procedure
   ************************************************************************
   DECLARATION:

        procedure CopyCellBlock; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Activates the clipboard and sets it to indicate a copy operation and the
        block to be copied.

   REMARKS:

        The block is not actually copied; the block will be copied when
        TSpreadSheet's PasteCellBlock method is called.


   ************************************************************************
   TSpreadSheet.CurrBlock field
   ************************************************************************
   DECLARATION:

        CurrBlock : PBlock;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        The currently selected block of cells (if any).

   ************************************************************************
   TSpreadSheet.CurrPos field
   ************************************************************************
   DECLARATION:

        CurrPos : CellPos;

   UNIT:

        GLTSHEET.PAS


                                        135








   DESCRIPTION:

        The position of the cursor in the spreadsheet.

   ************************************************************************
   TSpreadSheet.DataArea field
   ************************************************************************
   DECLARATION:

        DataArea : TScreenArea;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Area of the window where information about the highlighted cell will be
        displayed.

   REMARKS:

        (see TSpreadSheet.DisplayCellData)


   ************************************************************************
   TSpreadSheet.DefaultColWidth field
   ************************************************************************
   DECLARATION:

        DefaultColWidth : Byte;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Default width of the columns in the spreadsheet.

   ************************************************************************
   TSpreadSheet.DefaultCurrency field
   ************************************************************************
   DECLARATION:

        DefaultCurrency : CurrencyStr;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        This is the currency string that will be used by default when adding a
        currency character to numbers.




                                        136








   ************************************************************************
   TSpreadSheet.DefaultDecimalPlaces field
   ************************************************************************
   DECLARATION:

        DefaultDecimalPlaces : Byte;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Default number of decimal places a number will be displayed with.

   ************************************************************************
   TSpreadSheet.DeleteBlock procedure
   ************************************************************************
   DECLARATION:

        procedure DeleteBlock(Block: TBlock; var Deleted: Boolean);
          virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Deletes a block of cells from the spreadsheet.

   PARAMETERS' DESCRIPTION:

        Block     :    the block to be deleted

        Deleted   :    after a call to DeleteBlock, this parameter will contain
                       a boolean value indicating if the cells were successfully
                       deleted

   REMARKS:

        If Deleted contains a FALSE value, it means that either there was an
        error during the delete operation or the cells did not exist.

        (see TSpreadSheet.DeleteCell)


   ************************************************************************
   TSpreadSheet.DeleteCell procedure
   ************************************************************************
   DECLARATION:

        procedure DeleteCell(Pos: CellPos; var Deleted: Boolean);
          virtual;

   UNIT:

        GLTSHEET.PAS

                                        137








   DESCRIPTION:

        Deletes a cell from the spreadsheet.

   PARAMETERS' DESCRIPTION:

        Pos  :    the position of the cell to be deleted

        Deleted   :    after a call to DeleteCell, this parameter will contain a
                       boolean value indicating if the cell was sucessfully
                       deleted

   REMARKS:

        If Deleted contains a FALSE value, it means that either there was an
        error during the delete operation or the cell did not exist.


   ************************************************************************
   TSpreadSheet.DeleteColFromHash procedure
   ************************************************************************
   DECLARATION:

        procedure DeleteColFromHash(Block: TBlock; Columns, EndDelCol:
          Word; var Deleted: Boolean); virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Deletes a column or block of columns from the spreadsheet's hash tables.

   PARAMETERS' DESCRIPTION:

        Block     :    the block of cells that will be deleted

        Columns   :    the number of columns that will be deleted

        EndDelCol :    the number of the right most column in the block of
                       columns that will deleted

        Deleted   :    after a call to DeleteColFromHash, this parameter will
                       contain a boolean value indicating if the cells where
                       sucessfully deleted (see TSpreadSheet.DeleteBlock)

   REMARKS:

        (see TSpreadSheet.DeleteColumns)


   ************************************************************************
   TSpreadSheet.DeleteColHeaders procedure
   ************************************************************************
   DECLARATION:

        procedure DeleteColHeaders(Block: PBlock); virtual;

                                           138








   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Deletes the custom assigned headers of a block of columns from the
        headers hash table.

   PARAMETERS' DESCRIPTION:

        Block     :    the block of columns whose headers will be delete

   ************************************************************************
   TSpreadSheet.DeleteColumns procedure
   ************************************************************************
   DECLARATION:

        procedure DeleteColumns; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Deletes a column or block of columns from the spreadsheet.

   REMARKS:

        (see TSpreadSheet.DeleteColFromHash)


   ************************************************************************
   TSpreadSheet.DeleteRowFromHash procedure
   ************************************************************************
   DECLARATION:

        procedure DeleteRowFromHash(Block: TBlock; Rows, EndDelRow:
          Word; var Deleted: Boolean); virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Deletes a row or block of rows from the spreadsheet's hash tables.

   PARAMETERS' DESCRIPTION:

        Block     :    the block of cells that will be deleted

        Rows :    the number of rows that will be deleted

        EndDelRow :    the number of the last row in the block of rows that will
                       be deleted


                                           139








        Deleted   :    after a call to DeleteRowFromHash, this parameter will
                       contain a boolean value indicating if the cells where
                       sucessfully deleted (see TSpreadSheet.DeleteBlock)

   REMARKS:

        (see TSpreadSheet.DeleteRows)


   ************************************************************************
   TSpreadSheet.DeleteRows procedure
   ************************************************************************
   DECLARATION:

        procedure DeleteRows; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Deletes a row or block of columns from the spreadsheet.

   REMARKS:

        (see TSpreadSheet.DeleteRowFromHash)


   ************************************************************************
   TSpreadSheet.DisplayAllCells procedure
   ************************************************************************
   DECLARATION:

        procedure DisplayAllCells; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Displays all the cells in the current screen block.

   REMARKS:

        (see TSpreadSheet.ScreenBlock)


   ************************************************************************
   TSpreadSheet.DisplayArea field
   ************************************************************************
   DECLARATION:

        DisplayArea : TScreenArea;




                                        140








   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Area of the window where the data in the spreadsheet will be displayed.

   REMARKS:

        (see TSpreadSheet.DisplayAllCells)


   ************************************************************************
   TSpreadSheet.DisplayBlankArea procedure
   ************************************************************************
   DECLARATION:

        procedure DisplayBlankArea; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Clears the empty area in the spreadsheet.

   REMARKS:

        (see TSpreadSheet.ClearScreenArea, TSpreadSheet.BlankArea)


   ************************************************************************
   TSpreadSheet.DisplayBlock procedure
   ************************************************************************
   DECLARATION:

        procedure DisplayBlock(B: TBlock); virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Displays a block of cells.

   PARAMETERS' DESCRIPTION:

        Block     :    the block of cells that should be displayed

   REMARKS:

        Only cells in the current screen block will be displayed.

        (see TSpreadSheet.ScreenBlock, TSpreadSheet.DisplayCellBlock)


                                        141








   ************************************************************************
   TSpreadSheet.DisplayBlockDiff procedure
   ************************************************************************
   DECLARATION:

        procedure DisplayBlockDiff(B1, B2: TBlock); virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Displays the cells present in one block, not present in the another
        block.

   PARAMETERS' DESCRIPTION:

        B1   :    the reference block

        B2   :    cells in this block not present in the reference block (B1)
                  will be displayed.

   ************************************************************************
   TSpreadSheet.DisplayCell procedure
   ************************************************************************
   DECLARATION:

        procedure DisplayCell(P: CellPos); virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Displays a single cell.

   PARAMETERS' DESCRIPTION:

        P    :    the position of the cell to be displayed

   REMARKS:

        The cell must be inside the current screen block.

        (see TSpreadSheet.ScreenBlock)


   ************************************************************************
   TSpreadSheet.DisplayCellBlock procedure
   ************************************************************************
   DECLARATION:

        procedure DisplayCellBlock(C1, R1, C2, R2: Word); virtual;




                                        142








   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Displays a block of cells.

   PARAMETERS' DESCRIPTION:

        C1   :    the column number of the upper left corner of the block of
                  cells to be displayed

        R1   :    the row number of the upper left corner of the block of cells
                  to be displayed

        C2   :    the column number of the lower right corner of the block of
                  cells to be displayed

        R2   :    the row number of the lower right corner of the block of cells
                  to be displayed

   REMARKS:

        Only cells in the current screen block will be displayed.

        (see TSpreadSheet.ScreenBlock)


   ************************************************************************
   TSpreadSheet.DisplayCellData procedure
   ************************************************************************
   DECLARATION:

        procedure DisplayCellData; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Displays the highlighted cell's information and contents.

   ************************************************************************
   TSpreadSheet.DisplayCols procedure
   ************************************************************************
   DECLARATION:

        procedure DisplayCols; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Displays the headers of the columns in the current screen block.

                                           143








   REMARKS:

        (see TSpreadSheet.ScreenBlock)


   ************************************************************************
   TSpreadSheet.DisplayFormulas field
   ************************************************************************
   DECLARATION:

        DisplayFormulas : Boolean;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Indicates if formulas (not their results) should be displayed in the
        spreadsheet (i.e. Indicates if the spreadsheet is in Display Formulas
        mode).

   REMARKS:

        (see TSpreadSheet.ToggleDisplayFormulas)


   ************************************************************************
   TSpreadSheet.DisplayHeaders field
   ************************************************************************
   DECLARATION:

        DisplayHeaders : Boolean;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Indicates if custom assigned headers should be displayed (i.e. Indicates
        if the spreadsheet is in Display Headers mode)

   REMARKS:

        (see ToggleDisplayHeaders)


   ************************************************************************
   TSpreadSheet.DisplayInfo procedure
   ************************************************************************
   DECLARATION:

        procedure DisplayInfo; virtual;

   UNIT:

        GLTSHEET.PAS

                                        144








   DESCRIPTION:

        Displays the spreadsheet's information characters in the info area.

   ************************************************************************
   TSpreadSheet.DisplayRows procedure
   ************************************************************************
   DECLARATION:

        procedure DisplayRows; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Displays the row numbers of the rows in the current screen block.

   REMARKS:

        (see TSpreadSheet.ScreenBlock)


   ************************************************************************
   TSpreadSheet.DoAfterEndInput procedure
   ************************************************************************
   DECLARATION:

        procedure DoAfterEndInput; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        This procedure is always called after a cell is added or modified.

   REMARKS:

        This is a very important procedure when creating data entry screens.  By
        overriding this method, you can control what happens after a cell is
        added or modified.  For example, you can add additional data to the
        spreadsheet when a particular cell is added; or you can decide when to
        move the cursor left and when to move the cursor to the next line,
        depending on the position of the cell that was added or modified (stored
        in the CurrPos field).

        (see TSpreadSheet.HandleInput)


   ************************************************************************
   TSpreadSheet.Done DESTRUCTOR
   ************************************************************************
   DECLARATION:

        destructor Done; virtual;

                                           145








   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Performs the necessary clean up and disposal of the spreadsheet.

   ************************************************************************
   TSpreadSheet.DoneHashTables procedure
   ************************************************************************
   DECLARATION:

        procedure DoneHashTables; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Performs the necessary clean up and disposal of the spreadsheet's hash
        tables.

   ************************************************************************
   TSpreadSheet.DragCursorWithMouse procedure
   ************************************************************************
   DECLARATION:

        procedure DragCursorWithMouse(Event: TEvent); virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Sets block mode on and extends the block to wherever the mouse is
        pointing.

   PARAMETERS' DESCRIPTION:

        Event     :    the mouse event triggered by the movement of the mouse.

   REMARKS:

        (see CheckForDragging)


   ************************************************************************
   TSpreadSheet.Draw procedure
   ************************************************************************
   DECLARATION:

        procedure Draw; virtual;




                                        146








   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Sets the spreadsheet's areas and draws all of the spreadsheet's
        components.

   ************************************************************************
   TSpreadSheet.EmptyRowsAtBottom field
   ************************************************************************
   DECLARATION:

        EmptyRowsAtBottom : Byte;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Number of rows that will be left empty at the bottom of the window.

   REMARKS:

        Useful if you want to display additional information in the window.

        (see TSpreadSheet.EmptyRowsAtTop)


   ************************************************************************
   TSpreadSheet.EmptyRowsAtTop field
   ************************************************************************
   DECLARATION:

        EmptyRowsAtTop : Byte;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Number of rows that will be left empty at the top of the window.

   REMARKS:

        Useful if you want to display additional information in the window.

        (see TSpreadSheet.EmptyRowsAtBottom)








                                        147








   ************************************************************************
   TSpreadSheet.EraseCellBlock procedure
   ************************************************************************
   DECLARATION:

        procedure EraseCellBlock(EraseBlock: Boolean); virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Deletes a cell or block of cells; verifies that none of the cells being
        deleted is protected before actually deleting the cells.

   PARAMETERS' DESCRIPTION:

        EraseBlock     :    indicates whether a single cell or a block of cells
                            is being deleted

   ************************************************************************
   TSpreadSheet.ExtendCurrBlock procedure
   ************************************************************************
   DECLARATION:

        procedure ExtendCurrBlock(Redraw : Boolean); virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        If block mode is on, then the current block is extended to where the
        cursor is located.

   PARAMETERS' DESCRIPTION:

        Redraw    :    indicates if affected cells should be redrawn.

   ************************************************************************
   TSpreadSheet.FindLastPos procedure
   ************************************************************************
   DECLARATION:

        procedure FindLastPos(DPos: CellPos); virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Determines the lower right corner of the block of cells actually used in
        the spreadsheet.



                                        148








   PARAMETERS' DESCRIPTION:

        DPos :    position used as a reference to find the position being
                  searched.

   REMARKS:

        The reference position is always the position of the cell (or block of
        cells) that was most recently modified.


   ************************************************************************
   TSpreadSheet.FindScreenColStart procedure
   ************************************************************************
   DECLARATION:

        procedure FindScreenColStart; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Finds the starting column of the screen block when the ending column is
        known.

   REMARKS:

        The ending column used is the last column of the current screen block.

        (see TSpreadSheet.FindScreenColStop, TSpreadSheet.SetScreenColStart,
        TSpreadSheet.SetScreenColStop)


   ************************************************************************
   TSpreadSheet.FindScreenColStop procedure
   ************************************************************************
   DECLARATION:

        procedure FindScreenColStop; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Finds the ending column of the screen block when the starting column is
        known.

   REMARKS:

        The starting column used is the first column of the current screen
        block.

        (see TSpreadSheet.FindScreenColStart, TSpreadSheet.SetScreenColStart,
        TSpreadSheet.SetScreenColStop)

                                           149









   ************************************************************************
   TSpreadSheet.FindScreenRowStop procedure
   ************************************************************************
   DECLARATION:

        procedure FindScreenRowStop; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Finds the ending row of the screen block when the starting row is known.

   REMARKS:

        The starting row used is the first row of the current screen block.

        (see TSpreadSheet.FindScreenRowStart, TSpreadSheet.SetScreenRowStart,
        TSpreadSheet.SetScreenRowStop)


   ************************************************************************
   TSpreadSheet.FindScreenRowStart procedure
   ************************************************************************
   DECLARATION:

        procedure FindScreenRowStart; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Finds the starting row of the screen block when the ending row is known.

   REMARKS:

        The ending row used is the last row of the current screen block.

        (see TSpreadSheet.FindScreenRowStop, TSpreadSheet.SetScreenRowStart,
        TSpreadSheet.SetScreenRowStop)


   ************************************************************************
   TSpreadSheet.FixBlockOverWrite procedure
   ************************************************************************
   DECLARATION:

        procedure FixBlockOverWrite(Block: TBlock); virtual;

   UNIT:

        GLTSHEET.PAS


                                        150








   DESCRIPTION:

        Updates the overwrite information for the given block of cells.

   PARAMETERS' DESCRIPTION:

        Block     :    the block of cells whose overwrite information will be
                       updated

   REMARKS:

        IMPORTANT : No memory checking is done since it is assumed that no cells
        were added to the block of cells being updated; therefore, if new
        information must be added and there is not enought memory to do it, you
        will start receiving 'Out of memory' messages for each piece of
        overwrite information that cannot be added to the overwrite hash table.


   ************************************************************************
   TSpreadSheet.FixOverWrite function
   ************************************************************************
   DECLARATION:

        function  FixOverWrite: Boolean; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Updates the overwrite information for each cell in the spreadsheet.

   REMARKS:

        If the operation was completed sucessfully, this function will return
        TRUE; it will return FALSE otherwise.


   ************************************************************************
   TSpreadSheet.FormatDefault procedure
   ************************************************************************
   DECLARATION:

        procedure FormatDefault; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Erases all format information for a cell or block of cells from the
        format hash table.





                                        151








   ************************************************************************
   TSpreadSheet.FormulaHash field
   ************************************************************************
   DECLARATION:

        FormatHash : TFormatHashTable;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Format hash table that will be used to store the formats for blocks of
        cells in the spreadsheet.

   ************************************************************************
   TSpreadSheet.FStringSituationColor function
   ************************************************************************
   DECLARATION:

        function  FStringSituationColor(P: CellPos; var CP: PCell; var
          HasError, ColorFound: Boolean): Byte; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Returns a situation especific color for the string to be displayed in
        the spreadsheet (e.g. highlighted cell color, cell in block color,
        etc.).

   PARAMETERS' DESCRIPTION:

        P    :    the position of the cell whose contents are being displayed in
                  the screen.

        CP   :    after a call to this function, this parameter will contain a
                  pointer to the cell in the given position

        HasError  :    after a call to this function, this parameter will
                       indicate if the cell's contents have a numeric error

        ColorFound     :    after a call to this function, this parameter will
                            indicate if a situation especific color was found
                            for the cell at the given position.

   ************************************************************************
   TSpreadSheet.GetFormat procedure
   ************************************************************************
   DECLARATION:

        procedure GetFormat; virtual;




                                        152








   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Prompts the user for a new format and if a valid format is returned, it
        will be added to the format hash table.

   ************************************************************************
   TSpreadSheet.GetPalette function
   ************************************************************************
   DECLARATION:

        function  GetPalette: PPalette; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Returns a pointer to the object's new palette.

   REMARKS:

        (see CSpreadSheet)


   ************************************************************************
   TSpreadSheet.GoToCell procedure
   ************************************************************************
   DECLARATION:

        procedure GoToCell; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Prompts the user for a destination position and if a valid cell address
        is returned, the cursor is moved to that address.

   ************************************************************************
   TSpreadSheet.GoToEnd field
   ************************************************************************
   DECLARATION:

        GoToEnd : Boolean;

   UNIT:

        GLTSHEET.PAS




                                        153








   DESCRIPTION:

        Indicates if the END key was pressed.

   REMARKS:

        When GoToEnd is true, pressing one of the cursor keys will move the
        cursor to the end of the spreadsheet in the direction of the cursor key
        pressed.

        (see TSpreadSheet.ToggleEnd)


   ************************************************************************
   TSpreadSheet.HandleEvent procedure
   ************************************************************************
   DECLARATION:

        procedure HandleEvent(var Event: TEvent); virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Implements the object's event handling.

   PARAMETERS' DESCRIPTION:

        Event     :    the event that will be evaluated and, if possible,
                       handled by this method

   REMARKS:

        This method handles keyboard events (cursor keys, ESC, END and ENTER) by
        moving the spreadsheet's cursor and -- when the clipboard is active --
        by pasting blocks of cells, mouse double clicks by changing a column's
        header, mouse clicks and dragging by moving the cursor to the clicked
        position (and extending the block of selected cells to that position
        when the cursor is being dragged) and several command events (see
        cmXXXX).


   ************************************************************************
   TSpreadSheet.HandleInput procedure
   ************************************************************************
   DECLARATION:

        procedure HandleInput(FirstChar: String; Editing: Boolean);
          virtual;

   UNIT:

        GLTSHEET.PAS




                                        154








   DESCRIPTION:

        Gets data from the user, validates it and creates and adds the
        corresponding cell to store the data.

   PARAMETERS' DESCRIPTION:

        FirstChar :    this parameter should contain the first typed character
                       when creating a new cell, or the cell's previous contents
                       when editing the cell.

        Editing   :    indicates if the cell's contents are being edited and not
                       created from scratch.

   REMARKS:

        (see TSpreadSheet.DoAfterEndInput)


   ************************************************************************
   TSpreadSheet.InfoArea field
   ************************************************************************
   DECLARATION:

        InfoArea : TScreenArea;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Area of the window where information about the spreadsheet (number and
        modes) will be displayed.

   REMARKS:

        (see TSpreadSheet.DisplayInfo)


   ************************************************************************
   TSpreadSheet.Init CONSTRUCTOR
   ************************************************************************
   DECLARATION:

        constructor Init(var Bounds: TRect; InitCells: LongInt;
          AEmptyRowsAtTop, AEmptyRowsAtBottom: Byte; AHScrollBar,
          AVScrollBar: PLimScrollBar; AInitMaxCols, AInitMaxRows:
          Integer; InitDefaultColWidth, InitDefaultDecimalPlaces,
          InitMaxDecimalPlaces: Byte; InitDefaultCurrency:
          CurrencyStr);

   UNIT:

        GLTSHEET.PAS




                                        155








   DESCRIPTION:

        Creates and initializes the TSpreadSheet object.

   PARAMETERS' DESCRIPTION:

        Bounds    :    the area where the spreadsheet will be displayed (should
                       be the all area of the window; the area where the
                       spreadsheet is displayed can be reduced using the
                       AEmptyRowsAtTop and AEmptyRowsAtBottom parameters)

        InitCells :    the number of used cells the spreadsheet has (might be
                       non-cero when loading from disk)

        AEmptyRowsAtTop     :    the number of rows that will be left empty at
                                 the top of the window where the spreadsheet
                                 will be displayed

        AEmptyRowsAtBottom  :    the number of rows that will be left empty at
                                 the bottom of the window where the spreadsheet
                                 will be displayed

        AHScrollBar    :    pointer to the horizontal limited scrolling scroll
                            bar that will be used by the spreadsheet (must be
                            non-nil)

        AVScrollBar    :    pointer to the vertical limited scrolling scroll bar
                            that will be used by the spreadsheet (must be non-
                            nil)

        AInitMaxCols   :    the (maximum) number of columns the spreadsheet will
                            have

        AInitMaxRows   :    the (maximum) number of rows the spreadsheet will
                            have

        InitDefaultColWidth :    the default width of the columns in the
                                 spreadsheet

        InitDefaultDecimalPlaces :    the default number of decimal places
                                      numbers should be displayed with
        InitMaxDecimalPlaces     :    the maximum number of decimal places a
                                      number can be displayed with

        InitDefaultCurrency :    the default currency string that should be used
                                 when formatting numbers

   ************************************************************************
   TSpreadSheet.InitCurrPos procedure
   ************************************************************************
   DECLARATION:

        procedure InitCurrPos; virtual;

   UNIT:

        GLTSHEET.PAS


                                        156








   DESCRIPTION:

        Sets the position of the cursor to the first position in the spreadsheet
        (column 1 : row 1).

   ************************************************************************
   TSpreadSheet.InsertColumns procedure
   ************************************************************************
   DECLARATION:

        procedure InsertColumns; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Inserts one or more columns in the spreadsheet.

   REMARKS:

        (see TSpreadSheet.InsertColToHash)


   ************************************************************************
   TSpreadSheet.InsertRows procedure
   ************************************************************************
   DECLARATION:

        procedure InsertRows; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Inserts one or more rows in the spreadsheet.

   REMARKS:

        (see TSpreadSheet.InsertRowToHash)


   ************************************************************************
   TSpreadSheet.InsertRowToHash procedure
   ************************************************************************
   DECLARATION:

        procedure InsertRowToHash(Block: TBlock; Rows, StartInsRow:
          Word; var Deleted: Boolean); virtual;

   UNIT:

        GLTSHEET.PAS



                                        157








   DESCRIPTION:

        Insert a row or block of rows in the spreadsheet's hash tables.

   PARAMETERS' DESCRIPTION:

        Block     :    the block of cells that will be deleted (if any);  this
                       block will always be the block of cells that are located
                       in the last rows of the spreadsheet and that get pushed
                       out when one or more rows are inserted.

        Rows :    the number of rows that will be inserted

        StartInsRow    :    the row number where the new rows will be inserted

        Deleted   :    after a call to this procedure, this parameter will
                       contain a boolean value indicating if any cells were
                       deleted from the spreadsheet.

   REMARKS:

        (see TSpreadSheet.InsertRows)


   ************************************************************************
   TSpreadSheet.KeyPressed field
   ************************************************************************
   DECLARATION:

        KeyPressed : Boolean;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Indicates if a key was pressed.

   REMARKS:

        This field is used by TSpreadSheet's ScrollDraw method to determine when
        the mouse caused the scrollbar to change and when the movement of the
        cursor (using the cursor keys) caused the scrollbar to change.


   ************************************************************************
   TSpreadSheet.LastPos field
   ************************************************************************
   DECLARATION:

        LastPos : CellPos;

   UNIT:

        GLTSHEET.PAS



                                        158








   DESCRIPTION:

        The lower right corner of the block of cells actually used in the
        spreadsheet.

   ************************************************************************
   TSpreadSheet.Load CONSTRUCTOR
   ************************************************************************
   DECLARATION:

        constructor Load(var S: TStream);

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Loads the spreadsheet from disk.

   PARAMETERS' DESCRIPTION:

        S    :    the stream from which the spreadsheet will be loaded

   ************************************************************************
   TSpreadSheet.LoadDelimited procedure
   ************************************************************************
   DECLARATION:

        procedure LoadDelimited(FileName: PathStr); virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        This method imports a comma delimited file of a certain format and is
        intended only as an example of how to import comma delimited files. 
        This method must be overridden if you wish to import delimited files of
        different formats.

   PARAMETERS' DESCRIPTION:

        FileName  :    the filename of the comma delimited file that will be
                       imported.

   ************************************************************************
   TSpreadSheet.LoadHashTables procedure
   ************************************************************************
   DECLARATION:

        procedure LoadHashTables(var S: TStream; AdjustAfter: CellPos;
          RowAdjustment, ColAdjustment: Integer); virtual;

   UNIT:

        GLTSHEET.PAS

                                        159








   DESCRIPTION:

        Loads the spreadsheet's hash tables from a stream.

   PARAMETERS' DESCRIPTION:

        S    :    the stream from which the hash tables will be loaded

        AdjustAfter    :    The location of all cells in the cell hash table
                            being loaded, below and to the left of this
                            position, will be increased by RowAdjustment and
                            ColAdjustment respectively.

        RowAdjustment  :    the row location of all cells below AdjustAfter will
                            be increased by this amount.

        ColAdjustment  :    the column location of all cells to the left of
                            AdjustAfter will be increased by this amount.

   REMARKS:

        The AdjustAfter, RowAdjustment and ColAdjustment parameters are used to
        relocate the cells in the cell hash table, when adding or deleting rows
        or columns.

        (see TSpreadSheet.StoreTablesToTempFile, TSpreadSheet.InsertColumns,
        TSpreadSheet.InsertRows, TSpreadSheet.DeleteColumns,
        TSpreadSheet.DeleteRows)


   ************************************************************************
   TSpreadSheet.LoadTablesFromTempFile procedure
   ************************************************************************
   DECLARATION:

        procedure LoadTablesFromTempFile(AdjustAfter: CellPos; 
          RowAdjustment, ColAdjustment: Integer); virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Loads the spreadsheet's hash tables from the temporary file.

   PARAMETERS' DESCRIPTION:

        AdjustAfter    :    The location of all cells in the cell hash table
                            being loaded, below and to the left of this
                            position, will be increased by RowAdjustment and
                            ColAdjustment respectively.

        RowAdjustment  :    the row location of all cells below AdjustAfter will
                            be increased by this amount.

        ColAdjustment  :    the column location of all cells to the left of
                            AdjustAfter will be increased by this amount

                                           160








   REMARKS:

        The AdjustAfter, RowAdjustment and ColAdjustment parameters are used to
        relocate the cells in the cell hash table, when adding or deleting rows
        or columns.

        (see TSpreadSheet.InsertColumns, TSpreadSheet.InsertRows,
        TSpreadSheet.DeleteColumns, TSpreadSheet.DeleteRows)


   ************************************************************************
   TSpreadSheet.LocateCursorWithMouse procedure
   ************************************************************************
   DECLARATION:

        procedure LocateCursorWithMouse(Event: TEvent); virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Locates the cursor wherever the mouse was clicked -- if inside the
        display area --.

   PARAMETERS' DESCRIPTION:

        Event     :    the event triggered by the mouse click

   REMARKS:

        (see TSpreadSheet.DragCursorWithMouse) 


   ************************************************************************
   TSpreadSheet.MaxCols field
   ************************************************************************
   DECLARATION:

        MaxCols : Integer;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        (Maximum) Number of rows the spreadsheet will have.

   ************************************************************************
   TSpreadSheet.MaxColWidth field
   ************************************************************************
   DECLARATION:

        MaxColWidth : Byte;



                                        161








   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        The maximum width a column can have.

   REMARKS:

        This is by default the maximum number of columns that can be used to
        display the data in the spreadsheet.


   ************************************************************************
   TSpreadSheet.MaxDecimalPlaces field
   ************************************************************************
   DECLARATION:

        MaxDecimalPlaces : Byte;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        The maximum number of decimal places a number can be displayed with.

   ************************************************************************
   TSpreadSheet.MaxRows field
   ************************************************************************
   DECLARATION:

        MaxRows : Integer;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        (Maximum) Number of columns the spreadsheet will have.

   ************************************************************************
   TSpreadSheet.MaxScreenCols field
   ************************************************************************
   DECLARATION:

        MaxScreenCols : Byte;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        The maximum number of spreadsheet columns that can be displayed in a

                                           162








        window.

   ************************************************************************
   TSpreadSheet.Modified field
   ************************************************************************
   DECLARATION:

        Modified : Boolean;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Indicates if the spreadsheet has been modified and the modifications
        have not been saved to disk.

   REMARKS:

        (see TSpreadSheet.SetChanged)


   ************************************************************************
   TSpreadSheet.MoveCell procedure
   ************************************************************************
   DECLARATION:

        procedure MoveCell(OldPos: CellPos); virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Redisplays the cursor in its new position (stored in the CurrPos field)
        in the spreadsheet, and if in block mode, extends the block of selected
        cells to that position.

   PARAMETERS' DESCRIPTION:

        OldPos    :    the previous position of the cursor

   ************************************************************************
   TSpreadSheet.MoveCellBlock procedure
   ************************************************************************
   DECLARATION:

        procedure MoveCellBlock; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Activates the clipboard and sets it to indicate a move operation and the

                                           163








        block to be moved.

   REMARKS:

        The block is not actually moved; the block will be moved when
        TSpreadSheet's PasteCellBlock method is called.


   ************************************************************************
   TSpreadSheet.MoveDown procedure
   ************************************************************************
   DECLARATION:

        procedure MoveDown; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Moves the cursor one position down.

   ************************************************************************
   TSpreadSheet.MoveHome procedure
   ************************************************************************
   DECLARATION:

        procedure MoveHome; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Moves the cursor to the first position in the spreadsheet (column 1 :
        row 1).

   ************************************************************************
   TSpreadSheet.MoveLeft procedure
   ************************************************************************
   DECLARATION:

        procedure MoveLeft; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Moves the cursor one position to the left.






                                        164








   ************************************************************************
   TSpreadSheet.MovePgDown procedure
   ************************************************************************
   DECLARATION:

        procedure MovePgDown; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Moves the cursor one page down.

   ************************************************************************
   TSpreadSheet.MovePgLeft procedure
   ************************************************************************
   DECLARATION:

        procedure MovePgLeft; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Moves the cursor one page to the left.

   ************************************************************************
   TSpreadSheet.MovePgRight procedure
   ************************************************************************
   DECLARATION:

        procedure MovePgRight; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Moves the cursor one page to the right.

   ************************************************************************
   TSpreadSheet.MovePgUp procedure
   ************************************************************************
   DECLARATION:

        procedure MovePgUp; virtual;

   UNIT:

        GLTSHEET.PAS




                                        165








   DESCRIPTION:

        Moves the cursor one page up.

   ************************************************************************
   TSpreadSheet.MoveRight procedure
   ************************************************************************
   DECLARATION:

        procedure MoveRight; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Move the cursor one position to the right.

   ************************************************************************
   TSpreadSheet.MoveUp procedure
   ************************************************************************
   DECLARATION:

        procedure MoveUp; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Moves the cursor one position up.

   ************************************************************************
   TSpreadSheet.NoBlankArea field
   ************************************************************************
   DECLARATION:

        NoBlankArea : Boolean;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Indicates if there is an empty area in the window.

   REMARKS:

        (see TSpreadSheet.BlankArea)







                                        166








   ************************************************************************
   TSpreadSheet.Number field
   ************************************************************************
   DECLARATION:

        Number : Byte;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        The number assigned to the spreadsheet.

   REMARKS:

        This number is displayed as a letter in the info area.

        (see TSpreadSheet.SetNumber)


   ************************************************************************
   TSpreadSheet.OldCurrPos field
   ************************************************************************
   DECLARATION:

        OldCurrPos : CellPos;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Used to temporarily store the position of the cursor when the
        spreadsheet is not active.  When the spreadsheet is activated again, the
        cursor is set to the position stored in this field.

   REMARKS:

        (see TSpreadSheet.SetState)


   ************************************************************************
   TSpreadSheet.OverwriteHash field
   ************************************************************************
   DECLARATION:

        OverwriteHash : TOverwriteHashTable;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Overwrite hash table that will be used to store overwrite information

                                           167








        for the cells in the spreadsheet.

   ************************************************************************
   TSpreadSheet.OverwriteHashStart function
   ************************************************************************
   DECLARATION:

        function  OverwriteHashStart: BucketRange; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Returns the number of buckets the overwrite hash table will have.

   ************************************************************************
   TSpreadSheet.Parser function
   ************************************************************************
   DECLARATION:

        function  Parser: PParserObject; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Returns a pointer to the parser object that will be used by the
        spreadsheet.

   REMARKS:

        (see StandardParser in GLPARSER.INT, StandardSortObject,
        TSpreadSheet.SortObject)


   ************************************************************************
   TSpreadSheet.PasteBlock procedure
   ************************************************************************
   DECLARATION:

        procedure PasteBlock(DestBlock: TBlock; Formulas: Word);
          virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Copies or moves a block of cells in a cell hash table to a new position.

   PARAMETERS' DESCRIPTION:

        DestBlock :    the block where the cells will be copied or moved.

                                           168








        Formulas  :    bit flags indicating if formulas should be copied
                       literally when moved or copied to another position (see
                       RCopyFormulas).

                       $01 = copy column references literally
                       $02 = copy row references literally

   REMARKS:

        (see TSpreadSheet.PasteCellBlock)


   ************************************************************************
   TSpreadSheet.PasteCellBlock procedure
   ************************************************************************
   DECLARATION:

        procedure PasteCellBlock; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        If the clipboard is active, this method determines the destination block
        of the cells that will be copied or moved and verifies that no attempt
        is being made to change a protected cell before copying or moving the
        source block of cells to its new position.

   REMARKS:

        (see TSpreadSheet.PasteBlock, ClipBoardRec)


   ************************************************************************
   TSpreadSheet.Print procedure
   ************************************************************************
   DECLARATION:

        procedure Print; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Prompts the user for the desired printer configuration and the prints
        the file to the selected output device.

   ************************************************************************
   TSpreadSheet.Recalc procedure
   ************************************************************************
   DECLARATION:

        procedure Recalc(Display: Boolean); virtual;


                                        169








   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Recalculates the value of each cells in the spreadsheet.

   REMARKS:

        This is a very simple method to recalculate the value the cells in the
        spreadsheet;  it could happen that a cell might not get correctly
        recalculated because of information that is not updated on time.


   ************************************************************************
   TSpreadSheet.RowArea field
   ************************************************************************
   DECLARATION:

        RowArea : TScreenArea;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Area of the window where row numbers will be displayed.

   REMARKS:

        (see TSpreadSheet.DisplayRows)


   ************************************************************************
   TSpreadSheet.RowNumberSpace field
   ************************************************************************
   DECLARATION:

        RowNumberSpace : Byte;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        The number of screen columns that are used to display the row numbers.

   REMARKS:

        At first, this field depended on the number of rows that the spreadsheet
        had.  However, since the info area (just above the row numbers) must
        have a constant size, this field was assigned a constant size of 6.




                                        170








   ************************************************************************
   TSpreadSheet.RowToY function
   ************************************************************************
   DECLARATION:

        function  RowToY(Row: Integer): Byte; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Returns the location in the screen of a given column.

   PARAMETERS' DESCRIPTION:

        Row  :    the row whose location in the screen will be determined

   ************************************************************************
   TSpreadSheet.SameCellPos function
   ************************************************************************
   DECLARATION:

        function  SameCellPos(P1, P2 : CellPos) : Boolean; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Returns TRUE if two given cell positions are the same.
        P1   :    a cell position to be compared

        P2   :    a cell position to be compared


   ************************************************************************
   TSpreadSheet.ScrollDraw procedure
   ************************************************************************
   DECLARATION:

        procedure ScrollDraw; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Redraws the spreadsheet whenever the scroll bars change.







                                        171








   ************************************************************************
   TSpreadSheet.SelectColumn function
   ************************************************************************
   DECLARATION:

        function  SelectColumn(var Event: TEvent): Boolean; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Checks if the mouse was clicked in the headers area, determines the
        column whose header was clicked and then selects the column.

   PARAMETERS' DESCRIPTION:

        Event     :    the event being evaluated and, if possible, handled by
                       this method

   ************************************************************************
   TSpreadSheet.SetAreas procedure
   ************************************************************************
   DECLARATION:

        procedure SetAreas(ScrollArea: TRect); virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Sets the different display areas (info, column headers, row numbers,
        cell data, cell contents, display and blank areas) of the spreadsheet.

   PARAMETERS' DESCRIPTION:

        ScrollArea     :    the area of the window where the spreadsheet will be
                            displayed

   REMARKS:

        (see TSpreadSheet.InfoArea, TSpreadSheetadsSheet.ColArea,
        TSpreadSheet.RowArea, TSpreadSheet.DataArea, TSpreadSheet.ContenstArea,
        TSpreadSheet.DisplayArea, TSpreadSheet.BlankArea)


   ************************************************************************
   TSpreadSheet.SetBlankArea procedure
   ************************************************************************
   DECLARATION:

        procedure SetBlankArea; virtual;




                                        172








   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Sets the area the will be left empty in the spreadsheet.

   REMARKS:

        If there is no blank area, this method sets the NoBlankArea field to
        TRUE; otherwise, it is set to FALSE.

        (see TSpreadSheet.NoBlankArea)


   ************************************************************************
   TSpreadSheet.SetChanged procedure
   ************************************************************************
   DECLARATION:

        procedure SetChanged(IsChanged: Boolean); virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Sets the modified state of the spreadsheet.

   PARAMETERS' DESCRIPTION:

        IsChanged :    the modified state of the spreadsheet.  TRUE indicates
                       that the spreadsheet has been modified since the last
                       save; FALSE indicates that the spreadsheet has not been
                       modified since the last save.

   REMARKS:

        (see TSpreadSheet.Modified)


   ************************************************************************
   TSpreadSheet.SetLimit procedure
   ************************************************************************
   DECLARATION:

        procedure SetLimit(X, Y: Integer); virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Sets the scrolling limits of the spreadsheet and ajusts the scrollbars
        accordingly.

                                           173








   PARAMETERS' DESCRIPTION:

        X    :    the spreadsheet's horizontal scrolling limit

        Y    :    the spreadsheet's vertical scrolling limit

   ************************************************************************
   TSpreadSheet.SetLocked procedure
   ************************************************************************
   DECLARATION:

        procedure SetLocked; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Restores a cell or block of cells to the locked stated (the default
        state), preventing modification of the cells when the spreadsheet is
        protected.

   ************************************************************************
   TSpreadSheet.SetNameWithMouse procedure
   ************************************************************************
   DECLARATION:

        procedure SetNameWithMouse(var Event: TEvent); virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Checks if the mouse was double-clicked in a column header; if true, it
        prompts the user for a new column header.

   PARAMETERS' DESCRIPTION:

        Event     :    the event that was triggered by the mouse double-clicking

   ************************************************************************
   TSpreadSheet.SetNumber procedure
   ************************************************************************
   DECLARATION:

        procedure SetNumber(ANumber: Byte); virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Assigns a number to the spreadsheet.


                                        174








   PARAMETERS' DESCRIPTION:

        ANumber   :    the number of the spreadsheet.

   REMARKS:

        (see TSpreadSheet.Number)


   ************************************************************************
   TSpreadSheet.SetProtection procedure
   ************************************************************************
   DECLARATION:

        procedure SetProtection(Enable, Display: Boolean); virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Enables or disables the spreadsheet's data protection.

   PARAMETERS' DESCRIPTION:

        Enable    :    indicates if data protection should be enabled or
                       disabled

        Display   :    indicates if the spreadsheet should be redisplayed after
                       enabling or disabling data protection.

   ************************************************************************
   TSpreadSheet.SetScreenColStop procedure
   ************************************************************************
   DECLARATION:

        procedure SetScreenColStop(NewCol: Integer); virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Sets a new screen block given an ending column.

   PARAMETERS' DESCRIPTION:

        NewCol    :    the ending column of the new screen block

   REMARKS:

        (see TSpreadSheet.ScreenBlock, TSpreadSheet.FindScreenColStart,
        TSpreadSheet.FindScreenColStop)




                                        175








   ************************************************************************
   TSpreadSheet.SetScreenColStart procedure
   ************************************************************************
   DECLARATION:

        procedure SetScreenColStart(NewCol: Integer); virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Sets a new screen block given a starting column.

   PARAMETERS' DESCRIPTION:

        NewCol    :    the starting column of the new screen block

   REMARKS:

        (see TSpreadSheet.ScreenBlock, TSpreadSheet.FindScreenColStart,
        TSpreadSheet.FindScreenColStop)


   ************************************************************************
   TSpreadSheet.SetScreenRowStop procedure
   ************************************************************************
   DECLARATION:

        procedure SetScreenRowStop(NewRow: Integer); virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Sets a new screen block given an ending row.

   PARAMETERS' DESCRIPTION:

        NewRow    :    the ending row of the new screen block

   REMARKS:

        (see TSpreadSheet.ScreenBlock, TSpreadSheet.FindScreenRowStart,
        TSpreadSheet.FindScreenRowStop)


   ************************************************************************
   TSpreadSheet.SetScreenRowStart procedure
   ************************************************************************
   DECLARATION:

        procedure SetScreenRowStart(NewRow: Integer); virtual;



                                        176








   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Sets a new screen block given a starting row.

   PARAMETERS' DESCRIPTION:

        NewRow    :    the starting row of the new screen block

   REMARKS:

        (see TSpreadSheet.ScreenBlock, TSpreadSheet.FindScreenRowStart,
        TSpreadSheet.FindScreenRowStop)


   ************************************************************************
   TSpreadSheet.SetState procedure
   ************************************************************************
   DECLARATION:

        procedure SetState(AState: Word; Enable: Boolean); virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Changes the state flags of the spreadsheet and displays or hides the
        cursor depending on whether the spreadsheet is activated or deactivated.

   PARAMETERS' DESCRIPTION:

        AState    :    the state flags that will be enabled or disabled

        Enable    :    indicates if the given state flags should be enabled or
                       disabled

   ************************************************************************
   TSpreadSheet.SetUnlocked procedure
   ************************************************************************
   DECLARATION:

        procedure SetUnlocked; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Marks a cell or group of cells as unlocked, allowing the modification of
        the cells even when the spreadsheet is protected.



                                        177








   ************************************************************************
   TSpreadSheet.SheetProtected field
   ************************************************************************
   DECLARATION:

        SheetProtected : Boolean;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Indicates if the data in the spreadsheet is protected and cannot be
        modified (except for data in cells marked as unlocked).

   REMARKS:

        (see TSpreadSheet.SetProtection)


   ************************************************************************
   TSpreadSheet.SortData procedure
   ************************************************************************
   DECLARATION:

        procedure SortData; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Sorts the data by rows in the current block of selected cells, using up
        to three different sort keys.

   REMARKS:

        If block mode is off, all the data in the spreadsheet will be selected
        and sorted.

        (see TSortObject, TSpreadSheet.SortObject)


   ************************************************************************
   TSpreadSheet.SortObject function
   ************************************************************************
   DECLARATION:

        function  SortObject : PSortObject; virtual;

   UNIT:

        GLTSHEET.PAS




                                        178








   DESCRIPTION:

        Returns a pointer to the object that will be used to sort the data in
        the spreadsheet.

   REMARKS:

        (see StandardSortObject)


   ************************************************************************
   TSpreadSheet.Store procedure
   ************************************************************************
   DECLARATION:

        procedure Store(var S: TStream);

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Writes the spreadsheet to a stream.

   PARAMETERS' DESCRIPTION:

        S    :    the stream to which the spreadsheet will be written

   ************************************************************************
   TSpreadSheet.StoreHashTables procedure
   ************************************************************************
   DECLARATION:

        procedure StoreHashTables(var S: TStream); virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Writes the spreadsheet's hash tables to a stream.

   PARAMETERS' DESCRIPTION:

        S    :    the stream to which the hash tables will be written

   ************************************************************************
   TSpreadSheet.StoreTablesToTempFile procedure
   ************************************************************************
   DECLARATION:

        procedure StoreTablesToTempFile; virtual;

   UNIT:

        GLTSHEET.PAS

                                        179








   DESCRIPTION:

        Stores the spreadsheet's hash tables to a temporary file.

   REMARKS:

        (see TSpreadSheet.StoreTablesToTempFile)


   ************************************************************************
   TSpreadSheet.ToggleAutoCalc procedure
   ************************************************************************
   DECLARATION:

        procedure ToggleAutoCalc; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Toggles on and off the spreadsheet's auto calc mode.

   ************************************************************************
   TSpreadSheet.ToggleDisplayHeaders procedure
   ************************************************************************
   DECLARATION:

        procedure ToggleDisplayHeaders; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Toggles on and off the spreadsheet's Display Headers mode.

   ************************************************************************
   TSpreadSheet.ToggleEnd procedure
   ************************************************************************
   DECLARATION:

        procedure ToggleEnd; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        When the END key is pressed, pressing a cursor key will move the cursor
        to the end of the spreadsheet in the direction of the cursor key.  This
        method will toggle the value of the GoToEnd field to TRUE and FALSE.




                                        180








   REMARKS:

        (see TSpreadSheet.GoToEnd)


   ************************************************************************
   TSpreadSheet.ToggleFormulaDisplay procedure
   ************************************************************************
   DECLARATION:

        procedure ToggleFormulaDisplay; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Toggles on and off the spreadsheet's Display Formulas mode.

   ************************************************************************
   TSpreadSheet.ToogleBlockOn procedure
   ************************************************************************
   DECLARATION:

        procedure ToggleBlockOn; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Toggles on and off the spreadsheet's block mode.

   ************************************************************************
   TSpreadSheet.TotalRows field
   ************************************************************************
   DECLARATION:

        TotalRows : ScreenRowRange;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        The number of rows currently being displayed in the spreadsheet.

   ************************************************************************
   TSpreadSheet.TrackCursor function
   ************************************************************************
   DECLARATION:

        function  TrackCursor: Boolean; virtual;



                                        181








   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Checks if the cursor is within the limits of the currently displayed
        screen block.  If not, it ajusts the screen block to include the
        position of the cursor.

   ************************************************************************
   TSpreadSheet.UnlockedHash field
   ************************************************************************
   DECLARATION:

        UnlockedHash : TUnlockedHashTable;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Unlocked hash table that will store which cells are marked as unlocked.

   ************************************************************************
   TSpreadSheet.UpdateScreenBlockDisplay procedure
   ************************************************************************
   DECLARATION:

        procedure UpdateScreenBlockDisplay; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Redisplays the screen and changes the scroll bars position whenever the
        screen block changes.

   ************************************************************************
   TSpreadSheet.WidthHash field
   ************************************************************************
   DECLARATION:

        WidthHash : TWidthHashTable;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Width hash table that will be used to store the widths of the columns of
        the spreadsheet.



                                        182








   ************************************************************************
   TSpreadSheet.WidthHashStart function
   ************************************************************************
   DECLARATION:

        function  WidthHashStart:BucketRange; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Returns the number of buckets the width hash table will have.

   ************************************************************************
   TSpreadSheet.XToCol fuction
   ************************************************************************
   DECLARATION:

        function  XToCol(X: Byte): Integer; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Returns the column that includes the given position in the screen.

   PARAMETERS' DESCRIPTION:

        X    :    the screen column which will be checked to see which
                  spreadsheet column includes it

   ************************************************************************
   TSpreadSheet.YToRow function
   ************************************************************************
   DECLARATION:

        function  YToRow(Y: Byte): Integer; virtual;

   UNIT:

        GLTSHEET.PAS

   DESCRIPTION:

        Returns the row that is located in the given position in the screen.

   PARAMETERS' DESCRIPTION:

        Y    :    the screen row which will be checked to see which spreadsheet
                  row is located there





                                        183








   ************************************************************************
   TSpreadSheetWindow object
   ************************************************************************
   DECLARATION:

        TSpreadSheetWindow = object(TWindow)
          constructor Init(Bounds: TRect; ATitle: String; ANumber:
            Integer);
          function GetPalette: PPalette; virtual;
          procedure SizeLimits(var Min, Max: TPoint); virtual;
          function StandardScrollBar(AOptions : Word): PLimScrollBar;
        end; {...TSpreadSheetWindow }

   UNIT:

        GLWINDOW.PAS

   DESCRIPTION:

        This is a TWindow's descendant that can own a TSpreadSheet object.  It
        provides a new color palette and overrides some methods to give
        additional support to a TSpreadSheet object.

   ************************************************************************
   TSpreadSheetWindow.GetPalette function
   ************************************************************************
   DECLARATION:

        function GetPalette: PPalette; virtual;

   UNIT:

        GLWINDOW.PAS

   DESCRIPTION:

        Returns a pointer to the object's new palette.

   REMARKS:

        (see CSpreadSheetWindow1)


   ************************************************************************
   TSpreadSheetWindow.Init CONSTRUCTOR
   ************************************************************************
   DECLARATION:

        constructor Init(Bounds: TRect; ATitle: String; ANumber:
          Integer);

   UNIT:

        GLWINDOW.PAS

   DESCRIPTION:

        Creates and initializes the TSpreadSheetWindow object.

                                           184








   PARAMETERS' DESCRIPTION:

        Bounds    :    the area where the TSpreadSheetWindow object will be
                       displayed.

        ATitle    :    the title of the window

        ANumber   :    the number of the window

   ************************************************************************
   TSpreadSheetWindow.SizeLimits procedure
   ************************************************************************
   DECLARATION:

        procedure SizeLimits(var Min, Max: TPoint); virtual;

   UNIT:

        GLWINDOW.PAS

   DESCRIPTION:

        Returns in the Min and Max parameters the size limits of the window,
        taking into account the size limits of a spreadsheet.

   PARAMETERS' DESCRIPTION:

        Min  :    will contain the minimum size the window can have

        Max  :    will contain the maximum size the window can have

   ************************************************************************
   TSpreadSheetWindow.StandardScrollBar function
   ************************************************************************
   DECLARATION:

        function StandardScrollBar(AOptions : Word): PLimScrollBar;

   UNIT:

        GLWINDOW.PAS

   DESCRIPTION:

        "Constructs, inserts, and returns a pointer to a "standard" limited
        scrolling scroll bar [see TLimScrollBar] for the window. "Standard"
        means the scroll bar fits onto the frame of the window without covering
        corners or the resize icon."**

   PARAMETERS' DESCRIPTION:

        AOptions  :    "AOptions can be either sbHorizontal to produce a
                       horizontal scroll bar along the bottom of the window or
                       sbVertical to produce a vertical scroll bar along the
                       right side of the window."**




                                        185








   REMARKS:

        No keyboard events are handled by a TLimScrollBar object created using
        this function.

        **Taken from Borland Pascal's on-line documentation.


   ************************************************************************
   TTextCell object
   ************************************************************************
   DECLARATION:

        TTextCell = OBJECT(TCell)
            Txt : LString;
          constructor Init(InitLoc : CellPos; InitTxt : String);
          function CellType : CellTypes; virtual;
          function LegalValue : Boolean; virtual;
          function Name : String; virtual;
          function Format(var FHash : TFormatHashTable;
            FormulasDisplayed : Boolean) : FormatType; virtual;
          function Width(var FHash : TFormatHashTable;
            FormulasDisplayed : Boolean) : Word; virtual;
          function Overwritten(var CHash : TCellHashTable;
            var FHash : TFormatHashTable; var WHash : TWidthHashTable;
            var LastPos : CellPos; MaxCols : Word;
            GetColWidth : GetColWidthFunc; FormulasDisplayed : Boolean) :
            Word; virtual;
          function ShouldUpdate : Boolean; virtual;
          function HasError : Boolean; virtual;
          function CurrValue : Extended; virtual;
          function OverwriteStart(var FHash : TFormatHashTable;
            var WHash : TWidthHashTable; GetColWidth : GetColWidthFunc;
            EndCol : Word; DisplayFormulas : Boolean) : Word; virtual;
          procedure EditString(MaxDecPlaces : Byte; var Input : String);
            virtual;
          function DisplayString(FormulasDisplayed : Boolean;
            MaxDecPlaces : Byte) : String; virtual;
          function FormattedString(var OHash : TOverwriteHashTable;
            var FHash : TFormatHashTable; var WHash : TWidthHashTable;
            GetColWidth : GetColWidthFunc; CPos : CellPos;
            FormulasDisplayed : Boolean; Start : Word; ColWidth : Byte;
            var CurrencyString : CurrencyStr; var ClType: CellTypes):
            String; virtual;
          function CopyString : String; virtual;
          constructor Load(var S : TStream);
          procedure Store(var S : TStream);
          destructor Done; virtual;
        end; {...TTextCell }

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        A TCell's descendant that stores a string.


                                        186








   ************************************************************************
   TTextCell.CellType function
   ************************************************************************
   DECLARATION:

        (see TCell.CellType)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TTextCell.CopyString function
   ************************************************************************
   DECLARATION:

        (see TCell.CopyString)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TTextCell.CurrValue function
   ************************************************************************
   DECLARATION:

        (see TCell.CurrValue)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TTextCell.DisplayString function
   ************************************************************************
   DECLARATION:

        (see TCell.DisplayString)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TTextCell.Done DESTRUCTOR
   ************************************************************************
   DECLARATION:

        destructor Done; virtual;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Performs all the necessary cleanup and disposal of the TTextCell object.

                                           187








   ************************************************************************
   TTextCell.EditString procedure
   ************************************************************************
   DECLARATION:

        (see TCell.EditString)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TTextCell.Format function
   ************************************************************************
   DECLARATION:

        (see TCell.Format)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TTextCell.FormattedString function
   ************************************************************************
   DECLARATION:

        (see TCell.FormattedString)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TTextCell.HasError function
   ************************************************************************
   DECLARATION:

        (see TCell.HasError)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TTextCell.Init CONSTRUCTOR
   ************************************************************************
   DECLARATION:

        constructor Init(InitLoc : CellPos; InitTxt : String);

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Creates and initializes the TTextCell object.

                                           188








   PARAMETERS' DESCRIPTION:

        InitLoc   :    the position of the cell in the spreadsheet.

        InitTxt   :    the string the cell will store.

   ************************************************************************
   TTextCell.LegalValue function
   ************************************************************************
   DECLARATION:

        (see TCell.LegalValue)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TTextCell.Load CONSTRUCTOR
   ************************************************************************
   DECLARATION:

        constructor Load(var S: TStream);

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Loads the cell's contents from disk.

   PARAMETERS' DESCRIPTION:

        S : the stream from which will be read the cell's contents.

   ************************************************************************
   TTextCell.Name function
   ************************************************************************
   DECLARATION:

        (see TCell.Name)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TTextCell.OverwriteStart function
   ************************************************************************
   DECLARATION:

        (see TCell.OverwriteStart)

   UNIT:

        GLCELL.PAS


                                        189








   ************************************************************************
   TTextCell.Overwritten function
   ************************************************************************
   DECLARATION:

        (see TCell.Overwritten)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TTextCell.ShouldUpdate function
   ************************************************************************
   DECLARATION:

        (see TCell.ShouldUpdate)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TTextCell.Store procedure
   ************************************************************************
   DECLARATION:

        procedure Store(var S: TStream);

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Writes the cell's contents to disk.

   PARAMETERS' DESCRIPTION:

        S : the stream to which the cell's contents will be written.

   ************************************************************************
   TTextCell.Txt field
   ************************************************************************
   DECLARATION:

        Txt : LString;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Used to store the cell's contents.




                                        190








   REMARKS:

        Txt is a long string object that can store a string of any size up to
        65535 characters long.  In OOGrid Library(TM) v1.0, however, because of
        the 255 characters limitation of the TInputLine object, it is used to
        store strings up to 255 characters long.

        A long string object is used because, unlike a normal string that uses
        all 255 bytes even if the text stored in it is one character long, the
        memory it requires depends on the length of the string.

        (see GLLSTR.INT)


   ************************************************************************
   TTextCell.Width function
   ************************************************************************
   DECLARATION:

        (see TCell.Width)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TUnlockedHashTable object
   ************************************************************************
   DECLARATION:

        TUnlockedHashTable = OBJECT(THashTable)
            CurrStart,
            CurrStop : CellPos;
          constructor Init;
          function Add(NewStart, NewStop: CellPos): Boolean;
          procedure CreateItem(var Item: HashItemPtr); virtual;
          function Delete(DStart, DStop: CellPos): Boolean;
          function Found(Item: HashItemPtr): Boolean; virtual;
          function HashValue : LongInt; virtual;
          function ItemSize : HashItemSizeRange; virtual;
          constructor Load(var S: TStream; Total: Longint);
          function Overwrite(NewStart, NewStop: CellPos): Boolean;
          function Search(SPos: CellPos): Boolean;
          procedure Store(var S: TStream);
          destructor Done;
        end; {...TUnlockedHashTable }

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Keeps track of unlocked cells in the spreadsheet.

   REMARKS:

        It stores areas that are marked as unlocked.

                                           191








        (see TSpreadSheet.SetProtection, TSpreadSheet.SetUnlocked,
        TSpreadSheet.SetLocked)


   ************************************************************************
   TUnlockedHashTable.Add function
   ************************************************************************
   DECLARATION:

        function Add(NewStart, NewStop: CellPos): Boolean;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Adds an block (area) of cells to the unlocked hash table.

   PARAMETERS' DESCRIPTION:

        NewStart  :    The upper left corner of the area being added.

        NewStop   :    The lower right corner of the area being added.

   REMARKS:

        Returns TRUE if the area was added sucessfully.


   ************************************************************************
   TUnlockedHashTable.CreateItem procedure
   ************************************************************************
   DECLARATION:

        (see TCellHashTable.CreateItem)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TUnlockedHashTable.CurrStart field
   ************************************************************************
   DECLARATION:

        CurrStart : CellPos;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Stores the location in the spreadsheet of the upper left corner of the
        block (area) of cells that is being added to the hash table;  also used
        by the Search function to store the position of the cell that is being
        searched.

                                           192








   REMARKS:

        You will never need to access this field directly.

        (see TUnlockedHashTable.CurrStop, TUnlockedHashTable.Search)


   ************************************************************************
   TUnlockedHashTable.CurrStop field
   ************************************************************************
   DECLARATION:

        CurrStop : CellPos;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Stores the location in the spreadsheet of the lower right corner of the
        block (area) of cells that is being added to the hash table.

   REMARKS:

        (see TUnlockedHashTable.CurrStart)


   ************************************************************************
   TUnlockedHashTable.Delete procedure
   ************************************************************************
   DECLARATION:

        (see TFormatHashTable.Delete)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TUnlockedHashTable.Done DESTRUCTOR
   ************************************************************************
   DECLARATION:

        destructor Done;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Performs the necessary cleanup and disposal of the unlocked hash table.






                                        193








   ************************************************************************
   TUnlockedHashTable.Found function
   ************************************************************************
   DECLARATION:

        (see TCellHashTable.Found)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TUnlockedHashTable.HashValue function
   ************************************************************************
   DECLARATION:

        (see TCellHashTable.HashValue)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TUnlockedHashTable.Init CONSTRUCTOR
   ************************************************************************
   DECLARATION:

        constructor Init;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Creates and initializes the TUnlockedHashTable object.

   ************************************************************************
   TUnlockedHashTable.ItemSize function
   ************************************************************************
   DECLARATION:

        (see TCellHashTable.ItemSize)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TUnlockedHashTable.Load CONSTRUCTOR
   ************************************************************************
   DECLARATION:

        constructor Load(var S: TStream; Total: Longint);

   UNIT:

        GLCELL.PAS

                                        194








   DESCRIPTION:

        Loads an unlocked hash table from disk.

   PARAMETERS' DESCRIPTION:

        S     :   the stream from which the unlocked hash table will be loaded.

        Total :   the total number of items that will be loaded from the stream.

   ************************************************************************
   TUnlockedHashTable.Overwrite function
   ************************************************************************
   DECLARATION:

        (see TFormatHashTable.Overwrite)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TUnlockedHashTable.Search function
   ************************************************************************
   DECLARATION:

        function Search(SPos: CellPos): Boolean;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Checks if a cell is part of any of the areas stored in the unlocked hash
        table.

   PARAMETERS' DESCRIPTION:

        SPos : position of the cell being checked.

   REMARKS:

        If Search returns TRUE, the cell is unlocked and therefore can be
        modified at any time, even when the spreadsheet is protected.

        (see TSpreadSheet.SetProtection)


   ************************************************************************
   TUnlockedHashTable.Store procedure
   ************************************************************************
   DECLARATION:

        procedure Store(var S: TStream);




                                        195








   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Writes an unlocked hash table to disk.

   PARAMETERS' DESCRIPTION:

        S : stream to which the unlocked hash table will be written.

   ************************************************************************
   TValueCell object
   ************************************************************************
   DECLARATION:

        TValueCell = object(TCell)
            Error : Boolean;
            Value : Extended;
          constructor Init(InitLoc : CellPos; InitError : Boolean;
            InitValue : Extended);
          function CellType : CellTypes; virtual;
          function LegalValue : Boolean; virtual;
          function Name : String; virtual;
          function Format(var FHash : TFormatHashTable;
            FormulasDisplayed : Boolean) : FormatType; virtual;
          function Width(var FHash : TFormatHashTable;
            FormulasDisplayed : Boolean) : Word; virtual;
          function Overwritten(var CHash : TCellHashTable;
            var FHash : TFormatHashTable; var WHash : TWidthHashTable;
            var LastPos : CellPos; MaxCols : Word;
            GetColWidth : GetColWidthFunc; FormulasDisplayed : Boolean) :
            Word; virtual;
          function ShouldUpdate : Boolean; virtual;
          function HasError : Boolean; virtual;
          function CurrValue : Extended; virtual;
          function OverwriteStart(var FHash : TFormatHashTable;
            var WHash : TWidthHashTable; GetColWidth : GetColWidthFunc;
            EndCol : Word; DisplayFormulas : Boolean) : Word; virtual;
          procedure EditString(MaxDecPlaces : Byte; var Input : String);
            virtual;
          function DisplayString(FormulasDisplayed : Boolean;
            MaxDecPlaces : Byte) : String; virtual;
          function FormattedString(var OHash : TOverwriteHashTable;
            var FHash : TFormatHashTable; var WHash : TWidthHashTable;
            GetColWidth : GetColWidthFunc; CPos : CellPos;
            FormulasDisplayed : Boolean; Start : Word; ColWidth : Byte;
            var CurrencyString : CurrencyStr; var ClType: CellTypes):
            String; virtual;
          function CopyString : String; virtual;
          constructor Load(var S : TStream);
          procedure Store(var S : TStream);
        end; {...TValueCell }

   UNIT:

        GLCELL.PAS

                                        196








   DESCRIPTION:

        A TCell's descendant that stores a number.

   ************************************************************************
   TValueCell.CellType function
   ************************************************************************
   DECLARATION:

        (see TCell.CellType)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TValueCell.CopyString function
   ************************************************************************
   DECLARATION:

        (see TCell.CopyString)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TValueCell.CurrValue function
   ************************************************************************
   DECLARATION:

        (see TCell.CurrValue)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TValueCell.DisplayString function
   ************************************************************************
   DECLARATION:

        (see TCell.DisplayString)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TValueCell.EditString procedure
   ************************************************************************
   DECLARATION:

        (see TCell.EditString)

   UNIT:

        GLCELL.PAS

                                        197








   ************************************************************************
   TValueCell.Error field
   ************************************************************************
   DECLARATION:

        Error : Boolean;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Indicates if there is a numeric error in the value stored by the cell.

   ************************************************************************
   TValueCell.Format function
   ************************************************************************
   DECLARATION:

        (see TCell.Format)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TValueCell.FormattedString function
   ************************************************************************
   DECLARATION:

        (see TCell.FormattedString)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TValueCell.HasError function
   ************************************************************************
   DECLARATION:

        (see TCell.HasError)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TValueCell.Init CONSTRUCTOR
   ************************************************************************
   DECLARATION:

        constructor Init(InitLoc : CellPos; InitError : Boolean;
          InitValue : Extended);




                                        198








   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Creates and initializes the TValueCell object.

   PARAMETERS' DESCRIPTION:

        InitLoc   :    the position of cell in the spreadsheet.

        InitError :    indicates if there is an error in the value.

        InitValue :    the value to be stored by the cell.

   ************************************************************************
   TValueCell.LegalValue function
   ************************************************************************
   DECLARATION:

        (see TCell.LegalValue)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TValueCell.Load CONSTRUCTOR
   ************************************************************************
   DECLARATION:

        constructor Load(var S: TStream);

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Loads the cell's contents from disk.

   PARAMETERS' DESCRIPTION:

        S : the stream from which will be read the cell's contents.

   ************************************************************************
   TValueCell.Name function
   ************************************************************************
   DECLARATION:

        (see TCell.Name)

   UNIT:

        GLCELL.PAS



                                        199








   ************************************************************************
   TValueCell.OverwriteStart function
   ************************************************************************
   DECLARATION:

        (see TCell.OverwriteStart)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TValueCell.Overwritten function
   ************************************************************************
   DECLARATION:

        (see TCell.Overwritten)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TValueCell.ShouldUpdate function
   ************************************************************************
   DECLARATION:

        (see TCell.ShouldUpdate)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TValueCell.Store procedure
   ************************************************************************
   DECLARATION:

        procedure Store(var S: TStream);

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Writes the cell's contents to disk.

   PARAMETERS' DESCRIPTION:

        S : the stream to which the cell's contents will be written.

   ************************************************************************
   TValueCell.Value field
   ************************************************************************
   DECLARATION:

        Value : Extended;

                                           200








   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        The value stored by the cell.

   ************************************************************************
   TValueCell.Width function
   ************************************************************************
   DECLARATION:

        (see TCell.Width)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TWidthHashTable object
   ************************************************************************
   DECLARATION:

        TWidthHashTable = OBJECT(THashTable)
            CurrCol : Word;
            CurrWidth : Byte;
            DefaultColWidth : Byte;
          constructor Init(InitBuckets: BucketRange;
            InitDefaultColWidth: Byte);
          destructor Done;
          function Add(SCol : Word; NewWidth : Byte) : Boolean;
          procedure Delete(Col : Word);
          function Search(Col : Word) : Byte;
          function HashValue : LongInt; virtual;
          function Found(Item : HashItemPtr) : Boolean; virtual;
          procedure CreateItem(var Item : HashItemPtr); virtual;
          function ItemSize : HashItemSizeRange; virtual;
          function GetDefaultColWidth : Byte;
          procedure Load(var S : TStream; Total : Longint);
          procedure Store(var S : TStream);
        end; {...TWidthHashTable }

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Stores column widths that are different from the default.

   REMARKS:

        The width hash table stores the column number and the width.





                                        201








   ************************************************************************
   TWidthHashTable.Add function
   ************************************************************************
   DECLARATION:

        function Add(SCol : Word; NewWidth : Byte) : Boolean;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Adds a new column width to the width hash table.

   PARAMETERS' DESCRIPTION:

        SCol      :    the number of the column whose width will be added to the
                       width hash table.

        NewWidth  :    the value of the new width being added.

   REMARKS:

        Add returns TRUE if the new width was successfully added; FALSE
        otherwise.

        IMPORTANT!  This method does not check if the new width assigned to a
        column is different from the default width before adding it to the hash
        table; it will add it anyway.


   ************************************************************************
   TWidthHashTable.CreateItem function
   ************************************************************************
   DECLARATION:

        (see TCellHashTable.CreateItem)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TWidthHashTable.CurrCol field
   ************************************************************************
   DECLARATION:

        CurrCol : Word;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Stores the number of the column whose width is being added, searched for
        or deleted from the width hash table.

                                           202








   REMARKS:

        You will never need to access this field directly.


   ************************************************************************
   TWidthHashTable.CurrWidth field
   ************************************************************************
   DECLARATION:

        CurrWidth : Byte;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Stores the value of the width being added or searched for -- if found --
        in the width hash table.

   REMARKS:

        You will never need to access this field directly.


   ************************************************************************
   TWidthHashTable.DefaultColWidth field
   ************************************************************************
   DECLARATION:

        DefaultColWidth : Byte;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Stores the default column width.

   REMARKS:

        This field is accessed only by TWidthHashTable.GetDefaultColWidth.  You
        will never need to access this field directly.


   ************************************************************************
   TWidthHashTable.Delete procedure
   ************************************************************************
   DECLARATION:

        procedure Delete(Col : Word);

   UNIT:

        GLCELL.PAS


                                        203








   DESCRIPTION:

        Deletes a column width from the width hash table.

   PARAMETERS' DESCRIPTION:

        Col  :    the number of the column whose width will be deleted from the
                  width hash table.

   ************************************************************************
   TWidthHashTable.Done DESTRUCTOR
   ************************************************************************
   DECLARATION:

        destructor Done;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Performs the necessary cleanup and disposal of the width hash table.

   ************************************************************************
   TWidthHashTable.Found function
   ************************************************************************
   DECLARATION:

        (see TCellHashTable.Found)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TWidthHashTable.GetDefaultColWidth function
   ************************************************************************
   DECLARATION:

        function GetDefaultColWidth : Byte;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Returns the default column width.

   REMARKS:

        It returns the value stored in the DefaultColWidth field.

        This method is used only by the private function GetColWidth in
        GLTSHEET.PAS (see GetColWidth).



                                        204








   ************************************************************************
   TWidthHashTable.HashValue function
   ************************************************************************
   DECLARATION:

        (see TCellHashTable.HashValue)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TWidthHashTable.Init CONSTRUCTOR
   ************************************************************************
   DECLARATION:

        constructor Init(InitBuckets: BucketRange;  
          InitDefaultColWidth: Byte);

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Creates and initializes the TWidthHashTable object.

   PARAMETERS' DESCRIPTION:

        InitBuckets         :    number of buckets (linked lists) the width hash
                                 table will have.

        InitDefaultColWidth :    default value for a column's width.

   REMARKS:

        (see TWidthHashTable)


   ************************************************************************
   TWidthHashTable.ItemSize function
   ************************************************************************
   DECLARATION:

        (see TCellHashTable.ItemSize)

   UNIT:

        GLCELL.PAS

   ************************************************************************
   TWidthHashTable.Load procedure
   ************************************************************************
   DECLARATION:

        procedure Load(var S : TStream; Total : Longint);



                                        205








   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Loads a width hash table from disk.

   PARAMETERS' DESCRIPTION:

        S     :   the stream from which the width hash table will be loaded.

        Total :   the total number of HashItems that will be loaded from the
                  stream.

   ************************************************************************
   TWidthHashTable.Search function
   ************************************************************************
   DECLARATION:

        function Search(Col : Word) : Byte;

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Searches in the width hash table for the width of a column.

   PARAMETERS' DESCRIPTION:

        Col : The number of the column whose width is being searched.

   REMARKS:

        If the column has not been assigned a width different from the default
        width, and therefore, it is not found in the width hash table, Search
        will return 0;  otherwise, it will return the width of the column.


   ************************************************************************
   TWidthHashTable.Store procedure
   ************************************************************************
   DECLARATION:

        procedure Store(var S : TStream);

   UNIT:

        GLCELL.PAS

   DESCRIPTION:

        Writes a width hash table to disk.




                                        206








   PARAMETERS' DESCRIPTION:

        S : the stream to which the width hash table will be written.

   ************************************************************************
   UpdatingTablesDialog function
   ************************************************************************
   DECLARATION:

        function UpdatingTablesDialog : PDialog;

   UNIT:

        GLTVR_US.PAS

   DESCRIPTION:

        (see CreateOOGLDialogs)









































                                        207



































































                                        208








   INDEX

   Add  62, 74, 76, 86, 87, 98,              object type ID's  3, 28
             192, 202                        standard help contexts 
   AddCell  127                                   3, 28
   AdjustAfter  67                           stream status   4
   Anchor  48                                string list index   4
   AnchorColShifted  49                 contents line  47
   AnchorRowShifted  49                 ContentsArea  134
   Attrib  110                          CopyCellBlock  135
   AUTHOR                               CopyString  53, 69, 80, 105,
        How to contact  1                         187, 197
   AutoCalc  127                        CreateItem  62, 74, 87, 100,
   BlankArea  128                                 192, 202
   BlockOn  128                         CreateOOGLDialogs  4, 9
   BlockOperation  6                    CreateOOGLStrings  4, 10
   Bucket  65, 66, 90, 129, 133,        CSheetInputLine  11
             183, 205                   CSpreadSheet  11
   CellHash  128                        CSpreadSheetBlackWhite  14
   CellHashStart  129                   CSpreadSheetColor  14
   CellInBlock  50                      CSpreadSheetMonochrome  14
   CellPos  4, 6                        CSpreadSheetWindow1  12
   CellsProtected  129                  CSpreadSheetWindow2  13
   CellToFString  129                   CurrBlock  135
   CellType  53, 69, 80, 105,           CurrCell  62, 100
             187, 197                   CurrCol  88, 202
   CellTypes  6                         CurrencyCharPart  14
   Change  92, 99                       CurrencyPart  15
   ChangeBounds  130                    CurrencyShift  15
   ChangeColHeaders  130                CurrencyStr  15
   ChangeColWidth  131                  CurrentKeyPosition  115
   ChangeHeaderDialog  6                CurrentRowPosition  116
   ChangeXXXX  7                        CurrFormat  74
   CheckForDragging  131                CurrKey  117
   ClearCurrBlock  131                  CurrLoc  63
   ClearScreenArea  132                 CurrName  88
   clipboard  7, 27, 135, 163,          CurrPos  100, 135
             169                        CurrStart  75, 192
   ClipBoardRecord  7                   CurrStop  75, 193
   cmXXXX  8                            CurrValue  54, 69, 80, 105,
   ColAdjustment  67, 160                         187, 197
   ColArea  132                         CurrWidth  203
   ColHeadersHash  132                  DataArea  136
   ColHeadersHashStart  133             DecPlacesPart  16
   ColStart  133                        DefaultColWidth  136, 203, 204
   ColStartArray  9                     DefaultCurrency  136
   ColToX  133                          DefaultDecimalPlaces  137
   Column                               DefaultXXXX   16
        default width  203-205          Delete  63, 76, 88, 101, 193,
        headers  2                                203
        width  2, 201-204, 206          DeleteBlock  137
   ColumnToString  134                  DeleteCell  137
   ColWidth  134                        DeleteColFromHash  138
   CommasPart  9                        DeleteColHeaders  138
   Constants                            DeleteColumns  139
        commands  3, 27                 DeleteRowFromHash  139
        default  4                      DeleteRows  140
        help contexts  3, 27, 29        DisplayAllCells  140

                                        209








   DisplayArea  140                     FormattedString  56, 71, 82,
   DisplayBlankArea  141                          106, 188, 198
   DisplayBlock  141                    FormatType  21
   DisplayBlockDiff  142                Formula  82
   DisplayCell  142                     FormulaHash  152
   DisplayCellBlock  142                FormulaOps  21
   DisplayCellData  143                 Formulas  2, 3
   DisplayCols  143                     FormulaStart  22
   DisplayFormulas  144                 Found  64, 76, 89, 103, 194,
   DisplayHeaders  144                            204
   DisplayInfo  144                     FStringSituationColor  152
   DisplayLimit  92                     General overview  1
   DisplayMessage  5, 17, 19, 31        GetColWidth  22
   DisplayRows  145                     GetColWidthFunc  23
   DisplayString  54, 70, 81,           GetData  5
             106, 187, 197              GetDefaultColWidth  203, 204
   DisplayXXXX  18                      GetFormat  152
   DoAfterEndInput  145                 GetFormula  82
   Done  55, 64, 76, 81, 89, 102,       GetPalette  113, 153, 184
             145, 187, 193, 204         GetWidthDialog  23
   DoneHashTables  146                  GLCELL.INT  2
   DragCursorWithMouse  146             GLEQUATES.PAS  3
   Draw  93, 96, 146                    GLLSTR.INT  191
   EditString  55, 70, 81, 106,         GLLSTR.PAS  1
             188, 197                   GLPARSER.INT  168
   EditXXXX  18                         GLPARSER.PAS  1
   Empty  18                            GLResFile  4, 23
   EmptyRowsAtBottom  147               GLSORT.PAS  3
   EmptyRowsAtTop  147                  GLSortExit   24
   EndCol  102                          GLStringList  4, 24
   EndModal  112                        GLSUPPRT.PAS  4
   EndState  112                        GLTSHEET.PAS  4
   EraseCellBlock  37, 148              GLTVR_US.PAS  4
   EraseMessage  5, 19, 31              GLVIEWS.PAS  5
   Error  81, 198                       GLWINDOW.PAS  5
   Execute  113                         GoToCell  153
   ExtendCurrBlock  35, 148             GoToDialog  24
   ExtendTo  50                         GoToEnd  153
   FillKeyRec  117                      HandleEvent  3, 93, 113, 154
   FindLastPos  148                     HandleInput  18, 154
   FindScreenColStart  149              HasError  71, 83, 106, 188,
   FindScreenColStop  149                         198
   FindScreenRowStart  150              HashError  57
   FindScreenRowStop  150               HashItem  62, 64-67, 78
   FirstItem  64                        HashItems  206
   FixBlockOverWrite  150               HashTable  2, 86
   FixFormulaCol  19                         Add  86
   FixFormulaRow  20                         CreateItem  86
   FixOverWrite  151                    HashValue  65, 77, 89, 103,
   Format  55, 70, 82, 106, 188,                  194, 205
             198                        hcCancel  28
        commas  9, 21, 32               hcNo  28
        currency  14-16, 21, 32         hcOk  28
        decimal places  16, 21          hcXXXX  3, 25
        justification  29               hcYes  28
   Format bits  21                      help system  12, 13
   FormatDefault  151                   info area  47, 145, 167, 170
   FormatDialog  20                     InfoArea  155

                                        210








   Init  50, 57, 65, 71, 77, 83,        MovePgRight  165
             89, 94, 96, 103,           MovePgUp  165
             107, 110, 114, 117,        MoveRight  166
             155, 184, 188, 194,        MoveUp  166
             205                        Name  58, 72, 84, 107, 189,
   InitClipboard  27                              199
   InitCommandNumber  3, 8, 27,         NextItem  64, 67
             46                         NoBlankArea  166
   InitCurrPos  156                     Number  167
   InitHelpContextNumber  3, 8,         NumberFormatShift  31
             25, 27, 46                 OldCurrPos  167
   InitObjectTypeID  3, 28              OldValue  95
   InitStandardContextNumber  3,        OOGridFileHeader  32, 47
             8, 25, 28, 46              Overwrite  78, 195
   input line  47                       OverwriteHash  167
   InputLine  28                        OverwriteHashStart  168
   InsertColumns  157                   OverwriteStart  59, 72, 84,
   InsertRows  157                                108, 189, 200
   InsertRowToHash  157                 Overwritten  59, 72, 84, 108,
   ItemSize  66, 77, 90, 103,                     190, 200
             194, 205                   Palettes
   Justification  29                         CSpreadSheetBlackWhite 
   JustPart  29                                   14
   KeyCols  118                              CSpreadSheetColor  14
   Keyposition  30                           CSpreadSheetMonochrome 
   KeyPressed  158                                14
   KeySortOrder  118                         standard application
   KeyValue  30                                   palette  5, 12-14
   LastKey  118                              TSheetInputLine  11
   LastPos  158                              TSpreadSheet  11, 184
   LegalValue  58, 71, 83, 107,              TSpreadSheetWindow  12,
             189, 199                             13
   Load  51, 66, 77, 83, 90, 94,        Parser  168
             107, 159, 189, 194,        PasteBlock  168
             199, 205                   PasteCellBlock  135, 164, 169
   LoadDelimited  159                   PasteDialog  32
   LoadHashTables  159                  PivotFirstKey  119
   LoadTablesFromTempFile  160          PivotSecondKey  119
   Loc  58                              PivotThirdKey  119
   LocateCursorWithMouse  161           PointInArea  111
   LowerRight  110                      Print  4, 169
   LowMemory  2, 46, 86                 PrintConfigRec  4
   Max  93                              PrintDialog  32
   MaxCols  161                         PrinterConfigRec  33
   MaxColWidth  161                     PrintingDialog  33
   MaxDecimalPlaces  162                PrintToDialog  33
   MaxRows  162                         QuickSort algorithm  4, 30,
   MaxScreenCols  162                             121
   MessageLine  17, 19, 31              RBlock  34
   Modified  163                        RChangeHeader  34
   ModifiedXXXX  31                     RChangeWidth  34
   MoveCell  163                        RCopyFormulas  35, 169
   MoveCellBlock  163                   README.TXT  1
   MoveDown  164                        Recalc  18, 169
   MoveHome  164                        RedrawXXXX  35
   MoveLeft  164                        RegisterGLCell  35
   MovePgDown  165                      RegisterGLSupprt  36
   MovePgLeft  165                      RegisterGLTSheet  36

                                        211








   RegisterGLViews  36                  SortingDialog  45
   RegisterSpreadSheet  37              SortObject  4, 178
   RemoveXXXX  37                       SortTypes  45
   RepeatChar  108                      SourceCellHash  122
   RepeatFirstChar  37                  SplitSortBlock   122
   RepeatTextChar  38                   Standard application palette 
   Resources  3, 4                                5
   RFormat  38                          StandardParser  168
   RFormulaCell  38                     StandardScrollBar  185
   RGoToCell  39                        StandardSortObject  4, 45
   RLimScrollBar  39                    Start  51
   RowAdjustment  67, 160               StatusMessage  17, 96
   RowArea  170                         Stop  51
   RowNumberSpace  170                  Store  52, 68, 79, 85, 91, 95,
   RowToY  171                                    109, 179, 190, 195,
   RPrint  40                                     200, 206
   RRepeatCell  40                      StoreHashTables  179
   RSheetInputLine  41                  StoreTablesToTempFile  179
   RSortInfo  41                        Stream
   RSpreadSheet  41                          additional status
   RTextCell  42                                  constants  4
   RValueCell  42                            registration records  3
   SameCellPos  171                     stRXXXX  46
   ScreenColRange  43                   stXXXX   46
   ScreenCols  43                       SwapRows  123
   ScreenPos  44                        sXXXX   47
   ScreenRowRange  44                   TBlock  4, 48
   ScreenRows  44                            Anchor   48, 49
   ScrollDraw  171                           AnchorColShifted   49
   Search  67, 75, 78, 90, 104,              AnchorRowShifted   49
             192, 195, 206                   CellInBlock  50
   SearchName  91                            ExtendTo  50
   SelectColumn  172                         Init  50
   SetAreas  172                             Load  51
   SetBlankArea  172                         Start  51
   SetChanged  31, 173                       Stop  51
   SetData  5                                Store  52
   SetKeyArray  120                     TCCell  2
   SetLimit  173                        TCell  2, 52
   SetLocked  2, 174                         CellType  53
   SetNameWithMouse  174                     CopyString  53
   SetNumber  174                            CurrValue  54
   SetPivot   121                            DisplayString  54
   SetProtection  175                        Done  55
   SetScreenColStart  176                    EditString  55
   SetScreenColStop  175                     Format  55
   SetScreenRowStart  176                    FormattedString  16, 56
   SetScreenRowStop  176                     HashError  57
   SetState  114, 177                        Init  57
   SetUnlocked  2, 177                       LegalValue  58
   SheetProtected  178                       Loc  58
   ShouldUpdate  60, 72, 84, 108,            Name  58
             190, 200                        OverwriteStart  59
   SizeLimits  185                           Overwritten  59
   Sort   121                                ShouldUpdate  60
   SortBlock  122                            Width  61
   SortData  178                        TCellHashTable  2, 61, 66
   SortDialog  45                            Add  62

                                        212








        CreateItem  62                       Format  82
        CurrCell  62                         FormattedString  82
        CurrLoc  63                          Formula  82
        Delete  63                           GetFormula  82
        Done  64                             HasError  83
        FirstItem  64                        Init  83
        Found  64, 65                        LegalValue  83
        HashValue  65                        Load  83
        Init  65                             Name  84
        ItemSize  66, 77                     OverwriteStart  84
        Load  66, 77                         Overwritten  84
        NextItem  67                         ShouldUpdate  84
        Search  65, 67                       Store  85
        Store  68                            Value  85
   TCHASH.INT  66, 86                        Width  85
   TCHASH.PAS  1, 2                     THashTable  2, 3, 85
   TColumnHeadersHashTable  2                Add  86
   TCUTIL.PAS  1                        THeadersHashTable  86
   TEmptyCell  2, 68                         Add  87
        CellType  69                         CreateItem  87
        CopyString  69                       CurrCol  88
        CurrValue  69                        CurrName  88
        DisplayString  70                    Delete  88
        EditString  70                       Done  89
        Format  70                           Found  89
        FormattedString  71                  HashValue  89
        HasError  71                         Init  89
        Init  71                             ItemSize  90
        LegalValue  71                       Load  90
        Name  72                             Search  90
        OverwriteStart  72                   SearchName  91
        Overwritten  72                      Store  91
        ShouldUpdate  72                TInputLine  5
        Width  73                       TLimScrollBar  5, 16, 91
   TFormatHashTable  2, 73                   Change  92
        Add  74, 76                          DisplayLimit  92
        CreateItem  74                       Draw  93
        CurrFormat  74                       HandleEvent  93
        CurrStart  75                        Init  94
        CurrStop  75                         Load  94
        Delete  76                           OldValue  95
        Done  76                             Store  95
        Found  76                       TMessageLine  5, 17, 19, 31,
        HashValue  77                             95
        Init  77                             Draw  96
        ItemSize  77                         Init  96
        Load  77                             StatusMessage  17, 96
        Overwrite  78                   ToggleAutoCalc  180
        Search  75, 78                  ToggleClipBoardOff  97
        Store  79                       ToggleClipBoardOn  97
   TFormulaCell  2                      ToggleDisplayHeaders  180
        CellType  80                    ToggleEnd  180
        CopyString  80                  ToggleFormulaDisplay  181
        CurrValue  80                   ToogleBlockOn  181
        DisplayString  81               Total  67
        Done  81                        TotalRows  181
        EditString  81                  TOverWriteHashTable  2, 23, 98
        Error  81                            Add  98

                                        213








        Change  99                           PivotFirstKey  119
        CreateItem  100                      PivotSecondKey  119
        CurrCell  100                        PivotThirdKey  119
        CurrPos  100                         SetKeyArray  120
        Delete  101                          SetPivot   121
        Done  102                            Sort   121
        EndCol  102                          SortBlock  122
        Found  103                           SourceCellHash  122
        HashValue  103                       SplitSortBlock   122
        Init  103                            SwapRows   123
        ItemSize  103                   TSpreadsheet  2-4, 14, 16, 24,
        Search  104                               47, 123, 184
   TrackCursor  181                          AddCell  127
   TRepeatCell  2, 104                       AutoCalc  127
        CellType  105                        BlankArea  128
        CopyString  105                      BlockOn  128
        CurrValue  105                       CellHash  128
        DisplayString  106                   CellHashStart  129
        EditString  106                      CellsProtected  129
        Format  106                          CellToFString  129
        FormattedString  106                 ChangeBounds  130
        HasError  106                        ChangeColHeaders  130
        Init  107                            ChangeColWidth  131
        LegalValue  107                      CheckForDragging  131
        Load  107                            ClearCurrBlock  131
        Name  107                            ClearScreenArea  132
        OverwriteStart  108                  ColArea  132
        Overwritten  108                     ColHeadersHash  132
        RepeatChar  108                      ColHeadersHashStart  133
        ShouldUpdate  108                    ColStart  133
        Store  109                           ColToX  133
        Width  109                           ColumnToString  134
   TScreenArea  4, 109                       ColWidth  134
        Attrib  110                          ContentsArea  134
        Init  110                            CopyCellBlock  135
        LowerRight  110                      CurrBlock  135
        PointInArea  111                     CurrPos  135, 145, 163
        UpperLeft  111                       DataArea  136
   TScrollBar  5                             DefaultColWidth  136
        Draw  93                             DefaultCurrency  136
        Max  93                              DefaultDecimalPlaces  137
   TSheetInputLine  5, 10, 111               DeleteBlock  137
        EndModal  112                        DeleteCell  137
        EndState  112, 113                   DeleteColFromHash  138
        Execute  113                         DeleteColHeaders  138
        GetPalette  113                      DeleteColumns  139
        HandleEvent  113                     DeleteRowFromHash  139
        Init  114                            DeleteRows  140
        SetState  114                        DisplayAllCells  140
   TSortObject  3, 115                       DisplayArea  140
        CurrentKeyPosition  115              DisplayBlankArea  141
        CurrentRowPosition  116              DisplayBlock  141
        CurrKey  117                         DisplayBlockDiff  142
        FillKeyRec  117                      DisplayCell  142
        Init  117                            DisplayCellBlock  142
        KeyCols  118                         DisplayCellData  143
        KeySortOrder  118                    DisplayCols  143
        LastKey  118, 121                    DisplayFormulas  144

                                        214








        DisplayHeaders  144                  MovePgUp  165
        DisplayInfo  144                     MoveRight  166
        DisplayRows  145                     MoveUp  166
        DoAfterEndInput  145                 NoBlankArea  166, 173
        Done  145                            Number  167
        DoneHashTables  146                  OldCurrPos  167
        DragCursorWithMouse  146             OverwriteHash  167
        Draw  146                            OverwriteHashStart  168
        EmptyRowsAtBottom  147               Parser  168
        EmptyRowsAtTop  147                  PasteBlock  168
        EraseCellBlock  37, 148              PasteCellBlock  135, 164,
        ExtendCurrBlock  35, 148                  169
        FindLastPos  148                     Print  4, 16, 169
        FindScreenColStart  149              Recalc  18, 169
        FindScreenColStop  149               RowArea  170
        FindScreenRowStart  150              RowNumberSpace  170
        FindScreenRowStop  150               RowToY  171
        FixBlockOverWrite  150               SameCellPos  171
        FixOverWrite  151                    ScrollDraw  171
        FormatDefault  151                   SelectColumn  172
        FormulaHash  152                     SetAreas  172
        FStringSituationColor                SetBlankArea  172
             152                             SetChanged  31, 173
        GetFormat  152                       SetLimit  173
        GetPalette  153                      SetLocked  2, 174
        GoToCell  153                        SetNameWithMouse  174
        GoToEnd  153                         SetNumber  174
        HandleEvent  3, 154                  SetProtection  175
        HandleInput  18, 154                 SetScreenColStart  176
        InfoArea  155                        SetScreenColStop  175
        Init  155                            SetScreenRowStart  176
        InitCurrPos  156                     SetScreenRowStop  176
        InsertColumns  157                   SetState  177
        InsertRows  157                      SetUnlocked  2, 177
        InsertRowToHash  157                 SheetProtected  178
        KeyPressed  158                      SortData  178
        LastPos  158                         SortObject  4, 178
        Load  159                            Store  179
        LoadDelimited  159                   StoreHashTables  179
        LoadHashTables  159                  StoreTablesToTempFile 
        LoadTablesFromTempFile                    179
             160                             ToggleAutoCalc  180
        LocateCursorWithMouse                ToggleDisplayHeaders  180
             161                             ToggleEnd  180
        MaxCols  161                         ToggleFormulaDisplay  181
        MaxColWidth  161                     ToogleBlockOn  181
        MaxDecimalPlaces  162                TotalRows  181
        MaxRows  162                         TrackCursor  181
        MaxScreenCols  162                   UnlockedHash  182
        Modified  163                        UpdateScreenBlockDisplay 
        MoveCell  163                             182
        MoveCellBlock  163                   WidthHash  182
        MoveDown  164                        WidthHashStart  183
        MoveHome  164                        XToCol  183
        MoveLeft  164                        YToRow  183
        MovePgDown  165                 TSpreadSheetWindow  5, 12, 13,
        MovePgLeft  165                           184
        MovePgRight  165                     GetPalette  184

                                        215








        Init  184                            ShouldUpdate  200
        SizeLimits  185                      Store  200
        StandardScrollBar  185               Value  200
   TStringList  24, 47                       Width  201
   TTextCell  2, 186                    TView  5
        CellType  187                   TWidthHashTable  2, 201
        CopyString  187                      Add  202
        CurrValue  187                       CreateItem  202
        DisplayString  187                   CurrCol  202
        Done  187                            CurrWidth  203
        EditString  188                      DefaultColWidth  203, 204
        Format  188                          Delete  203
        FormattedString  188                 Done  204
        HasError  188                        Found  204
        Init  188                            GetDefaultColWidth  203,
        LegalValue  189                           204
        Load  189                            HashValue  205
        Name  189                            Init  205
        OverwriteStart  189                  ItemSize  205
        Overwritten  190                     Load  205
        ShouldUpdate  190                    Search  206
        Store  190                           Store  206
        Txt  190                        TWindow  5
        Width  191                      Txt  190
   TUnlockedCellHashTable  2            UnlockedHash  182
        Search  192                     UpdateScreenBlockDisplay  182
   TUnlockedHashTable  191              UpdatingTablesDialog  207
        Add  192                        UpperLeft  111
        CreateItem  192                 Value  85, 200
        CurrStart  192                  Width  61, 73, 85, 109, 191,
        CurrStop  193                             201
        Delete  193                     WidthHash  182
        Done  193                       WidthHashStart  183
        Found  194                      XToCol  183
        HashValue  194                  YToRow  183
        Init  194
        ItemSize  194
        Load  194
        Overwrite  195
        Search  195
        Store  195
   Tutorial  1
   TValueCell  2, 196
        CellType  197
        CopyString  197
        CurrValue  197
        DisplayString  197
        EditString  197
        Error  198
        Format  198
        FormattedString  198
        HasError  198
        Init  198
        LegalValue  199
        Load  199
        Name  199
        OverwriteStart  200
        Overwritten  200

                                        216






