IVZEffects.Add

Syntax

Add(Value: IVZEffect): Interger;

Parameters

Value. The effect that is used to highlight a control.

Description

The Add add new effect to the collection of effects.

Comments

The effect is added to the end of the collection.

The method returns index of the effect added to the collection.

Example

Executing the example requires that the repository contains an express report with a bubble chart. Determine outline for active and non active elements, determine transparency parameters, display the number of effects in the collection for inactive elements to the console.

Place the Button, UiErAnalyzer, EaxBubbleChartBox components named Button1, UiErAnalyzer1 and EaxBubbleChartBox1 correspondingly on the form. For UiErAnalyzer select the Active property to True, OperationMode to Edit and select the express report in the Object property. For EaxBubbleChartBox select the UiErAnalyzer1 component in the Source property.

Add links to the Express, Drawing, Forms, and Visualizators system assemblies.

The example is the OnClick event handler for the Button1 component.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    EBubbleChart: IVZBubbleChart;
    AlphaEffect: IVZAlphaChannelEffect;
    BoEffect: IVZBorderEffect;
    Color: IGxColor;
    Feather: IGxPen;
    SAE, SIE: IVZEffects;
Begin
    EBubbleChart := UiErAnalyzer1.ErAnalyzer.BubbleChart.BubbleChart;
    
// Determine parameters of the transparency effect for elements
    AlphaEffect := New VZAlphaChannelEffect.Create;
    AlphaEffect.Alpha := 
0.2;
    SIE := 
New VZEffects.Create;
    
// Add an effect to the collection
    SIE.Add(AlphaEffect);
    
// Determine parameters of the outline highlighting with violet
    Color := New GxColor.CreateRGB(15350204);
    Feather := 
New GxPen.CreateSolid(Color, 1);
    BoEffect := 
New VZBorderEffect.Create;
    BoEffect.BorderPen := Feather;
    
// Insert a new effect to the position with index 0 to highlight inactive elements
    SIE.InsertAt(0, BoEffect);
    
// Apply effects to inactive elements
    EBubbleChart.SelectInactiveEffects := SIE;
    
// Create a green outline
    Color := New GxColor.CreateRGB(1412875);
    Feather := 
New GxPen.CreateSolid(Color, 1);
    BoEffect := 
New VZBorderEffect.Create;
    BoEffect.BorderPen := Feather;
    SAE := 
New VZEffects.Create;
    SAE.Add(BoEffect);
    
// Apply effect for active elements
    EBubbleChart.SelectActiveEffects := SAE;
    UiErAnalyzer1.ErAnalyzer.BubbleChart.Refresh;

    // Display the number of effects for inactive elements to the console
    Debug.WriteLine(
"Number of effects in collection for inactive elements: " + SIE.Count.ToString);
End Sub Button1OnClick;

After clicking the button, select the elements of the bubble chart. Active element will be displayed with the green outline, inactive elements will be displayed with the specified transparency and the violet outline. The console displays information about the number of effects for inactive elements in the collection:

The number of effects for inactive elements in the collection: 2

See also:

IVZEffects