                        TVerticalGrid Component Help
                        ============================

In the document below, only methods and properties specific and significant
to the TVerticalGrid component are discussed. For other standard properties
refer to the Delphi online documentation for the TDrawgrid and/or TDBGrid
components.

Remember that whenever the Row and Column of the Grid is passed to an event,
Row is the index into the current column. Col can only have a value of 0 or 1.
0 for the column in which the titles are displayed and 1 for the column in
which the data is displayed.

                  { Column Public Properties and Methods }
                   --------------------------------------

        Create(Collection: TCollection); override;
            There should be no reason to call this method directly.
            Call the Grid.Columns.Add method if you want to add a
            column to the grid.

        Destroy; override;
            There should be no reason to call this method directly.
            Call the Grid.Columns.Delete(Index) method if you want to
            delete a column from the grid.

        procedure Refresh;
            Refreshes the Row of the grid where the column is displayed

            Example :   Grid.Columns[0].Refresh
                or      Grid.Columns['Column Title'].Refresh

                Note:   Columns can be referred to using the Column index
                        or by using the Column.Title as and index, much like
                        FieldNames for Datasets in Delphi 3

        property  Grid: TVerticalGrid
            Returns the Grid that the column belongs to.

        property  Field: TField
            If the column is bound (associated with a TField) then the
            Field is returned otherwise Nil is returned.

        property  Value : Variant
            Each column has a value property which can be assigned. This is
            for use of unbound columns (not linked to a field in a dataset).
            If a value is assigned to this property, the FieldName and Field
            properties are cleared.

                To test if a value is assigned to Value:

                    IF VarType(Value) = varEmpty Then ...

            If a value is assigned to Value it will be maintained when
            the grid is edited.

            To assign a value to this property at design time, set the
            Text property of the Column.

            See also: Text Property

                     { Column : Published Properties }
                      -------------------------------

    property  PickList: TStrings
            Returns the PickList assigned to the Column

            If this property is assigned and the ButtonStyle Property
            is set to cbsAuto, then the column editor will display a
            ComboBox.

    property  FieldName: String
            The Name of the field which contents should be displayed in
            the grid.

            If this property is assigned, the Value and Text properties are
            cleared.

    property  Title: String
            Title is the display label for the column;

    property  ButtonStyle: TColumnButtonStyle;
            TColumnButtonStyle = (cbsAuto, cbsEllipsis, cbsNone);

            cbsAuto :       If PickList is Assigned the edit will be a ComboBox.

                            If the column is bound and and the Lookup properties
                            for the Field is assigned, a Lookup list will be
                            presented upon editing.

                            Else
                                A simple edit will be presented.

            cbsEllipsis :   The editor will display an ellipsis and the
                            OnEditButtonClick event will be triggered when the
                            button is clicked. If the OnEditButtonClick event
                            for the Column is not assigned, the
                            OnEditButtonClick event of the Grid will be
                            triggered.

                            The Grid Event will not be triggered if the Column
                            event is assigned.

            cbsNone     :   A simple edit will be displayed, even if the
                            PickList property is assigned or the Lookup
                            properties of the Field is set.

    property  DropDownRows: Cardinal
            The number of rows for the DropDown PickList if applicable

    property  PopupMenu: TPopupMenu
            A PopupMenu that will be displayed if RightClick.

    property  ReadOnly: Boolean
            Set ReadOnly to True if the Column cannot be edited.
            The ReadOnly status is also determined by the ReadOnly property
            of the Grid and the ReadOnly property of the Field.

            Note: If the column is ReadOnly and the ButtonStyle property is
                  set to cbsEllipsis, Clicking the ellipsis is not restricted.

    property  EditMask : String
            The EditMask for the column being edited. The EditMask can also
            be specified in the OnGetEditMask event.

    property  OnEditButtonClick: TNotifyEvent
            The event that will be triggered if the ButtonStyle is set to
            cbsEllipsis. Use this event to implement Custom Edit behaviour.
            If this event is not assigned, the OnEditButtonClick event of
            the Grid will be triggered

    property OnGetEditMask : TGetMaskEvent
            To specify the column's editmask at runtime
            TGetMaskEvent = procedure (Sender: TObject; ARow: Longint;
                                       var Mask : String) of object;

    property OnGetEditText : TGetTextEvent
            This event is triggered when the column edit becomes active.
            If the Value or Field property is assigned, the value is set before
            this event is triggered.

            TGetTextEvent = procedure (Sender: TObject; ACol, ARow: Longint;
                                       PickList : TStrings;
                                       var Value: Variant) of object;

            The Value can be changed and/or the PickList items can be assigned
            this event can be used in the same way as the OnDropDown event
            of the TComboBox.

            The PickList is passed can for example be used as follow for
            boolean Fields :

               Value := PickList[Ord(BooleanValue)];

               assuming that PickList contains "False, True" or "No, Yes"


            If the same text is displayed and edited, the OnGetText event can
            be implemented to as a dual purpose event.

            The ACol parameter will always be 1 for this event and is only
            passed to maintain compatibility with the OnGetText event.

    property OnGetText     : TGetTextEvent
            This event is triggered before the Title or Data for a column is
            drawn.

            If the Value or Field property is assigned, the value is set before
            this event is triggered for the data column.

            The value is set to the Title property of a column before this
            event is triggered for the title column.

             TGetTextEvent = procedure (Sender: TObject; ACol, ARow: Longint;
                                        PickList : TStrings;
                                        var Value: Variant) of object;

            The PickList is passed can for example be used as follow for
            boolean Fields :

                Value := PickList[Ord(BooleanValue)];
                assuming that PickList contains "False, True" or "No, Yes"

          For the following datatypes the text is automatically set before
          this event is triggered.

          Case Field.DataType of
              ftBytes,
              ftTypedBinary,
              ftVarBytes   : Result := '<Binary>';
              ftBlob       : Result := '<Blob>';
              ftMemo       : Result := '<Memo>';
              ftGraphic    : Result := '<Bitmap>';
              ftFmtMemo    : Result := '<Formatted>';
              ftParadoxOle,
              ftDBaseOle   : Result := '<OLE>';
          End;

    property OnSetEditText: TSetEditEvent
            This event is triggered whenever the text in the editor changes, on
            every keystroke.

            TSetEditEvent = procedure (Sender: TObject; ARow: Longint;
                                       PickList : TStrings;
                                       const Value: Variant) of object;

            See the OnSetText event for implementing action after all the
            editing is done.

            The Field and Value is automatically maintained and in general
            there is no need to implement this event

    property OnSetText: TSetTextEvent
            This event is triggered after all the editing is done and the new
            value needs to be saved. Saving of values is automatically done
            for Fields and the Value property but the event will still be
            triggered if it is implemented.

            TSetTextEvent = procedure (Sender: TObject; ARow: Longint;
                                       Modified : Boolean; PickList : TStrings;
                                       const Value: Variant) of object;

            IMPORTANT : The ARow parameter of this event must be used as an
                        Index to the Column being edited and NOT the Row
                        property of the Grid. Sometimes the grid will already
                        be repositioned when this event is triggered.

    property OnValidate : TValidateEvent
            This event can be implemented to validate the edited value of
            the column before the OnSetText event is triggered.

            TValidateEvent = procedure (Sender: TObject; ARow: Longint;
                                        PickList : TStrings;
                                        var Value: Variant;
                                        var Accept : Boolean) of object;

            To reset the Value of the Column, set Accept := False

            This event can also be used to take action when the typed value
            is not in the PickList, like an OnNotInList event.

            The Value can be changed before the OnSetText event is triggered.

    property Text : String
            The Text property is used to set the Public Value: Variant
            property at design time;

                { Columns : Public Properties and Methods }
                 -----------------------------------------

    Columns is of type TCollection

    Create(Grid: TVerticalGrid; ColumnClass: TColumnClass);
            This method should never be called by the programmer.

    function  Add: TColumn;
            This method can be called to add a column to the Grid and
            returns the column added

    procedure Clear;
            This method should not be called by the programmer.
            Call the Reset method of the Grid to Remove all columns.

    procedure Delete(Index : Variant);
            This method deletes the column with the specified index from the
            Grid.

            Example :   Grid.Columns[0].Delete
                or      Grid.Columns['Column Title'].Delete

                Note:   Columns can be referred to using the Column index
                        or by using the Column.Title as and index, much like
                        FieldNames for Datasets in Delphi 3

    Property Count
            The number of columns in the Grid

                   { Grid Public Properties and Methods }
                    ------------------------------------

    function CellRect(ACol, ARow: Longint): TRect;
        Returns TRect for a specified Row and Column

    procedure MouseToCell(X, Y: Integer; var ACol, ARow: Longint);
        Returns the Row an Column in which the specified coordinate falls

    Procedure Reset; override;
        Clears all the Columns of the grid and Reset the Row, Column and Editor
        of the grid.

    property Row;
        The Current selected row in the grid.

                       { Grid Published Properties }
                        ---------------------------

    property Columns: TVrtGridColumns
        The columns of the grid see the section on Columns above.

    property TitleTextColor : TColor
        The color in which the Title Column's text will be displayed

    property DataTextColor : TColor
        The color in which the Data Column's text will be displayed

    property OnColEnter: TNotifyEvent
        This event is triggered when a new column receives focus

    property OnColExit: TNotifyEvent
        This event is triggered before the focus is removed from a column

    property OnEditButtonClick : TEditButtonClick
        This event is triggered if the ButtonStyle of a Column is cbsEllipsis
        and the OnEditButtonClick of the column is not implemented.

        If the DataType of a Field is in [ftUnknown, ftBytes, ftTypedBinary,
        ftVarBytes, ftBlob, ftMemo, ftGraphic, ftFmtMemo, ftParadoxOle,
        ftDBaseOle] and this event is implemented, the Column.ButtonStyle
        will automatically be set to cbsEllipsis and this event will be
        triggered when it is clicked.

    Property ReadOnly : Boolean
        ReadOnly specifies whether the columns in the Grid can be Edited.
        The ReadOnly properties of the specific column and the Field of a
        column are also considered before a column is edited.


