ITabSheet.EventMask

Syntax

EventMask: TabViewEventGroups;

Description

The EventMask property determines which event groups are to be called for the table.

Comments

By default all events except the TabViewEventGroups.EditorEvents group are executed for the table.

Using this property may save much time when allocating a data area, the source of which has a large selection, or when updating such a data area when the selection in the report source is changed.

Example

See below how this property is used to save time when calculating a data area of a regular report.

To execute the example, create a unit (see the text below). Then create a regular report and set the earlier created unit as the event handler for this report (specify class as EventsClass). Next create a data area on the report sheet.

Class EventsClass: ReportEvents
    start_ticks, end_ticks, ticks: Integer;

    Public Sub OnBeforeExecuteDataIsland(DataIsland: IPrxDataIsland; Var Cancel: Boolean);
    Var
        TSheet: ITabSheet;
    Begin
        TSheet := (DataIsland.Sheet As IPrxTable).TabSheet;
        TSheet.EventMask := TabViewEventGroups.ClickEvents Or
            TabViewEventGroups.InteractiveEvents Or
            TabViewEventGroups.NotifyEvents Or
            TabViewEventGroups.SelectionEvents;
        start_ticks := DateTime.Ticks;
    End Sub OnBeforeExecuteDataIsland;

    Public Sub OnAfterExecuteDataIsland(DataIsland: IPrxDataIsland);
    Var
        TSheet: ITabSheet;
    Begin
        end_ticks := DateTime.Ticks;
        TSheet := (DataIsland.Sheet As IPrxTable).TabSheet;
        TSheet.EventMask := TabViewEventGroups.AllEvents;
        ticks := end_ticks - start_ticks;
        WinApplication.InformationBox(ticks.ToString);
    End Sub OnAfterExecuteDataIsland;

End Class EventsClass;

Before a data area is calculated (when the OnBeforeExecuteDataIsland event occurs), only the specified event groups are to be called, other groups are disabled (CellChangeEvents, ResizeEvents, EditEvents). After the data area is calculated, all events will be processed for the table. An information message is also displayed showing the time spent for this operation (in milliseconds).

See also:

ITabSheet